From ee5585af755fbc3eab915ea6dcc5fc0668aeff9a Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Mon, 11 Oct 2021 17:59:54 +0530 Subject: [PATCH] cc: Modify T1086 reporting to segregate per category more efficiently --- .../src/components/attack/techniques/T1086.js | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/attack/techniques/T1086.js b/monkey/monkey_island/cc/ui/src/components/attack/techniques/T1086.js index 2cc8b0790..960fa25ea 100644 --- a/monkey/monkey_island/cc/ui/src/components/attack/techniques/T1086.js +++ b/monkey/monkey_island/cc/ui/src/components/attack/techniques/T1086.js @@ -52,21 +52,30 @@ class T1086 extends React.Component { }]) } - getPowershellDataPerCategory(category) { - let data = []; + segregatePowershellDataPerCategory() { + let exploit_category_name = 'exploit'; + let pba_category_name = 'post_breach'; + + let data_from_exploits = []; + let data_from_pbas = []; + for (let rowIdx in this.props.data.cmds) { let row = this.props.data.cmds[rowIdx]; - if (row.telem_category == category) { - data.push(row); + if (row.telem_category == exploit_category_name) { + data_from_exploits.push(row); + } + else if (row.telem_category == pba_category_name) { + data_from_pbas.push(row); } } - return data + return [data_from_exploits, data_from_pbas] } render() { - let data_from_exploits = this.getPowershellDataPerCategory('exploit'); - let data_from_pbas = this.getPowershellDataPerCategory('post_breach'); + let segregatedData = this.segregatePowershellDataPerCategory(); + let data_from_exploits = segregatedData[0]; + let data_from_pbas = segregatedData[1]; return (