Tunneling and report recommendation bugfixes (#375)
Tunneling and report recommendation bugfixes
This commit is contained in:
commit
62108146a9
|
@ -32,6 +32,7 @@ class Monkey(Document):
|
||||||
critical_services = ListField(StringField())
|
critical_services = ListField(StringField())
|
||||||
pba_results = ListField()
|
pba_results = ListField()
|
||||||
ttl_ref = ReferenceField(MonkeyTtl)
|
ttl_ref = ReferenceField(MonkeyTtl)
|
||||||
|
tunnel = ReferenceField("self")
|
||||||
|
|
||||||
# LOGIC
|
# LOGIC
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
|
@ -373,8 +373,13 @@ class ReportService:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_exploits():
|
def get_exploits():
|
||||||
|
query = [{'$match': {'telem_category': 'exploit', 'data.result': True}},
|
||||||
|
{'$group': {'_id': {'ip_address': '$data.machine.ip_addr'},
|
||||||
|
'data': {'$first': '$$ROOT'},
|
||||||
|
}},
|
||||||
|
{"$replaceRoot": {"newRoot": "$data"}}]
|
||||||
exploits = []
|
exploits = []
|
||||||
for exploit in mongo.db.telemetry.find({'telem_category': 'exploit', 'data.result': True}):
|
for exploit in mongo.db.telemetry.aggregate(query):
|
||||||
new_exploit = ReportService.process_exploit(exploit)
|
new_exploit = ReportService.process_exploit(exploit)
|
||||||
if new_exploit not in exploits:
|
if new_exploit not in exploits:
|
||||||
exploits.append(new_exploit)
|
exploits.append(new_exploit)
|
||||||
|
|
Loading…
Reference in New Issue