cc: Modify T1086 reporting to segregate per category more efficiently

This commit is contained in:
Shreya Malviya 2021-10-11 17:59:54 +05:30
parent 748bca43e9
commit ee5585af75
1 changed files with 16 additions and 7 deletions

View File

@ -52,21 +52,30 @@ class T1086 extends React.Component {
}]) }])
} }
getPowershellDataPerCategory(category) { segregatePowershellDataPerCategory() {
let data = []; 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) { for (let rowIdx in this.props.data.cmds) {
let row = this.props.data.cmds[rowIdx]; let row = this.props.data.cmds[rowIdx];
if (row.telem_category == category) { if (row.telem_category == exploit_category_name) {
data.push(row); 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() { render() {
let data_from_exploits = this.getPowershellDataPerCategory('exploit'); let segregatedData = this.segregatePowershellDataPerCategory();
let data_from_pbas = this.getPowershellDataPerCategory('post_breach'); let data_from_exploits = segregatedData[0];
let data_from_pbas = segregatedData[1];
return ( return (
<div> <div>