Skip to content

Commit

Permalink
v3.2.18-rc3
Browse files Browse the repository at this point in the history
  • Loading branch information
its-a-feature committed Feb 9, 2024
1 parent c9b9f94 commit cc9169d
Show file tree
Hide file tree
Showing 30 changed files with 282 additions and 217 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ 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).

## [3.2.18-rc3] - 2024-02-09

### Changed

- [UI Fixes](/MythicReactUI/CHANGELOG.MD)
- [mythic-cli updates](/Mythic_CLI/Changelog.md)
- Updated file-based routes to also log file_id

## [3.2.17.1] - 2024-02-08

### Changed
Expand Down
8 changes: 8 additions & 0 deletions MythicReactUI/CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ 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.1.64] - 2024-02-09

### Changed

- Updated graph views to show nodes without edges as well
- Updated the new experimental table to support background coloring for full table cells
- Fixed a bug with multiple dynamic choice options sometimes not setting all values

## [0.1.63] - 2024-02-07

### Changed
Expand Down
12 changes: 10 additions & 2 deletions MythicReactUI/src/components/pages/Callbacks/C2PathDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ export function C2PathDialog({callback, callbackgraphedges, onClose, onOpenTab})
/>
}
<DrawC2PathElementsFlowWithProvider
providedNodes={[callback]}
edges={callbackgraphedges}
view_config={viewConfig}
theme={theme}
Expand Down Expand Up @@ -621,7 +622,7 @@ export const DrawC2PathElementsFlowWithProvider = (props) => {
</ReactFlowProvider>
)
}
export const DrawC2PathElementsFlow = ({edges, panel, view_config, theme, contextMenu}) =>{
export const DrawC2PathElementsFlow = ({edges, panel, view_config, theme, contextMenu, providedNodes}) =>{
const [graphData, setGraphData] = React.useState({nodes: [], edges: [], groups: []});
const [nodes, setNodes] = React.useState();
const [edgeFlow, setEdgeFlow] = React.useState([]);
Expand Down Expand Up @@ -1012,6 +1013,13 @@ export const DrawC2PathElementsFlow = ({edges, panel, view_config, theme, contex
}
return tempNewEdges
}
if(providedNodes){
for(let i = 0; i < providedNodes.length; i++){
if(view_config["include_disconnected"]) {
add_node(providedNodes[i], view_config);
}
}
}
let updatedEdges = createNewEdges();
// need to add fake edges between parent groups and Mythic so that rendering will be preserved
updatedEdges.forEach( (edge) => {
Expand Down Expand Up @@ -1175,7 +1183,7 @@ export const DrawC2PathElementsFlow = ({edges, panel, view_config, theme, contex
nodes: tempNodes,
edges: tempEdges
})
}, [edges, view_config, theme]);
}, [edges, view_config, theme, providedNodes]);
React.useEffect( () => {
(async () => {
if(graphData.nodes.length > 0){
Expand Down
3 changes: 1 addition & 2 deletions MythicReactUI/src/components/pages/Callbacks/Callbacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import AssessmentIcon from '@mui/icons-material/Assessment';
import { CallbacksTop } from './CallbacksTop';
import Split from 'react-split';
import PhoneForwardedIcon from '@mui/icons-material/PhoneForwarded';
import {ImportPayloadConfigDialog} from "../Payloads/ImportPayloadConfigDialog";
import {MythicDialog} from "../../MythicComponents/MythicDialog";
import {ImportCallbackConfigDialog} from "./ImportCallbackConfigDialog";

Expand All @@ -34,7 +33,7 @@ const StyledSpeedDial = styled(SpeedDial)(({theme}) => ({
top: theme.spacing(2),
right: theme.spacing(2),
},
zIndex: 1,
zIndex: 2,
},

[`& .${classes.speedDialAction}`]: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import OutlinedInput from '@mui/material/OutlinedInput';
import InputLabel from '@mui/material/InputLabel';
import FormControl from '@mui/material/FormControl';
import Select from '@mui/material/Select';
import {CallbackGraphEdgesContext, OnOpenTabContext} from './CallbacksTop';
import {CallbackGraphEdgesContext, CallbacksContext, OnOpenTabContext} from './CallbacksTop';

const ITEM_HEIGHT = 48;
const ITEM_PADDING_TOP = 1;
Expand Down Expand Up @@ -213,6 +213,7 @@ const GraphViewOptions = ({viewConfig, setViewConfig}) => {
}
export function CallbacksGraph({}){
const theme = useTheme();
const callbacks = useContext(CallbacksContext);
const callbackgraphedges = useContext(CallbackGraphEdgesContext);
const onOpenTab = useContext(OnOpenTabContext);
//used for creating a task to do a link command
Expand Down Expand Up @@ -407,7 +408,7 @@ export function CallbacksGraph({}){
action={"select"} display={"display"} identifier={"display"}/>}
/>
}
<DrawC2PathElementsFlowWithProvider edges={callbackgraphedges} view_config={viewConfig} theme={theme}
<DrawC2PathElementsFlowWithProvider providedNodes={callbacks} edges={callbackgraphedges} view_config={viewConfig} theme={theme}
panel={<GraphViewOptions setViewConfig={setViewConfig} viewConfig={viewConfig} />}
contextMenu={contextMenu}/>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useMemo } from 'react';
import React, { useEffect, useMemo, useContext} from 'react';
import {MythicTransferListDialog} from '../../MythicComponents/MythicTransferList';
import {MythicDialog} from '../../MythicComponents/MythicDialog';
import {
Expand All @@ -21,6 +21,7 @@ import {TableFilterDialog} from './TableFilterDialog';
import {CallbacksTabsHideMultipleDialog} from "./CallbacksTabsHideMultipleDialog";
import {CallbacksTabsTaskMultipleDialog} from "./CallbacksTabsTaskMultipleDialog";
import ip6 from 'ip6';
import {CallbackGraphEdgesContext, CallbacksContext} from "./CallbacksTop";

export const ipCompare = (a, b) => {
let aJSON = JSON.parse(a);
Expand Down Expand Up @@ -61,6 +62,7 @@ export const ipCompare = (a, b) => {
}
}
function CallbacksTablePreMemo(props){
const callbacks = useContext(CallbacksContext);
const [sortData, setSortData] = React.useState({"sortKey": null, "sortDirection": null, "sortType": null});
const [openContextMenu, setOpenContextMenu] = React.useState(false);
const [openAdjustColumnsDialog, setOpenAdjustColumnsDialog] = React.useState(false);
Expand Down Expand Up @@ -227,7 +229,7 @@ function CallbacksTablePreMemo(props){
return false;
}
const sortedData = React.useMemo(() => {
const tempData = [...props.callbacks];
const tempData = [...callbacks];

if (sortData.sortType === 'number' || sortData.sortType === 'size' || sortData.sortType === 'date') {
tempData.sort((a, b) => (parseInt(a[sortData.sortKey]) > parseInt(b[sortData.sortKey]) ? 1 : -1));
Expand Down Expand Up @@ -308,7 +310,7 @@ function CallbacksTablePreMemo(props){
})];
}
}, [])
}, [props.callbacks, sortData, filterOptions, columnVisibility]);
}, [callbacks, sortData, filterOptions, columnVisibility]);

const onSubmitFilterOptions = (newFilterOptions) => {
setFilterOptions(newFilterOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import WidgetsIcon from '@mui/icons-material/Widgets';
import {ModifyCallbackMythicTreeGroupsDialog} from "./ModifyCallbackMythicTreeGroupsDialog";
import TerminalIcon from '@mui/icons-material/Terminal';
import ImportExportIcon from '@mui/icons-material/ImportExport';
import {b64DecodeUnicode} from "./ResponseDisplay";

export const CallbacksTableIDCell = React.memo(({rowData, toggleLock, updateDescription, setOpenHideMultipleDialog, setOpenTaskMultipleDialog}) =>{
const dropdownAnchorRef = React.useRef(null);
Expand Down Expand Up @@ -557,7 +556,8 @@ export const CallbacksTableC2Cell = React.memo(({rowData}) => {
onClose={()=>{setOpenC2Dialog(false);}}
innerDialog={
<C2PathDialog
onClose={()=>{setOpenC2Dialog(false);}}
onClose={()=>{setOpenC2Dialog(false);}}

callback={localRowData}
callbackgraphedges={callbackgraphedgesAll}
onOpenTab={onOpenTab}
Expand Down
16 changes: 9 additions & 7 deletions MythicReactUI/src/components/pages/Callbacks/CallbacksTop.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {CallbacksTable} from './CallbacksTable';
import {CallbacksGraph} from './CallbacksGraph';
export const CallbackGraphEdgesContext = createContext([]);
export const OnOpenTabContext = createContext( () => {});
export const CallbacksContext = createContext([]);
const SUB_Callbacks = gql`
subscription CallbacksSubscription{
callback(where: {active: {_eq: true}}, order_by: {id: desc}) {
Expand Down Expand Up @@ -159,13 +160,14 @@ export function CallbacksTop(props){
<div style={{height: "100%", width: "100%"}}>
<CallbackGraphEdgesContext.Provider value={callbackEdges}>
<OnOpenTabContext.Provider value={onOpenTabLocal}>
{props.topDisplay === "graph" ? (
<CallbacksGraph maxHeight={"100%"} key={"callbacksgraph"} />
) : (
<CallbacksTable key={"callbackstable"} onOpenTab={onOpenTabLocal}
callbacks={callbacks}
parentMountedRef={mountedRef} me={me}/>
)}
<CallbacksContext.Provider value={callbacks}>
{props.topDisplay === "graph" ? (
<CallbacksGraph maxHeight={"100%"} />
) : (
<CallbacksTable onOpenTab={onOpenTabLocal}
parentMountedRef={mountedRef} me={me}/>
)}
</CallbacksContext.Provider>
</OnOpenTabContext.Provider>
</CallbackGraphEdgesContext.Provider>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Root = styled('div')((

const getP2PProfilesAndCallbacks = gql`
query getP2PProfilesAndCallbacks{
c2profile(where: {is_p2p: {_eq: true}}) {
c2profile(where: {is_p2p: {_eq: true}, deleted: {_eq: false}}) {
callbackc2profiles(where: {callback: {active: {_eq: true}}}) {
id
callback {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const getIconName = (iconName) => {

const ResponseDisplayTableStringCell = ({cellData, rowData}) => {
return (
<div style={{...(cellData?.cellStyle || null)}}>
<div style={{...cellData?.cellStyle}}>
{cellData?.startIcon?
<MythicStyledTooltip title={cellData?.startIconHoverText || ""} >
<FontAwesomeIcon icon={getIconName(cellData?.startIcon)} style={{marginRight: "5px", color: cellData?.startIconColor || ""}}/>
Expand Down Expand Up @@ -492,19 +492,19 @@ export const ResponseDisplayMaterialReactTable = ({table, callback_id, expand})
grow: h.fillWidth,
accessorFn: (row) => {
if(h.type === "date"){
return new Date(row[h.plaintext].plaintext);
return new Date(row[h.plaintext]?.plaintext || 0);
}
if(h.type === "number" || h.type === "size"){
try{
return Number(row[h.plaintext].plaintext);
return Number(row[h.plaintext]?.plaintext || NaN);
}catch(error){
return row[h.plaintext].plaintext;
return row[h.plaintext]?.plaintext || "";
}
}
return row[h.plaintext].plaintext;
return row[h.plaintext]?.plaintext || "";
},
Cell: ({cell, renderedCellValue}) => {
let cellData = {...cell.row.original[h.plaintext], plaintext: renderedCellValue};
let cellData = {...cell.row?.original?.[h.plaintext], plaintext: renderedCellValue};
switch(h.type){
case "string":
return (
Expand Down Expand Up @@ -576,9 +576,12 @@ export const ResponseDisplayMaterialReactTable = ({table, callback_id, expand})
muiTableHeadRowProps: {
sx: {}
},
muiTableBodyCellProps: {
sx: {
padding: "0 0 0 0",
muiTableBodyCellProps: ({ cell, table }) => {
return {
sx: {
...cell.row.original[cell.column.id]?.cellStyle,
padding: "0 0 0 10px",
}
}
},
muiTableBodyRowProps: ({ row }) => ({
Expand All @@ -587,7 +590,7 @@ export const ResponseDisplayMaterialReactTable = ({table, callback_id, expand})
},
style: {padding: 0}
}),
enableRowActions: true,
enableRowActions: false,
/*
renderRowActions: ({ row }) => (
<Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -867,14 +867,15 @@ export function TaskParametersDialog(props) {
}
const onChange = (name, value, error) => {
//console.log("called props.onChange to update a value for submission, have these parameters: ", [...parameters]);
const params = parameters.map( (param) => {
if(param.name === name){
return {...param, value: value};
}else{
return {...param};
}
setParameters((previousState, currentProps) => {
return previousState.map( (param) => {
if(param.name === name){
return {...param, value: value};
}else{
return {...param};
}
})
});
setParameters(params);
//console.log("just set new params from props.onChange with a new value: ", [...params])
}
const onChangeParameterGroup = (event) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export function TaskParametersDialogRow(props){
usingDynamicParamChoices.current = true;
if(props.type === "ChooseOne"){
if(data.dynamic_query_function.choices.length > 0){
if(data.dynamic_query_function.choices.includes(props.value)){
if(data.dynamic_query_function.choices.includes(props.value) && props.value !== ""){
setValue(props.value);
props.onChange(props.name, props.value, false);
} else {
Expand Down
4 changes: 2 additions & 2 deletions MythicReactUI/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import {snackActions} from './components/utilities/Snackbar';
import jwt_decode from 'jwt-decode';
import {meState} from './cache';

export const mythicVersion = "3.2.17";
export const mythicUIVersion = "0.1.63";
export const mythicVersion = "3.2.18-rc3";
export const mythicUIVersion = "0.1.64";

let fetchingNewToken = false;

Expand Down
6 changes: 6 additions & 0 deletions Mythic_CLI/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 0.2.11 - 2024-02-09

### Changed

- When installing an agent/c2, check for the *_use_build_context and *_use_volume keys before setting them

## 0.2.10 - 2024-02-06

### Changed
Expand Down
2 changes: 1 addition & 1 deletion Mythic_CLI/src/cmd/config/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ package config

var (
// Version Mythic CLI version
Version = "v0.2.10"
Version = "v0.2.11"
)
8 changes: 6 additions & 2 deletions Mythic_CLI/src/cmd/internal/installservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ func InstallFolder(installPath string, overWrite bool) error {
latestVersion := installConfig.GetStringMapString("remote_images")
for key, val := range latestVersion {
config.SetNewConfigStrings(fmt.Sprintf("%s_remote_image", key), val)
config.SetNewConfigStrings(fmt.Sprintf("%s_use_volume", key), "true")
config.SetNewConfigStrings(fmt.Sprintf("%s_use_build_context", key), "false")
if !config.GetMythicEnv().InConfig(fmt.Sprintf("%s_use_volume", key)) {
config.SetNewConfigStrings(fmt.Sprintf("%s_use_volume", key), "true")
}
if !config.GetMythicEnv().InConfig(fmt.Sprintf("%s_use_build_context", key)) {
config.SetNewConfigStrings(fmt.Sprintf("%s_use_build_context", key), "false")
}
}
if !installConfig.GetBool("exclude_payload_type") {
// handle the payload type copying here
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.18-rc2
3.2.18-rc3
Loading

0 comments on commit cc9169d

Please sign in to comment.