Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

migrated from stackoverflow.com Apr 30 '12 at 12:10

This question came from our site for professional and enthusiast programmers.

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 '12 at 11:01
add comment

2 Answers 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.

share|improve this answer
add comment

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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.