Exploit-DB updates

Thursday, January 6, 2011

Scanning random IP ranges for specific ports with NMAP

This will be a quick example of how Nmap can scan a random IP range for specific ports with the scanner Nmap.




Nmap ("Network Mapper") is a free and open source (license) utility for network exploration or security auditing. Many systems and network administrators also find it useful for tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. It was designed to rapidly scan large networks, but works fine against single hosts. Nmap runs on all major computer operating systems, and official binary packages are avalable for Linux, Windows, and Mac OS X. In addition to the classic command-line Nmap executable, the Nmap suite includes an advanced GUI and results viewer (Zenmap), a flexible data transfer, redirection, and debugging tool (Ncat), and a utility for comparing scan results (Ndiff).

Example command;
nmap -iR <# of ips> -oG filename -A -p 21-25, 8080 --open

nmap -iR 1000 -oG nlog -A -p 21-25 --open

Pretty obvious, but this scans 1000 random ips for open ports 21-25 (Telnet, FTP, SSH) and only displays the IP if it has an open port. It also runs a OS detection, service detection and traceroute due to the "-A". It then logs the scan as nlog. Do note this is a noisy scan due to all the service and OS detections, which means you could detected/block it.

1 comment: