Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 95814b6 commit 53e25a9Copy full SHA for 53e25a9
get_hosts.sh
@@ -0,0 +1,11 @@
1
+#!/bin/bash
2
+
3
+# ./get_hosts.sh 192.168.0.0/24
4
5
+SS="$1"
6
+FF=`echo $SS | tr '/' '-'`
7
+sudo nmap -p22,139,445,80,443 -T5 $SS -oG "$FF"_nmap_NP -Pn -vv
8
+sudo nmap -v -sn $SS -T5 -oN "$FF"_nmap_PS -vv
9
+grep -i "host is up" -B1 "$FF"_nmap_PS.nmap | grep report | rev | cut -d' ' -f1 | tr -d '()' | rev >> "$FF"_up.ip.tmp
10
+grep /open/ "$FF"_nmap_NP.gnmap | cut -d' ' -f2 >> "$FF"_up.ip.tmp
11
+cat "$FF"_up.ip.tmp | sort -u > "$FF"_up.ip
0 commit comments