Security Basics mailing list archives

Re: Nmap oprions


From: Daniel Miessler <daniel () dmiessler com>
Date: Mon, 27 Jun 2005 14:04:15 -0400


On Jun 24, 2005, at 4:14 PM, Hecber Cordova wrote:

I need to scan my big network for port 21 on many
hosts.

I want that nmap will show me just the hosts which the
port found open. I know that I can do this with grep
but im not sure about the syntex.

I like this method:

nmap -n -p21 -oG output_file | cut -d" " -f2 | grep ^[0-9]

This will print your Nmap output in grepable format, cut out the second field (which will be an IP due to the -n switch in the Nmap command), and then make sure the field starts with a number. That should work for you.

Here's my own short primer that may be of some use to you:
http://dmiessler.com/study/nmap

Cheers,

--
Daniel R. Miessler
M: daniel () dmiessler com
W: http://dmiessler.com
G: 0x316BC712




Attachment: PGP.sig
Description: This is a digitally signed message part


Current thread: