From ff6fd5297997d29a052716a270d3c4f50773776f Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Mon, 14 Feb 2022 19:19:16 +0530 Subject: [PATCH] UI: Modify how process list collection PBA is shown in Security report --- .../report-components/security/PostBreachParser.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/security/PostBreachParser.js b/monkey/monkey_island/cc/ui/src/components/report-components/security/PostBreachParser.js index 4bb420f71..843ca89dd 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/security/PostBreachParser.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/security/PostBreachParser.js @@ -5,6 +5,10 @@ export default function parsePbaResults(results) { const SHELL_STARTUP_NAME = 'Modify shell startup file'; const CMD_HISTORY_NAME = 'Clear command history'; +// TODO: Remove line 10 and un-comment line 11 after the TODO in `_run_pba()` in +// `automated_master.py` is resolved. +const PROCESS_LIST_COLLECTION = 'ProcessListCollection'; +// const PROCESS_LIST_COLLECTION = 'Process list collection'; const multipleResultsPbas = [SHELL_STARTUP_NAME, CMD_HISTORY_NAME] @@ -41,10 +45,17 @@ function aggregateMultipleResultsPba(results) { } } + function modifyProcessListCollectionResult(result) { + result[0] = "Found " + Object.keys(result[0]).length.toString() + " running processes"; + } + // check for pbas with multiple results and aggregate their results - for (let i = 0; i < results.length; i++) + for (let i = 0; i < results.length; i++) { if (multipleResultsPbas.includes(results[i].name)) aggregateResults(results[i]); + if (results[i].name === PROCESS_LIST_COLLECTION) + modifyProcessListCollectionResult(results[i].result); + } // if no modifications were made to the results, i.e. if no pbas had mutiple results, return `results` as it is let noResultsModifications = true;