Skip to content

Commit

Permalink
CR improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
VakarisZ committed Jun 19, 2019
1 parent 9935f15 commit 2bd744c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion monkey/infection_monkey/exploit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def add_vuln_url(self, url):
def add_vuln_port(self, port):
self._exploit_info['vulnerable_ports'].append(port)

def add_example_cmd(self, cmd):
def set_example_cmd(self, cmd):
self._exploit_info['executed_cmds']['example'] = cmd


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ class T1003(AttackTechnique):

tech_id = "T1003"
unscanned_msg = "Monkey tried to obtain credentials from systems in the network but didn't find any or failed."
scanned_msg = "Monkey tried to obtain credentials from systems in the network but didn't find any or failed."
scanned_msg = ""
used_msg = "Monkey successfully obtained some credentials from systems on the network."

query = {'telem_type': 'system_info_collection', '$and': [{'data.credentials': {'$exists': True}},
{'data.credentials': {'$gt': {}}}]}

@staticmethod
def get_report_data():
data = {'title': T1003.technique_title(T1003.tech_id)}
data = {'title': T1003.technique_title()}
if mongo.db.telemetry.count_documents(T1003.query):
data.update({'message': T1003.used_msg, 'status': ScanStatus.USED.name})
status = ScanStatus.USED
else:
data.update({'message': T1003.unscanned_msg, 'status': ScanStatus.UNSCANNED.name})
status = ScanStatus.UNSCANNED
data.update(T1003.get_message_and_status(status))
return data
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ class T1059(AttackTechnique):
@staticmethod
def get_report_data():
cmd_data = list(mongo.db.telemetry.aggregate(T1059.query))
data = {'title': T1059.technique_title(T1059.tech_id), 'cmds': cmd_data}
data = {'title': T1059.technique_title(), 'cmds': cmd_data}
if cmd_data:
data.update({'message': T1059.used_msg, 'status': ScanStatus.USED.name})
status = ScanStatus.USED
else:
data.update({'message': T1059.unscanned_msg, 'status': ScanStatus.UNSCANNED.name})
status = ScanStatus.UNSCANNED
data.update(T1059.get_message_and_status(status))
return data
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class T1059 extends React.Component {
super(props);
}

static getHashColumns() {
static getCommandColumns() {
return ([{
Header: 'Example commands used',
columns: [
Expand All @@ -27,7 +27,7 @@ class T1059 extends React.Component {
<br/>
{this.props.data.status === 'USED' ?
<ReactTable
columns={T1059.getHashColumns()}
columns={T1059.getCommandColumns()}
data={this.props.data.cmds}
showPagination={false}
defaultPageSize={this.props.data.cmds.length}
Expand Down

0 comments on commit 2bd744c

Please sign in to comment.