1

I have a question to write a script using nmap to look at TCP ports across the entire network to identify which IP addresses are running any of those services.

Sorry my english is not good.

Wayne
  • 11
  • 2
    Read man nmap. That kind of thing is what nmap was designed for. Warning: Depending on what you mean by "across the entire network", you could be on the edge of illegal behaviour. Ensure the the network manager is aware, and approves. A Port Scan is often a precursor to an attack. Don't trigger a response - get approval first. – waltinator Dec 21 '16 at 15:23
  • Which services are you referring to ? – George Udosen Dec 21 '16 at 15:27
  • it's just a normal scan, because I'm new to nmap and I heard it can do lot of things, so I just want to give it a try. *waltinator – Wayne Dec 21 '16 at 16:15
  • tcp ports 53 and 123 services =) *George – Wayne Dec 21 '16 at 16:18

1 Answers1

0

What you want to do is this:

nmap -p 53,123 192.168.0.0/24
  • -p specifies list of comma-separated ports.
  • 192.168.0.0/24 tells to scan local network in CIDR notation. Please note that if you are scanning a local network, you need to know what type it is; for example /24 means there are 2^(32-24) - 1 = 255 possible host addresses ( and if you exclude router, broadcast, and network ID there are 3 less addresses ). Use ip addr -o to find on what network you are on.

Of course, you can use other options in combination with this to perform various types of scans.