Skip to content

Commit

Permalink
v3.2.20-rc1
Browse files Browse the repository at this point in the history
fixed issue with stat tracking for new socks/rpfwd ports
  • Loading branch information
its-a-feature committed Mar 8, 2024
1 parent 5b67741 commit 23e5c2f
Show file tree
Hide file tree
Showing 15 changed files with 147 additions and 142 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.2.20-rc1] - 2024-03-08

### Changed

- Fixed an issue where port usage wasn't getting tracked for new ports

## [3.2.19] - 2024-03-05

### Changed
Expand Down
6 changes: 6 additions & 0 deletions MythicReactUI/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).

## [0.1.80] - 2024-03-08

### Changed

- Updated callback select to be sorted descending

## [0.1.79] - 2024-03-06

### Changed
Expand Down
50 changes: 25 additions & 25 deletions MythicReactUI/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

141 changes: 71 additions & 70 deletions MythicReactUI/src/components/pages/Callbacks/CallbacksTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,32 @@ function CallbacksTablePreMemo(props){
)
}
export const CallbacksTable = React.memo(CallbacksTablePreMemo);
const accessorFn = (row, h) => {
if(h.type === "date"){
return new Date(row[h.key] || 0);
}
if(h.type === "number" || h.type === "size"){
try{
return Number(row[h.key] || NaN);
}catch(error){
return row[h.key] || 0;
}
}
if(h.name === "Groups"){
return row.mythictree_groups.join(", ");
}
if(h.name === "IP"){
try{
return JSON.parse(row[h.key])[0];
}catch(error){
return row[h.key];
}
}
if(h.name === "Agent"){
return row.payload.payloadtype.name;
}
return row[h.key] || "";
};
function CallbacksTableMaterialReactTablePreMemo(props){
const callbacks = useContext(CallbacksContext);
const theme = useTheme();
Expand Down Expand Up @@ -487,7 +513,49 @@ function CallbacksTableMaterialReactTablePreMemo(props){
}
localStorage.setItem("callbacks_table_columns", JSON.stringify(shown));
}, [columnVisibility]);

