dotfiles/scripts/scan-network
2017-06-17 18:35:23 +02:00

8 lines
557 B
Bash
Executable file

#!/bin/bash
#Why does it not work all the time ?
#When this command runs nmap tries to ping the given IP address range to check if the hosts are alive. If ping fails it tries to send syn packets to port 80 (SYN scan). This is not hundred percent reliable because modern host based firewalls block ping and port 80. Windows firewall blocks ping by default. The hosts you have on the network are blocking ping and the port 80 is not accepting connections. Hence nmap assumes that the host is not up.
# $1 = ip gateway
# example 192.168.178.1/24
nmap -sP $1