added a --force flag
This commit is contained in:
+6
-2
@@ -1,7 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# fingerprint some ports and try out some basic enumeration: For Example SMB Null Authentication
|
|
||||||
|
|
||||||
help() {
|
help() {
|
||||||
cat <<SYNTAX
|
cat <<SYNTAX
|
||||||
usage: $0 [-p port] [--nmap] locale
|
usage: $0 [-p port] [--nmap] locale
|
||||||
@@ -14,6 +12,7 @@ options:
|
|||||||
--nmap run nmap after port scan
|
--nmap run nmap after port scan
|
||||||
--open only print hosts with atleast one open port
|
--open only print hosts with atleast one open port
|
||||||
--hosts only print live hosts in the subnet
|
--hosts only print live hosts in the subnet
|
||||||
|
--force scan open ports even if ping is disabled
|
||||||
SYNTAX
|
SYNTAX
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
@@ -73,6 +72,7 @@ udp_scan(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
fast_ping(){
|
fast_ping(){
|
||||||
|
[[ $FORCE == true ]] && { echo $ip >> /tmp/ips; return; }
|
||||||
nn=$(ping -n -w2 -c1 $ip >/dev/null 2>&1; echo $?)
|
nn=$(ping -n -w2 -c1 $ip >/dev/null 2>&1; echo $?)
|
||||||
[[ $nn == 0 ]] && { echo $ip >> /tmp/ips; }
|
[[ $nn == 0 ]] && { echo $ip >> /tmp/ips; }
|
||||||
}
|
}
|
||||||
@@ -177,6 +177,7 @@ cidr_to_ips() {
|
|||||||
RUN_NMAP=false
|
RUN_NMAP=false
|
||||||
HOST_SCAN=false
|
HOST_SCAN=false
|
||||||
PRINT_OPEN=false
|
PRINT_OPEN=false
|
||||||
|
FORCE=false
|
||||||
while [ "$1" != "" ]; do
|
while [ "$1" != "" ]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
-p | --port)
|
-p | --port)
|
||||||
@@ -197,6 +198,9 @@ while [ "$1" != "" ]; do
|
|||||||
--hosts)
|
--hosts)
|
||||||
HOST_SCAN=true
|
HOST_SCAN=true
|
||||||
;;
|
;;
|
||||||
|
--force)
|
||||||
|
FORCE=true
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
if [[ $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
if [[ $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
ip=$1
|
ip=$1
|
||||||
|
|||||||
Reference in New Issue
Block a user