Skip to content

Commit

Permalink
small ui tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
its-a-feature committed Aug 5, 2024
1 parent e320289 commit 9aee9a3
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 108 deletions.
6 changes: 6 additions & 0 deletions 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](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.3.0-rc13] - 2024-08-05

### Changed

- Added option for `id` return value from create_task eventing

## [3.3.0-rc12] - 2024-08-02

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

### Changed

- Updated the 'download' option in file previews to not be a long button
- Updated indicator for eventing to be with the taskID instead of username

## [0.2.12] - 2024-08-02

### Changed
Expand Down
4 changes: 2 additions & 2 deletions MythicReactUI/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function App(props) {
mode: themeMode,
background: {
contrast: themeMode === 'dark' ? '#e1e0e0' : 'rgb(44, 52, 60)',
default: themeMode === "dark" ? 'rgb(48, 48, 48)' : '#f5f5f5',
default: themeMode === "dark" ? 'rgb(48, 48, 48)' : '#f6f6f6',
paper: themeMode === "dark" ? 'rgb(37,36,36)' : '#ececec',
taskLabel: themeMode === "dark" ? 'rgb(20, 20, 20)' : '#f5f5f5',
},
Expand All @@ -100,7 +100,7 @@ export function App(props) {
},
pageHeaderTextColor: "#ffffff",
folderColor: '#f1d592',
tableHeader: themeMode === 'dark' ? '#484848' : '#e0e0e0',
tableHeader: themeMode === 'dark' ? '#484848' : '#c4c4c4',
successOnMain: '#1ae302',
errorOnMain: '#ff656b',
infoOnMain: '#67ceff',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import Tab from '@mui/material/Tab';
import {previewFileQuery} from "../Search/FileMetaTable";
import { useMutation } from '@apollo/client';
import CodeIcon from '@mui/icons-material/Code';
import DownloadIcon from '@mui/icons-material/Download';

export const ResponseDisplayMedia = ({media, expand, task}) =>{
const displayType = mimeType(media?.filename);
Expand All @@ -52,9 +53,7 @@ export const ResponseDisplayMedia = ({media, expand, task}) =>{
return (
<div style={{display: "flex", height: "100%", flexDirection: "column"}}>
<AppBar color={'default'} position='static' className={"no-box-shadow"}>
<Button style={{width: "100%"}}
size={"small"} variant={"contained"} href={"/direct/download/" + media.agent_file_id}
download >Download</Button>

<Tabs
value={value}
onChange={handleChange}
Expand All @@ -72,6 +71,12 @@ export const ResponseDisplayMedia = ({media, expand, task}) =>{
<Tab className={value === 0 ? "selectedCallback": ""} label={"Render Media"}></Tab>
<Tab className={value === 1 ? "selectedCallback": ""} label={"Preview Strings"}></Tab>
<Tab className={value === 2 ? "selectedCallback": ""} label={"Preview Hex"}></Tab>
<MythicStyledTooltip title={"Download the file"} style={{display: "inline-flex"}}>
<Button style={{}} size={"small"} href={"/direct/download/" + media.agent_file_id}
download color={"success"}>
<DownloadIcon />
</Button>
</MythicStyledTooltip>
</Tabs>
</AppBar>
<div hidden={value !== 0} style={{height: "100%"}} role='tabpanel' >
Expand Down
49 changes: 26 additions & 23 deletions MythicReactUI/src/components/pages/Callbacks/TaskDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,22 +225,6 @@ const GetOperatorDisplay = ({initialHideUsernameValue, task}) => {
if(initialHideUsernameValue){
return '';
}
if(task?.eventstepinstance !== null){
return (
<span style={{display: "inline-flex", alignItems: "center"}}>
{"/ "}
<IconButton component={Link} href={'/new/eventing?eventgroup=' +
task?.eventstepinstance?.eventgroupinstance?.eventgroup?.id +
"&eventgroupinstance=" + task?.eventstepinstance?.eventgroupinstance?.id
} target={"_blank"} style={{padding: 0}}
color="inherit" disableFocusRipple={true}
disableRipple={true}>
<PlayCircleFilledTwoToneIcon />
</IconButton>
{task.operator.username}
</span>
)
}
return "/ " + task.operator.username;
}
const ColoredTaskLabel = ({task, theme, me, taskDivID, onClick, displayChildren, toggleDisplayChildren, expanded }) => {
Expand Down Expand Up @@ -279,16 +263,35 @@ const ColoredTaskLabel = ({task, theme, me, taskDivID, onClick, displayChildren,
<Typography className={classes.taskAndTimeDisplay} onClick={preventPropagation}>
[{toLocalTime(task.timestamp, me?.user?.view_utc_time || false)}]
{" / "}
<span style={{display: "inline-flex", alignItems: "center"}}>
<span style={{}}>
{task.has_intercepted_response &&
<MythicStyledTooltip
title={"This task has responses that have been intercepted and changed due to a workflow container"}>
<IconButton style={{padding: 0}} color={"secondary"}>
<CropRotateTwoToneIcon fontSize={"small"}/>
</IconButton>
<>
<MythicStyledTooltip
title={"This task has responses that have been intercepted and changed due to a workflow container"}>
<IconButton style={{padding: 0}} color={"secondary"}>
<CropRotateTwoToneIcon fontSize={"small"}/>
</IconButton>

</MythicStyledTooltip>
</MythicStyledTooltip>
{"/ "}
</>
}
{task?.eventstepinstance !== null &&
<>
<MythicStyledTooltip title={"Task created via Eventing, click to view entire event flow in separate page"} >
<IconButton component={Link} href={'/new/eventing?eventgroup=' +
task?.eventstepinstance?.eventgroupinstance?.eventgroup?.id +
"&eventgroupinstance=" + task?.eventstepinstance?.eventgroupinstance?.id
} target={"_blank"} style={{padding: 0}}
color="inherit" disableFocusRipple={true}
disableRipple={true}>
<PlayCircleFilledTwoToneIcon />
</IconButton>
</MythicStyledTooltip>

{"/ "}
</>
}
<MythicStyledTooltip title={"View Task in separate page"} >
<Link style={{wordBreak: "break-all"}} color={"textPrimary"} underline={"always"} target={"_blank"}
href={"/new/task/" + task.display_id}>{task.display_id}</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ export function EventFileManageDialog({onClose, selectedEventGroup}) {

function EventFileManageDialogTableRow({eventFile}) {
const [openDelete, setOpenDelete] = React.useState(false);
const [openPreviewStringsDialog, setOpenPreviewStringsDialog] = React.useState(false);
const [openPreviewHexDialog, setOpenPreviewHexDialog] = React.useState(false);
const [openPreviewMediaDialog, setOpenPreviewMediaDialog] = React.useState(false);
const [deleteFile] = useMutation(updateFileDeleted, {
onCompleted: (data) => {
Expand All @@ -89,52 +87,9 @@ function EventFileManageDialogTableRow({eventFile}) {
snackActions.error("Failed to delete file");
}
});
const [previewFileString] = useMutation(previewFileQuery, {
onCompleted: (data) => {
if(data.previewFile.status === "success"){
setFileContents(data.previewFile.contents);
setOpenPreviewStringsDialog(true);
}else{
snackActions.error(data.previewFile.error)
}
},
onError: (data) => {
console.log(data);
snackActions.error(data);
}
});
const [previewFileHex] = useMutation(previewFileQuery, {
onCompleted: (data) => {
if(data.previewFile.status === "success"){
setFileContents(data.previewFile.contents);
setOpenPreviewHexDialog(true);
}else{
snackActions.error(data.previewFile.error)
}
},
onError: (data) => {
console.log(data);
snackActions.error(data);
}
});
const onAcceptDelete = () => {
deleteFile({variables: {file_id: eventFile.id}})
}
const [fileContents, setFileContents] = React.useState('');
const onPreviewStrings = (event) => {
if(event){
event.preventDefault();
event.stopPropagation();
}
previewFileString({variables: {file_id: eventFile.agent_file_id}})
}
const onPreviewHex = (event) => {
if(event){
event.preventDefault();
event.stopPropagation();
}
previewFileHex({variables: {file_id: eventFile.agent_file_id}})
}
const onPreviewMedia = (event) => {
if(event){
event.preventDefault();
Expand All @@ -152,14 +107,6 @@ function EventFileManageDialogTableRow({eventFile}) {
}
<DeleteIcon color={"error"} fontSize={"large"} style={{height: "35px", cursor: "pointer"}}
onClick={()=>{setOpenDelete(true);}}/>
<MythicStyledTooltip title={"Preview HEX XXD"}>
<img src={hexFile} alt={"preview hex"} style={{height: "35px", cursor: "pointer"}}
onClick={onPreviewHex}/>
</MythicStyledTooltip>
<MythicStyledTooltip title={"Preview Strings"}>
<img src={txtFile} alt={"preview strings"} style={{height: "35px", cursor: "pointer"}}
onClick={onPreviewStrings} />
</MythicStyledTooltip>
<MythicStyledTooltip title={"Preview Media"}>
<FontAwesomeIcon icon={faPhotoVideo} style={{height: "25px", bottom: "5px", position: "relative", cursor: "pointer", display: "inline-block"}}
onClick={onPreviewMedia} />
Expand All @@ -173,22 +120,6 @@ function EventFileManageDialogTableRow({eventFile}) {
onClose={(e)=>{setOpenPreviewMediaDialog(false);}} />}
/>
}
{openPreviewStringsDialog &&
<MythicDialog fullWidth={true} maxWidth="xl" open={openPreviewStringsDialog}
onClose={()=>{setOpenPreviewStringsDialog(false);}}
innerDialog={<PreviewFileStringDialog onClose={()=>{setOpenPreviewStringsDialog(false);}}
filename={b64DecodeUnicode(eventFile.filename_text)} contents={fileContents}
/>}
/>
}
{openPreviewHexDialog &&
<MythicDialog fullWidth={true} maxWidth="xl" open={openPreviewHexDialog}
onClose={()=>{setOpenPreviewHexDialog(false);}}
innerDialog={<PreviewFileHexDialog onClose={()=>{setOpenPreviewHexDialog(false);}}
filename={b64DecodeUnicode(eventFile.filename_text)} contents={fileContents}
/>}
/>
}
</>
)}
</MythicStyledTableCell>
Expand Down
2 changes: 1 addition & 1 deletion MythicReactUI/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {snackActions} from './components/utilities/Snackbar';
import jwt_decode from 'jwt-decode';
import {meState} from './cache';

export const mythicUIVersion = "0.2.12";
export const mythicUIVersion = "0.2.13";

let fetchingNewToken = false;

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.0-rc12
3.3.0-rc13
2 changes: 1 addition & 1 deletion mythic-docker/src/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.0-rc12
3.3.0-rc13
2 changes: 2 additions & 0 deletions mythic-docker/src/rabbitmq/eventing.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,8 @@ func getStepInstanceOutputs(eventNotification EventNotification, eventStepInstan
logging.LogInfo("looping through outputs of stepinstance", "key", key, "value", val)
valString := val.(string)
switch valString {
case "id":
output[key] = task.ID
case "status":
output[key] = task.Status
case "params":
Expand Down
6 changes: 3 additions & 3 deletions mythic-react-docker/mythic/public/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"files": {
"main.css": "/new/static/css/main.7e143bf2.css",
"main.js": "/new/static/js/main.e6eb2feb.js",
"main.js": "/new/static/js/main.cd3429e8.js",
"static/media/mythic-red.png": "/new/static/media/mythic-red.203468a4e5240d239aa0.png",
"static/media/mythic_red_small.svg": "/new/static/media/mythic_red_small.793b41cc7135cdede246661ec232976b.svg",
"index.html": "/new/index.html",
"main.7e143bf2.css.map": "/new/static/css/main.7e143bf2.css.map",
"main.e6eb2feb.js.map": "/new/static/js/main.e6eb2feb.js.map"
"main.cd3429e8.js.map": "/new/static/js/main.cd3429e8.js.map"
},
"entrypoints": [
"static/css/main.7e143bf2.css",
"static/js/main.e6eb2feb.js"
"static/js/main.cd3429e8.js"
]
}
2 changes: 1 addition & 1 deletion mythic-react-docker/mythic/public/index.html
Original file line number Diff line number Diff line change
@@ -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.e6eb2feb.js"></script><link href="/new/static/css/main.7e143bf2.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.cd3429e8.js"></script><link href="/new/static/css/main.7e143bf2.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 9aee9a3

Please sign in to comment.