0

I've read about the -oG and tried it out, but it seems to not to working for me... SO basically I'm trying to scan for a port range, lets say for example 2.8.0.0 – 2.15.255.255 and for a list of for open ports: 80, 8080, 8001, 8008. And the output should be ip and open port like this: 2.8.0.0 80 2.8.0.0 8080 2.8.1.2 80
...

I'm not at my PC at the moment so I can't remember the exact line I used to scan with nmap.

Best Regards

1
  • 1
    You should ask when you /are/ at your PC and /can/ check what you are actually trying and does not work. Also, seems to fit better on Security than SO.
    – Daniel Roethlisberger
    Apr 29, 2012 at 11:01

2 Answers 2

2

The Grepable output option (-oG) is covered in the this section of the online version of Nmap Network Scanning. Like all the -o* output options, it takes a filename argument. Normal output will be displayed, but the Grepable output will be sent to the file named by the argument. As a special case, a file name of - can be used to send the Grepable output to the console instead of the normal output.

The output itself is different than you seem to be expecting, and is covered in depth on Nmap's web site. It's important to note that when parsing Nmap's output with another program, the XML output (-oX) is recommended, since it contains all the information gathered in the scan. Grepable output is deprecated, and so is missing (among other things) traceroute information and script output.

1

the -oG option takes an extra argument of an output filename

this could be an actual file, or a hyphen (-) which is the standard output (the console)

This command works as expexted, printing to the screen

nmap -oG - -p80,8080,8001,8008 192.168.1.0/24

You must log in to answer this question.