updating c2 profile build to leverage ui_position specifications

This commit is contained in:
its-a-feature
2026-04-10 10:14:05 -05:00
parent b5459b56c8
commit b87219b1e9
8 changed files with 39 additions and 12 deletions
+6
View File
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.3.109] - 2026-04-10
### Changed
- Updated the UI to sort c2 profile parameters during payload build by ui_position if specified
## [0.3.107] - 2026-03-23
### Changed
@@ -39,6 +39,7 @@ query getPayloadTypesC2ProfilesQuery($payloadType: String!, $operation_id: Int!)
required
verifier_regex
choices
ui_position
}
c2profileparametersinstances(where: {instance_name: {_is_null: false}, operation_id: {_eq: $operation_id}}, distinct_on: instance_name, order_by: {instance_name: asc}){
instance_name
@@ -61,6 +62,7 @@ query getProfileInstanceQuery($name: String!, $operation_id: Int!, $c2_profile_i
required
verifier_regex
choices
ui_position
c2profile {
name
}
@@ -86,6 +88,7 @@ query getDefaultC2ProfileParameters($c2profile_id: Int!) {
required
verifier_regex
choices
ui_position
}
}
}
@@ -150,7 +153,13 @@ export function Step4C2Profiles(props){
onCompleted: data => {
const profiles = data.c2profile.map( (c2) => {
const parameters = getModifiedC2Params(c2, c2.c2profileparameters, props.buildOptions, false);
parameters.sort((a,b) => -b.description.localeCompare(a.description));
let hasUiPositions = parameters.filter(p => p.ui_position > 0).length > 0;
if(hasUiPositions){
parameters.sort((a,b) => a.ui_position > b.ui_position ? 1 : a.ui_position === b.ui_position ? 0 : -1);
} else {
parameters.sort((a,b) => -b.description.localeCompare(a.description));
}
return {...c2, c2profileparameters: parameters, "selected_instance": "None"};
});
profiles.sort((a, b) => -b.name.localeCompare(a.name))
@@ -285,7 +294,13 @@ export function Step4C2Profiles(props){
return inst;
});
updates = getModifiedC2Params(c2, updates, props.buildOptions, true);
updates.sort( (a, b) => a.description < b.description ? -1 : 1);
//updates.sort( (a, b) => a.description < b.description ? -1 : 1);
let hasUiPositions = updates.filter(p => p.ui_position > 0).length > 0;
if(hasUiPositions){
updates.sort((a,b) => a.ui_position > b.ui_position ? 1 : a.ui_position === b.ui_position ? 0 : -1);
} else {
updates.sort((a,b) => -b.description.localeCompare(a.description));
}
const updatedc2 = includedC2Profiles.map( (curc2, indx) => {
if(index === indx){
return {...curc2, c2profileparameters: updates, selected_instance: evt.target.value};
@@ -310,7 +325,13 @@ export function Step4C2Profiles(props){
choices: getDefaultChoices(param)};
});
updates = getModifiedC2Params(c2, updates, props.buildOptions, false);
updates.sort( (a, b) => a.description < b.description ? -1 : 1);
let hasUiPositions = updates.filter(p => p.ui_position > 0).length > 0;
if(hasUiPositions){
updates.sort((a,b) => a.ui_position > b.ui_position ? 1 : a.ui_position === b.ui_position ? 0 : -1);
} else {
updates.sort((a,b) => -b.description.localeCompare(a.description));
}
//updates.sort( (a, b) => a.description < b.description ? -1 : 1);
const updatedc2 = includedC2Profiles.map( (curc2, indx) => {
if(index === indx){
return {...curc2, c2profileparameters: updates, selected_instance: 'None'};
+1 -1
View File
@@ -15,7 +15,7 @@ import {jwtDecode} from 'jwt-decode';
import {meState} from './cache';
import {getSkewedNow} from "./components/utilities/Time";
export const mythicUIVersion = "0.3.108";
export const mythicUIVersion = "0.3.109";
let fetchingNewToken = false;
@@ -1,17 +1,17 @@
{
"files": {
"main.css": "/new/static/css/main.262ce320.css",
"main.js": "/new/static/js/main.64e362e7.js",
"main.js": "/new/static/js/main.e5e2ea07.js",
"sql-wasm.wasm": "/new/sql-wasm-7f26ab750fcdafabbe18c6525a66a0bd.wasm",
"static/media/mythic-red.png": "/new/static/media/mythic-red.203468a4e5240d239aa0.png",
"static/media/graphql.png": "/new/static/media/graphql.8f15978b39b0870a9f0e.png",
"static/media/Mythic_Logo.svg": "/new/static/media/Mythic_Logo.6842c911bebe36d6f83fc7ced4a2cd99.svg",
"index.html": "/new/index.html",
"main.262ce320.css.map": "/new/static/css/main.262ce320.css.map",
"main.64e362e7.js.map": "/new/static/js/main.64e362e7.js.map"
"main.e5e2ea07.js.map": "/new/static/js/main.e5e2ea07.js.map"
},
"entrypoints": [
"static/css/main.262ce320.css",
"static/js/main.64e362e7.js"
"static/js/main.e5e2ea07.js"
]
}
+1 -1
View File
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/new/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="apple-touch-icon" href="/new/logo192.png"/><link rel="manifest" href="/new/manifest.json"/><title>Mythic</title><script defer="defer" src="/new/static/js/main.64e362e7.js"></script><link href="/new/static/css/main.262ce320.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/new/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="apple-touch-icon" href="/new/logo192.png"/><link rel="manifest" href="/new/manifest.json"/><title>Mythic</title><script defer="defer" src="/new/static/js/main.e5e2ea07.js"></script><link href="/new/static/css/main.262ce320.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>