Skip to content

Commit

Permalink
split output into two raw files, and fix no-output mimetype in main.py (
Browse files Browse the repository at this point in the history
#2604)

Co-authored-by: Jeroen Dekkers <[email protected]>
  • Loading branch information
underdarknl and dekkers authored Mar 7, 2024
1 parent b3f4621 commit 2bfa89b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions boefjes/boefjes/plugins/kat_nmap_ip_range/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def run(boefje_meta: BoefjeMeta) -> list[tuple[set, bytes | str]]:
min_mask,
ip_range.prefixlen,
)
return [(set("info/boefje"), "Skipping range due to unaccepted VSLM.")]
return [({"info/boefje"}, "Skipping range due to unaccepted VSLM.")]

top_ports_tcp = int(getenv("TOP_PORTS_TCP", 250))
top_ports_udp = int(getenv("TOP_PORTS_UDP", 10))
Expand All @@ -67,8 +67,12 @@ def run(boefje_meta: BoefjeMeta) -> list[tuple[set, bytes | str]]:

results = []
if top_ports_tcp:
results.append(run_nmap(build_nmap_arguments(ip_range=ip_range, top_ports=top_ports_tcp, protocol_str="S")))
results.append(
(set(), run_nmap(build_nmap_arguments(ip_range=ip_range, top_ports=top_ports_tcp, protocol_str="S")))
)
if top_ports_udp:
results.append(run_nmap(build_nmap_arguments(ip_range=ip_range, top_ports=top_ports_udp, protocol_str="U")))
results.append(
(set(), run_nmap(build_nmap_arguments(ip_range=ip_range, top_ports=top_ports_tcp, protocol_str="U")))
)

return [(set(), "\n\n".join(results))]
return results

0 comments on commit 2bfa89b

Please sign in to comment.