Skip to content

Commit

Permalink
fix getting horizontal portscan evidence uids
Browse files Browse the repository at this point in the history
  • Loading branch information
AlyaGomaa committed Nov 29, 2023
1 parent ba9de07 commit bb22df2
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions modules/network_discovery/horizontal_portscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def combine_evidence(self):
'protocol': protocol,
'profileid': profileid,
'twid': twid,
'uid': final_evidence_uids,
'uids': final_evidence_uids,
'dport':dport,
'pkts_sent': final_pkts_sent,
'timestamp': timestamp,
Expand Down Expand Up @@ -212,20 +212,23 @@ def check(self, profileid: str, twid: str):
'protocol': protocol,
'profileid': profileid,
'twid': twid,
'uid': self.get_uids(dstips),
'uids': self.get_uids(dstips),
'dport':dport,
'pkts_sent':self.get_packets_sent(dstips),
'timestamp': next(iter(dstips.values()))['stime'],
'state': state,
'amount_of_dips': amount_of_dips
}

self.decide_if_time_to_set_evidence_or_combine(evidence, cache_key)
self.decide_if_time_to_set_evidence_or_combine(
evidence,
cache_key
)

def decide_if_time_to_set_evidence_or_combine(
self,
evidence: dict,
cache_key: str
self,
evidence: dict,
cache_key: str
) -> bool:
"""
sets the evidence immediately if it was the
Expand Down Expand Up @@ -307,5 +310,5 @@ def set_evidence_horizontal_portscan(
proto=evidence["protocol"],
profileid=evidence["profileid"],
twid=evidence["twid"],
uid=evidence["uid"]
uid=evidence["uids"]
)

0 comments on commit bb22df2

Please sign in to comment.