comp.org.uk

Networking | Programming | Security | Linux | Computer Science | About

netenum: Ping Sweep

If you have a need for a very simple ICMP ping sweep program that you can use for scriptable applications, netenum might be useful. It performs a basic ICMP ping and then replies with only the reachable targets.

One quirk about netenum is that it requires a timeout to be specified for the entire test. If no timeout is specified, it outputs a CK-delimited dump of the inputted addresses. If you have tools that will not accept a CIDK formatted range of addresses, you might use netenum to simply expand that into a listing of individual IP addresses.

How to install netenum

Netenum comes as part of the IRPas suite of tools. You can download it from the Phenoelit site.

Once you've downloaded, create a directory for irpas and place the .tar.gz file inside

tar -zxvf irpas_0.9.tar.gz
make

Note: By default all files bar the libpcap directory in the tar ball extracts to the directory you run the extraction from, hence the need to place in a directory to start with.

Usage of netenum

netenum [timeout] [verbosity]

destination can be in the following formats:

dotted IP address: 192.168.1.1 IP and Netmask: 192.168.1.1/255.255.255.0 IP and CIDR notation: 192.168.1.1/24 Name: comp.org.uk

Timeout applies for the whole operation. Verbosity is between 0 (quiet) to 3 (verbose).

Shell Scripting with netenum

One way to make use of netenum is within a bash script making use of hsrp. An example of this is:

for i in `netenum 192.168.1.0/26`
 do
    ./hsrp -d ${i} -v192.168.1.22 -a cisco -g 1 -i eth0
 done

Obviously you can direct the output to a text file (e.g. netenum 192.168.0.0/24 5 > target.txt or by pipe to any other Linux command.


Published on Thu 02 August 2007 by Hatty Jenkins in Security with tag(s): netenum ping