>>107642296
This is a good question, best I've seen in what seems like ages. I've messed around with nmap to a good degree of success, to the point of saying that I even understand how the tool works. In short my advice is to read the nmap manual and try to understand how the scans work. I'll try to explain.
#-sn option specifies a ping scan
nmap -sn 192.168.1.0/24
# above terminal command is functionally equivalent to doing something along these lines in Python:
IP = "192.168.0/24"
online_IPs = {}
while(IP=this.get_next_IP()):
response = nmap_ping_scan_(IP) # nmap_ping_scan(IP) returns None if target host is not up and responding to pings
#response = get_ping_response(IP) # works the same as above
if response != None:
online_IPs.append(IP)
Comment too long. Click here to view the full text.