Skip to content

Commit

Permalink
conn.py: handle checking binetflow icmp flows for telnet traffic
Browse files Browse the repository at this point in the history
  • Loading branch information
AlyaGomaa committed Dec 11, 2024
1 parent e529c70 commit be788bd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/flowalerts/conn.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,14 @@ def check_unknown_port(self, profileid, twid, flow):
return True

def is_telnet(self, flow) -> bool:
try:
dport = int(flow.dport)
except ValueError:
# binetflow icmp ports are hex strings
return False

telnet_ports = (23, 2323)
return int(flow.dport) in telnet_ports and flow.proto.lower() == "tcp"
return dport in telnet_ports and flow.proto.lower() == "tcp"

def check_multiple_telnet_reconnection_attempts(
self, profileid, twid, flow
Expand Down

0 comments on commit be788bd

Please sign in to comment.