Skip to content

Commit 0b5de10

Browse files
committed
Amended Ping Sweeper to handle files as inputs.
1 parent be406b8 commit 0b5de10

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

reconnoitre/ping_sweeper.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
def ping_sweeper(target_hosts, output_directory, quiet):
88
check_directory(output_directory)
9+
910
output_file = output_directory + "/targets.txt"
1011

1112
print("[+] Writing discovered targets to: %s" % output_file)
@@ -14,7 +15,10 @@ def ping_sweeper(target_hosts, output_directory, quiet):
1415

1516
print("[+] Performing ping sweep over %s" % target_hosts)
1617

17-
SWEEP = "nmap -n -sP %s" % (target_hosts)
18+
if (os.path.isfile(target_hosts)):
19+
SWEEP = "nmap -n -sP -iL %s" % (target_hosts)
20+
else:
21+
SWEEP = "nmap -n -sP %s" % (target_hosts)
1822
results = subprocess.check_output(SWEEP, shell=True)
1923
lines = results.split("\n")
2024

0 commit comments

Comments
 (0)