How to discover web servers on a local network?

Stefan Kendall picture Stefan Kendall · Apr 27, 2010 · Viewed 11.9k times · Source

Suppose I'm running several servers serving basic requests on my local network (say a home network, where all machines generally have an IP in the form K.K.K.x, where x is variable). Is there an easy way to discover all such servers? I would need to find each IP on the network running a particular java server application.

Answer

Trey Hunner picture Trey Hunner · Apr 27, 2010

Are you looking for a solution within your Java application? If you are simply looking for a one-time solution, nmap should work.

If your local network is of the form 192.*.*.* try this (I added sudo because it must be run as root):

sudo nmap -vv -sS -O -n "192.168.1.1/24"