Netmask is another simple tool which does one thing and that is, makes a ICMP netmask request. By determining the netmasks of various computers on a network, you can better map your subnet structure and infer trust relationships.
Lets have a look at our options:
- root@666:~# netmask -h
- This is netmask, an address netmask generation utility
- Usage: netmask spec [spec ...]
- -h, --help Print a summary of the options
- -v, --version Print the version number
- -d, --debug Print status/progress information
- -s, --standard Output address/netmask pairs
- -c, --cidr Output CIDR format address lists
- -i, --cisco Output Cisco style address lists
- -r, --range Output ip address ranges
- -x, --hex Output address/netmask pairs in hex
- -o, --octal Output address/netmask pairs in octal
- -b, --binary Output address/netmask pairs in binary
- -n, --nodns Disable DNS lookups for addresses
- Definitions:
- a spec can be any of:
- address
- address:address
- address:+address
- address/mask
- an address can be any of:
- N decimal number
- 0N octal number
- 0xN hex number
- N.N.N.N dotted quad
- hostname dns domain name
- a mask is the number of bits set to one from the left
So our usage would look like this:
- Usage: ./netmask -d destination -t timeout
Lets try one with the defaults:
- root@666:~# netmask cnn.com
- 157.166.226.26/32
Using the -s, –standard option:
- root@666:~# netmask -s cnn.com
- 157.166.255.19/255.255.255.255
Using the -x, –hex option:
- root@666:~# netmask -x cnn.com
- 0x9da6ff12/0xffffffff
Using the -o, –octal option:
- root@666:~# netmask -o cnn.com
- 023551561032/037777777777
Using the -b, –binary option:
- root@666:~# netmask -b cnn.com
- 10011101 10100110 11111111 00010010 / 11111111 11111111 11111111 11111111
Once again this is a very simple tool and there are many other tools with the same functionality but sometimes in a pentest and especially shell scripting, little tools like this can come in very handy.
1 Comment