Skip to content

Commit

Permalink
more UI updates
Browse files Browse the repository at this point in the history
  • Loading branch information
its-a-feature committed Aug 20, 2024
1 parent 5ad5baa commit 1072fcf
Showing 13 changed files with 57 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -164,3 +164,5 @@ _ReSharper*/
.vscode/

jupyter-docker/jupyter/MythicExamples/.ipynb_checkpoints/

nginx-docker/config/blockips.conf
8 changes: 8 additions & 0 deletions MythicReactUI/CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -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.2.28] - 2024-08-19

### Changed

- Fixed a bug in file browser where file display wouldn't disappear
- Updated interactive display to not show prompt when not main tasking
- Updated context menu for tables to be at the location of the cursor

## [0.2.27] - 2024-08-19

### Changed
Original file line number Diff line number Diff line change
@@ -11,8 +11,11 @@ const CellPreMemo = ({ VariableSizeGridProps: { style, rowIndex, columnIndex, da
const item = data.items[rowIndex][columnIndex];
const cellStyle = item?.props?.cellData?.cellStyle || {};
const rowStyle = data.items[rowIndex][columnIndex]?.props?.rowData?.rowStyle || {};
const contextMenuLocationRef = React.useRef({x: 0, y: 0});
const handleDoubleClick = useCallback(
(e) => {
e.preventDefault();
e.stopPropagation();
data.onDoubleClickRow(e, rowIndex - 1, data.items[rowIndex][columnIndex]?.props?.rowData); // minus 1 to account for header row
},
[data, rowIndex]
@@ -54,6 +57,8 @@ const CellPreMemo = ({ VariableSizeGridProps: { style, rowIndex, columnIndex, da
if(item.disableFilterMenu){
return;
}
contextMenuLocationRef.current.x = event.clientX;
contextMenuLocationRef.current.y = event.clientY;
if(data.onRowContextMenuClick){
const newMenuItems = data.onRowContextMenuClick({rowDataStatic: data.items[rowIndex][columnIndex]?.props?.rowData});
if(newMenuItems.length > 0){
@@ -83,12 +88,13 @@ const CellPreMemo = ({ VariableSizeGridProps: { style, rowIndex, columnIndex, da
</div>
<ContextMenu dropdownAnchorRef={dropdownAnchorRef} contextMenuOptions={contextMenuOptions}
disableFilterMenu={item.disableFilterMenu} openContextMenu={openContextMenu}
contextMenuLocationRef={contextMenuLocationRef}
setOpenContextMenu={setOpenContextMenu} handleMenuItemClick={handleMenuItemClick}
/>
</div>
);
};
const ContextMenu = ({openContextMenu, dropdownAnchorRef, contextMenuOptions, setOpenContextMenu, handleMenuItemClick}) => {
const ContextMenu = ({openContextMenu, dropdownAnchorRef, contextMenuOptions, setOpenContextMenu, handleMenuItemClick, contextMenuLocationRef}) => {
const handleClose = (event) => {
//if (dropdownAnchorRef.current && dropdownAnchorRef.current.contains(event.target)) {
// return;
@@ -103,6 +109,9 @@ const ContextMenu = ({openContextMenu, dropdownAnchorRef, contextMenuOptions, se
isOpen={dropdownAnchorRef.current}
onOpen={setOpenContextMenu}
externallyOpen={openContextMenu}
absoluteX={contextMenuLocationRef.current.x}
absoluteY={contextMenuLocationRef.current.y}
anchorReference={"anchorPosition"}
menu={[
contextMenuOptions.map((option, index) => (
option.type === 'item' ? (
Original file line number Diff line number Diff line change
@@ -135,6 +135,7 @@ export const taskingDataFragment = gql`
opsec_pre_bypassed
opsec_post_blocked
opsec_post_bypassed
is_interactive_task
interactive_task_type
has_intercepted_response
tasks(where: {is_interactive_task: {_eq: false}}, order_by: {id: asc}) {
Original file line number Diff line number Diff line change
@@ -315,6 +315,10 @@ export const CallbacksTabsFileBrowserPanel = ({ index, value, tabInfo, me }) =>
})
existingData.filemeta = [...existingData.filemeta, ...newfileData]
treeRootDataRef.current[currentGroups[j]][data.data.mythictree_stream[i]["host"]][data.data.mythictree_stream[i]["full_path_text"]] = {...existingData};
if(selectedFolderData.group === currentGroups[j] && selectedFolderData.host === data.data.mythictree_stream[i]["host"] &&
selectedFolderData.full_path_text === data.data.mythictree_stream[i]["full_path_text"]){
setSelectedFolderData({...existingData, group: currentGroups[j]});
}
}
}
}
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@ import {MythicStyledTooltip} from '../../MythicComponents/MythicStyledTooltip';
import Pagination from '@mui/material/Pagination';
import {ResponseDisplayInteractive} from "./ResponseDisplayInteractive";
import {ResponseDisplayMedia} from "./ResponseDisplayMedia";
import {ResponseDisplayMaterialReactTable} from "./ResponseDisplayMaterialReactTable";
import {useMythicSetting} from "../../MythicComponents/MythicSavedUserSetting";
import {DrawBrowserScriptElementsFlow} from "./C2PathDialog";
import {ResponseDisplayGraph} from "./ResponseDisplayGraph";
Original file line number Diff line number Diff line change
@@ -168,6 +168,7 @@ const EnterOptions = [
];
export const ResponseDisplayInteractive = (props) =>{
const me = useReactiveVar(meState);
const [scrollToBottom, setScrollToBottom] = React.useState(false);
const pageSize = React.useRef(100);
const highestFetched = React.useRef(0);
const [taskData, setTaskData] = React.useState([]);
@@ -319,6 +320,14 @@ export const ResponseDisplayInteractive = (props) =>{
const toggleWrapText = () => {
setWrapText(!wrapText);
}
useEffect( () => {
if(scrollToBottom){
messagesEndRef.current.scrollIntoView();
}
}, [scrollToBottom]);
React.useLayoutEffect(() => {
if(!scrollToBottom && alloutput.length > 0){setScrollToBottom(true)}
}, [alloutput]);
return (

<div style={{
@@ -343,22 +352,27 @@ export const ResponseDisplayInteractive = (props) =>{
))}
<div ref={messagesEndRef}/>
</div>
<div style={{width: "100%", display: "inline-flex", alignItems: "flex-end"}}>
<InteractiveTaskingBar task={props.task} taskData={taskData}
useASNIColor={useASNIColor} toggleANSIColor={toggleANSIColor}
showTaskStatus={showTaskStatus} toggleShowTaskStatus={toggleShowTaskStatus}
wrapText={wrapText} toggleWrapText={toggleWrapText}
/>
</div>
{!props.task?.is_interactive_task &&
<div style={{width: "100%", display: "inline-flex", alignItems: "flex-end"}}>
<InteractiveTaskingBar task={props.task} taskData={taskData}
useASNIColor={useASNIColor} toggleANSIColor={toggleANSIColor}
showTaskStatus={showTaskStatus} toggleShowTaskStatus={toggleShowTaskStatus}
wrapText={wrapText} toggleWrapText={toggleWrapText}
/>
</div>
}

<InteractivePaginationBar totalCount={totalCount} currentPage={page.current}
onSubmitPageChange={onSubmitPageChange} expand={props.expand}
pageSize={pageSize.current}/>
</div>
)

}
const InteractiveTaskingBar = ({task, taskData, useASNIColor, toggleANSIColor,
showTaskStatus, toggleShowTaskStatus, wrapText, toggleWrapText}) => {
const InteractiveTaskingBar = ({
task, taskData, useASNIColor, toggleANSIColor,
showTaskStatus, toggleShowTaskStatus, wrapText, toggleWrapText
}) => {
const [inputText, setInputText] = React.useState("");
const theme = useTheme();
const [createTask] = useMutation(createTaskingMutation, {
2 changes: 1 addition & 1 deletion MythicReactUI/src/index.js
Original file line number Diff line number Diff line change
@@ -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.27";
export const mythicUIVersion = "0.2.28";

let fetchingNewToken = false;

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.ec7d1bfb.js",
"main.js": "/new/static/js/main.99589259.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.ec7d1bfb.js.map": "/new/static/js/main.ec7d1bfb.js.map"
"main.99589259.js.map": "/new/static/js/main.99589259.js.map"
},
"entrypoints": [
"static/css/main.7e143bf2.css",
"static/js/main.ec7d1bfb.js"
"static/js/main.99589259.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.ec7d1bfb.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.99589259.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 1072fcf

Please sign in to comment.