forked from p15670423/monkey
Agent: Use filter() to improve loop in _process_tcp_scan_results()
This commit is contained in:
parent
ea0ab309d2
commit
fa59f45d31
|
@ -107,9 +107,8 @@ class Propagator:
|
||||||
victim_host.os["type"] = ping_scan_data.os
|
victim_host.os["type"] = ping_scan_data.os
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _process_tcp_scan_results(victim_host: VictimHost, port_scan_data: PortScanData) -> bool:
|
def _process_tcp_scan_results(victim_host: VictimHost, port_scan_data: PortScanData):
|
||||||
for psd in port_scan_data.values():
|
for psd in filter(lambda psd: psd.status == PortStatus.OPEN, port_scan_data.values()):
|
||||||
if psd.status == PortStatus.OPEN:
|
|
||||||
victim_host.services[psd.service] = {}
|
victim_host.services[psd.service] = {}
|
||||||
victim_host.services[psd.service]["display_name"] = "unknown(TCP)"
|
victim_host.services[psd.service]["display_name"] = "unknown(TCP)"
|
||||||
victim_host.services[psd.service]["port"] = psd.port
|
victim_host.services[psd.service]["port"] = psd.port
|
||||||
|
|
Loading…
Reference in New Issue