Skip to content

Commit

Permalink
Many UI Fixes and features added
Browse files Browse the repository at this point in the history
added UDP Associate and more UI Tab-complete options
  • Loading branch information
its-a-feature committed Oct 14, 2024
1 parent 63a6d5e commit 617d927
Show file tree
Hide file tree
Showing 82 changed files with 1,555 additions and 511 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ 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.3.1-rc16] - 2024-10-14

### Changed

- Updated file uploads to better track the same file uploads across multiple callbacks
- Updated file download message for files hosted through C2 Profiles to be more descriptive
- Added support for operation banner_text and banner_color
- Reworked C2 Profile status updates so they can be more async and C2 profiles can opt for their own restarts
- Removed unnecessary C2 Profile restarts when checking configurations and building payloads
- C2 Profile Functions can now set a field for RestartInternalServer to ask Mythic to restart it for them
- Updated payload build to go on in background instead of blocking build API call
- Updated CommandAugment commands to only autoload builtin and suggested commands to new callbacks
- Added Username/Password auth options for SOCKS ports
- Added support for UDP Associate
- Agents need to inspect first packet for new server_id to see if it's \x00\x00 (UDP) or \x05 (TCP)

## [3.3.1-rc15] - 2024-09-27

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

### Changed

- Updated the eventlog page to have options to view only unresolved/resolved warnings
- Fixed some issues with the reverse search box in tasking
- Added an option to stop hosting a file via the host file dialog box
- Fixed but when deleting a tag causing an error
- Added banner_text and banner_color options to operations that applies to every page
- Added a timer for interactive task backdrop notification
- Fixed issue with ChooseMultiple options not being populated in modal based on command line with shift+enter
- Fixed an issue in interactive tasking with empty response being treated as a task
- Added ability to tab-out choices for ChooseOne, ChooseOneCustom, ChooseMultiple, TypedArray, Array fields
- Includes ones with dynamic query functions set

## [0.2.48] - 2024-10-01

### Changed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import {useTheme} from '@mui/material/styles';
import {MythicStyledTooltip} from "./MythicStyledTooltip";