const localCellRender = React.useCallback( ({cell, h}) => {
let row = cell.row?.original;
switch(h.name){
case "Interact":
return <CallbacksTableIDCell
rowData={row}
//onOpenTab={props.onOpenTab}
updateDescription={updateDescriptionSubmit}
setOpenHideMultipleDialog={setOpenHideMultipleDialog}
setOpenTaskMultipleDialog={setOpenTaskMultipleDialog}
/>;
case "Groups":
return <CallbacksTableStringCell cellData={row.mythictree_groups.join(", ")} />;
case "IP":
return <CallbacksTableIPCell cellData={row.ip} rowData={row} callback_id={row.id} />;
case "External IP":
return <CallbacksTableStringCell cellData={row.external_ip} rowData={row} />;
case "Host":
return <CallbacksTableStringCell cellData={row.host} rowData={row} />;
case "User":
return <CallbacksTableStringCell cellData={row.user} rowData={row} />;
case "Domain":
return <CallbacksTableStringCell cellData={row.domain} rowData={row} />;
case "OS":
return <CallbacksTableOSCell rowData={row} cellData={row.os} />;
case "Arch":
return <CallbacksTableStringCell rowData={row} cellData={row.architecture} />;
case "PID":
return <CallbacksTableStringCell cellData={row.pid} rowData={row} />;
case "Last Checkin":
return <CallbacksTableLastCheckinCell rowData={row} cellData={row.last_checkin} />;
case "Description":
return <CallbacksTableStringCell cellData={row.description} rowData={row} />;
case "Sleep":
return <CallbacksTableSleepCell rowData={row} cellData={row.sleep_info} updateSleepInfo={updateSleepInfo} />;
case "Agent":
return <CallbacksTablePayloadTypeCell rowData={row} cellData={row.payload.payloadtype.name}/>;
case "C2":
return <CallbacksTableC2Cell rowData={row} />
case "Process Name":
return <CallbacksTableStringCell cellData={row.process_name} rowData={row} />;
}
}, []);
const columns = React.useMemo( () => columnFields.map( h => {
return {
accessorKey: h.key,
Expand All @@ -501,75 +569,8 @@ function CallbacksTableMaterialReactTablePreMemo(props){
enableSorting: !h.disableSort,
enableColumnFilter: true,
grow: h.fillWidth,
accessorFn: (row) => {
if(h.type === "date"){
return new Date(row[h.key] || 0);
}
if(h.type === "number" || h.type === "size"){
try{
return Number(row[h.key] || NaN);
}catch(error){
return row[h.key] || 0;
}
}
if(h.name === "Groups"){
return row.mythictree_groups.join(", ");
}
if(h.name === "IP"){
try{
return JSON.parse(row[h.key])[0];
}catch(error){
return row[h.key];
}
}
if(h.name === "Agent"){
return row.payload.payloadtype.name;
}
return row[h.key] || "";
},
Cell: ({cell, renderedCellValue}) => {
let row = cell.row?.original;
switch(h.name){
case "Interact":
return <CallbacksTableIDCell
rowData={row}
//onOpenTab={props.onOpenTab}
updateDescription={updateDescriptionSubmit}
setOpenHideMultipleDialog={setOpenHideMultipleDialog}
setOpenTaskMultipleDialog={setOpenTaskMultipleDialog}
/>;
case "Groups":
return <CallbacksTableStringCell cellData={row.mythictree_groups.join(", ")} />;
case "IP":
return <CallbacksTableIPCell cellData={row.ip} rowData={row} callback_id={row.id} />;
case "External IP":
return <CallbacksTableStringCell cellData={row.external_ip} rowData={row} />;
case "Host":
return <CallbacksTableStringCell cellData={row.host} rowData={row} />;
case "User":
return <CallbacksTableStringCell cellData={row.user} rowData={row} />;
case "Domain":
return <CallbacksTableStringCell cellData={row.domain} rowData={row} />;
case "OS":
return <CallbacksTableOSCell rowData={row} cellData={row.os} />;
case "Arch":
return <CallbacksTableStringCell rowData={row} cellData={row.architecture} />;
case "PID":
return <CallbacksTableStringCell cellData={row.pid} rowData={row} />;
case "Last Checkin":
return <CallbacksTableLastCheckinCell rowData={row} cellData={row.last_checkin} />;
case "Description":
return <CallbacksTableStringCell cellData={row.description} rowData={row} />;
case "Sleep":
return <CallbacksTableSleepCell rowData={row} cellData={row.sleep_info} updateSleepInfo={updateSleepInfo} />;
case "Agent":
return <CallbacksTablePayloadTypeCell rowData={row} cellData={row.payload.payloadtype.name}/>;
case "C2":
return <CallbacksTableC2Cell rowData={row} />
case "Process Name":
return <CallbacksTableStringCell cellData={row.process_name} rowData={row} />;
}
}
accessorFn: (row) => accessorFn(row, h),
Cell: ({cell}) => localCellRender({cell, h})
}
}), [columnFields])
const materialReactTable = useMaterialReactTable({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,11 @@ export const CallbacksTableLastCheckinCell = React.memo( ({rowData, cellData}) =
return newTime;
}
if(rowData?.payload?.payloadtype?.agent_type !== "agent"){
return "Streaming Now..."
return ""
}
return (
<div>
<Moment filter={adjustOutput} interval={500} parse={"YYYY-MM-DDTHH:mm:ss.SSSSSSZ"}
<Moment filter={adjustOutput} interval={1000} parse={"YYYY-MM-DDTHH:mm:ss.SSSSSSZ"}
withTitle
titleFormat={"YYYY-MM-DD HH:mm:ss"}
fromNow ago
Expand All @@ -383,7 +383,7 @@ export const CallbacksTableLastCheckinCell = React.memo( ({rowData, cellData}) =
</div>

)
});
}, areEqual);
export const CallbacksTablePayloadTypeCell = React.memo( ({rowData}) => {
return (
<MythicStyledTooltip title={rowData?.payload?.payloadtype?.name}>
Expand Down Expand Up @@ -630,7 +630,7 @@ export const CallbacksTableOSCell = React.memo( ({rowData, cellData}) => {


)
});
}, areEqual);
export const CallbacksTableSleepCell = React.memo( ({rowData, cellData, updateSleepInfo}) => {
const theme = useTheme();
const [openSleepDialog, setOpenSleepDialog] = React.useState(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export const TaskFromUIButton = ({callback_id, callback_ids, cmd, ui_feature, pa
onTasked({tasked: false});
return;
}
callbackOpts.sort( (a, b) => a.id < b.id ? 1 : -1);
setCallbackOptions(callbackOpts);
setOpenSelectCallback(true);
}
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.19";
export const mythicUIVersion = "0.1.79";
export const mythicVersion = "3.2.20-rc1";
export const mythicUIVersion = "0.1.80";

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.2.19
3.2.20-rc1
Loading

0 comments on commit 23e5c2f

Please sign in to comment.