Skip to content

Commit

Permalink
add logs to explain what is happening.
Browse files Browse the repository at this point in the history
  • Loading branch information
elyousfi5 committed Mar 11, 2024
1 parent e0e74df commit 9fdba99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion agent/nmap_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ def process(self, message: msg.Message) -> None:
host = message.data.get("host", "")
hosts: List[Tuple[str, int]] = []

# Differentiate between a single IP mask in IPv4 and IPv6.
if "v4" in message.selector:
mask = int(message.data.get("mask", "32"))
max_mask = int(self.args.get("max_network_mask_ipv4", "32"))
Expand Down Expand Up @@ -121,6 +120,7 @@ def process(self, message: msg.Message) -> None:
)

if len(hosts) > 0:
logger.info("Scanning hosts `%s`.", hosts)
for host, mask in hosts:
if not self.add_ip_network(
b"agent_nmap_asset",
Expand All @@ -141,6 +141,7 @@ def process(self, message: msg.Message) -> None:
self._emit_network_scan_finding(scan_results, normal_results)
self._emit_fingerprints(scan_results, domain_name)
elif domain_name is not None:
logger.info("Scanning domain `%s`.", domain_name)
if not self.set_add(b"agent_nmap_asset", domain_name):
logger.debug("target %s was processed before, exiting", domain_name)
return
Expand Down

0 comments on commit 9fdba99

Please sign in to comment.