export const MythicAgentSVGIcon = ({payload_type, style}) => {
const theme = useTheme();
return (
<img src={"/static/" + payload_type + "_" + theme.palette.mode + ".svg"}
style={{...style}}/>
<MythicStyledTooltip title={payload_type}>
<img src={"/static/" + payload_type + "_" + theme.palette.mode + ".svg"}
style={{...style}}/>
</MythicStyledTooltip>

)
}
33 changes: 27 additions & 6 deletions MythicReactUI/src/components/MythicComponents/MythicTag.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,11 @@ return (
<TableRow hover>
<TableCell>Reference URL</TableCell>
<TableCell>
<Link href={selectedTag?.url || "#"} color="textPrimary" target="_blank" referrerPolicy='no'>{selectedTag?.url ? "click here" : "No reference link provided"}</Link>
{selectedTag?.url === "" ? (
"No reference link provided"
) : (
<Link href={selectedTag?.url || "#"} color="textPrimary" target="_blank" referrerPolicy='no'>{selectedTag?.url ? "click here" : "No reference link provided"}</Link>
)}
</TableCell>
</TableRow>
<TableRow>
Expand All @@ -293,16 +297,29 @@ return (
<TableRow key={key} hover>
<TableCell>{key}</TableCell>
{typeof selectedTag.data[key] === "string" ? (
<TableCell>
<StringTagDataEntry name={key} value={selectedTag.data[key]} />
<TableCell style={{whiteSpace: "pre-wrap"}}>
<StringTagDataEntry name={key} value={String(selectedTag.data[key])} />
</TableCell>
) : typeof selectedTag.data[key] === "object" ? (
<TableCell style={{whiteSpace: "pre-wrap"}}>{JSON.stringify(selectedTag.data[key], null, 2)}</TableCell>
Array.isArray(selectedTag.data[key]) ? (
<TableCell style={{whiteSpace: "pre-wrap"}}>{JSON.stringify(selectedTag.data[key], null, 2)}</TableCell>
) : (
<Table size={"small"} >
{Object.keys(selectedTag.data[key]).map(key2 => (
<TableRow key={key2} >
<TableCell>{key2}</TableCell>
<TableCell>
<StringTagDataEntry name={key2} value={String(selectedTag.data[key][key2])} />
</TableCell>
</TableRow>
))}
</Table>
)
) : typeof selectedTag.data[key] === "boolean" ? (
<TableCell>{selectedTag.data[key] ? "True" : "False"}</TableCell>
) :
(
<TableCell>{selectedTag.data[key]}</TableCell>
<TableCell>{String(selectedTag.data[key])}</TableCell>
)
}

Expand Down Expand Up @@ -379,7 +396,11 @@ export function ViewEditTagsDialog(props) {
setExistingTags(newTags);
if(newTags.length > 0){
setSelectedTag(newTags[0]);
setNewData(newTags[0].data);
try{
setNewData(JSON.stringify(newTags[0].data, null, 2));
}catch(error){
setNewData(String(newTags[0].data));
}
setNewSource(newTags[0].source);
setNewURL(newTags[0].url);
} else {
Expand Down
30 changes: 21 additions & 9 deletions MythicReactUI/src/components/TopAppBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import PlayCircleFilledTwoToneIcon from '@mui/icons-material/PlayCircleFilledTwo
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
import {TopAppBarEventingNotifications} from "./TopAppBarEventingNotifications";
import {useQuery, gql} from '@apollo/client';
import VerifiedTwoToneIcon from '@mui/icons-material/VerifiedTwoTone';


const PREFIX = 'TopAppBar';
Expand Down Expand Up @@ -215,23 +216,28 @@ export function TopAppBar(props) {
>
<MenuIcon fontSize={"large"} />
</IconButton>
<div style={{width: "100%"}}>
<div className={'hideOnSmallWidth'}>
<span style={{width: "100%"}}>
<span className={'hideOnSmallWidth'}>
<TopBarShortcuts />
{me?.user?.current_operation_id === 0 ? (
<Link style={{display: "inline-flex", alignItems: "center", paddingRight: "10px", color: "#f84d4d",
fontWeight: "bold",}} to="/new/operations">
{"CLICK HERE TO SET OPERATION!"}
</Link>
) : (
<Link style={{display: "inline-flex", alignItems: "center", paddingRight: "10px", color: "white", textDecoration: "none"}} to="/new/operations">
{me?.user?.current_operation}
</Link>
<>
<Link style={{paddingRight: "10px", color: "white", textDecoration: "none", fontSize: "1em"}} to="/new/operations">
{me?.user?.current_operation}
{me?.user?.current_operation_complete &&
<IconButton disabled>
<VerifiedTwoToneIcon style={{padding: 0, color: "white"}} />
</IconButton>
}
</Link>
</>
)}

</div>

</div>
</span>
</span>

<TopBarRightShortcuts me={me} toggleTheme={props.toggleTheme} serverName={serverName} />
</Toolbar>
Expand Down Expand Up @@ -382,6 +388,12 @@ export function TopAppBar(props) {
</List>
<Divider />
</StyledDrawer>
{me?.user?.current_operation_banner_text !== "" &&
<Typography style={{backgroundColor: me?.user?.current_operation_banner_color,
width: "100%", textAlign: "center", fontWeight: "600", color: "white", borderRadius: "4px", border: "1px solid grey"}} >
{me?.user?.current_operation_banner_text}
</Typography>
}
</>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,10 @@ function CallbacksTablePreMemo(props){
{openMetaDialog &&
<MythicDialog fullWidth={true} maxWidth="lg" open={openMetaDialog}
onClose={()=>{setOpenMetaDialog(false);}}
innerDialog={<DetailedCallbackTable onClose={()=>{setOpenMetaDialog(false);}} callback_id={openMetaDialogRef.current} />}
innerDialog={
<DetailedCallbackTable onClose={()=>{setOpenMetaDialog(false);}}
callback_id={openMetaDialogRef.current} />
}
/>
}
{openEditMythicTreeGroupsDialog &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ export function CallbacksTabsTaskMultipleDialog({onClose, callback}) {
<Grid item xs={12} >
<CallbacksTabsTaskingInput filterTasks={false} onSubmitFilter={()=>{}} onSubmitCommandLine={onSubmitCommandLine}
changeSelectedToken={changeSelectedToken}
payloadtype_name={callback.payload.payloadtype.name}
filterOptions={{}} callback_id={callback.id} callback_os={callback.payload.os} parentMountedRef={mountedRef} />
</Grid>
{openTaskingButton &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ query getBatchTasking($callback_id: Int!, $offset: Int!, $fetchLimit: Int!){
}
`;
export const CallbacksTabsTaskingPanel = ({tabInfo, index, value, onCloseTab, parentMountedRef, me}) =>{
const [taskLimit, setTaskLimit] = React.useState(10);
const [taskLimit, setTaskLimit] = React.useState(20);
const [scrollToBottom, setScrollToBottom] = React.useState(false);
const [openParametersDialog, setOpenParametersDialog] = React.useState(false);
const [commandInfo, setCommandInfo] = React.useState({});
Expand Down Expand Up @@ -370,6 +370,7 @@ export const CallbacksTabsTaskingPanel = ({tabInfo, index, value, onCloseTab, pa
setSelectedToken(token);
}
}

return (
<MythicTabPanel index={index} value={value} >
{!fetched && <LinearProgress color="primary" thickness={2} style={{paddingTop: "5px"}}/>}
Expand All @@ -393,8 +394,14 @@ export const CallbacksTabsTaskingPanel = ({tabInfo, index, value, onCloseTab, pa
<div ref={messagesEndRef}/>
</div>

<CallbacksTabsTaskingInput filterTasks={true} me={me} onSubmitFilter={onSubmitFilter} onSubmitCommandLine={onSubmitCommandLine} changeSelectedToken={changeSelectedToken}
filterOptions={filterOptions} callback_id={tabInfo.callbackID} callback_os={tabInfo.os} parentMountedRef={mountedRef} />
<CallbacksTabsTaskingInput filterTasks={true} me={me}
onSubmitFilter={onSubmitFilter}
onSubmitCommandLine={onSubmitCommandLine}
changeSelectedToken={changeSelectedToken}
filterOptions={filterOptions}
callback_id={tabInfo.callbackID}
payloadtype_name={tabInfo.payloadtype}
callback_os={tabInfo.os} parentMountedRef={mountedRef} />
{openParametersDialog &&
<MythicDialog fullWidth={true} maxWidth="lg" open={openParametersDialog}
onClose={()=>{setOpenParametersDialog(false);}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function CallbacksTabsTaskingConsoleLabel(props){
}

// this is to listen for the latest tasking
const fetchLimit = 10;
const fetchLimit = 20;
const getTaskingQuery = gql`
${taskingDataFragment}
subscription getTasking($callback_id: Int!, $fromNow: timestamp!, $limit: Int){
Expand Down Expand Up @@ -397,7 +397,9 @@ export const CallbacksTabsTaskingConsolePanel = ({tabInfo, index, value, onClose
</div>

<CallbacksTabsTaskingInput filterTasks={true} me={me} onSubmitFilter={onSubmitFilter} onSubmitCommandLine={onSubmitCommandLine} changeSelectedToken={changeSelectedToken}
filterOptions={filterOptions} callback_id={tabInfo.callbackID} callback_os={tabInfo.os} parentMountedRef={mountedRef} />
filterOptions={filterOptions} callback_id={tabInfo.callbackID}
payloadtype_name={tabInfo.payloadtype}
callback_os={tabInfo.os} parentMountedRef={mountedRef} />
{openParametersDialog &&
<MythicDialog fullWidth={true} maxWidth="lg" open={openParametersDialog}
onClose={()=>{setOpenParametersDialog(false);}}
Expand Down
Loading

0 comments on commit 617d927

Please sign in to comment.