Virtualization Adapted Adapting Business Processes for Virtual Infrastrcuture (and vice-versa)

2009/04/13

NMAP tricks

Filed under: Uncategorized — Tags: , , , , — iben @ 22:49

How to use NMAP to count the number of hosts on a given subnet.

#!/bin/bash
echo 4192 > /proc/sys/net/ipv4/neigh/default/gc_thresh3
nmap -sP -PI $1 -n –max_rtt_timeout 5000 –initial_rtt_timeout 5000 | tail -1 | cut -f 2 -d “(” | cut -f 1 -d ” ” 2> /dev/null

(Thanks to Gabriel for this one!)

Powered by WordPress