2

Is there a way to ask nmap to print the final scan report with the state of all ports tested and the reason?

For example when the scan is launched with --reason :

Nmap scan report for 127.0.0.1

Host is up, received user-set (0.000028s latency).
Scanned at 2016-03-12 17:11:53 WET for 42s
Not shown: 4093 closed ports
Reason: 3999 resets and 94 port-unreaches
PORT     STATE         SERVICE     REASON
22/tcp   open          ssh         syn-ack ttl 64
123/udp  open          ntp         udp-response ttl 64
137/udp  open|filtered netbios-ns  no-response
138/udp  open|filtered netbios-dgm no-response
1900/udp open|filtered upnp        no-response
5353/udp open|filtered zeroconf    no-response
Final times for host: srtt: 28 rttvar: 6  to: 100000

I would like to see all ports tested with their reason instead of having a condensed count of closed ports like in the output presented

Not shown: 4093 closed ports
Reason: 3999 resets and 94 port-unreaches

It could be interesting to know what probes received reset and those that received port-unreaches.

Thanks in advance.

2
  • Have you tried -v?
    – Henry F
    Mar 12, 2016 at 20:33
  • Yes i have used the following command: sudo nmap -n -vv -P0 -sS -sU -p T:1-4000,U:7,9,17,19,49,53,67-69,80,88,111,120,123,135-139,158,161-162,177,427,443,445,497,500,514-515,518,520,593,623,626,631,996-999,1022-1023,1025-1030,1433-1434,1645-1646,1701,1718-1719,1812-1813,1900,2000,2048-2049,2222-2223,3283,3456,3703,4444,4500,5000,5060,5353,5632,9200,10000,17185,20031,30718,31337,32768-32769,32771,32815,33281,49152-49154,49156,49181-49182,49185-49186,49188,49190-49194,49200-49201 -T 4 127.0.0.1
    – fabio
    Mar 12, 2016 at 22:00

2 Answers 2

2

You need to use the -d3 option to show all ports no matter what. For -d2 and lower, the formula is 25 * (v + 20 * d), where v is the number of verbose options (-v) used, and d is the number of debug options (-d) used in the command line. This gives the number of ports a state can have before being "ignored" or rolled up into the summary.

0

Use nmap --reason -dd (extra verbose debugging mode) to get a full list of reasons for all ports nmap is trying.

4
  • Actually need -d3 to show all ports no matter what. For -d2 and lower, formula is 25 * (v + 20 * d), so states with <=1000 ports shown with your options. Mar 13, 2016 at 4:12
  • Yes i had tried with -dd before. It gives the port result (open/closed) in real time for each port but doesn't show them in the final report and doesn't appear the reason in that output.
    – fabio
    Mar 14, 2016 at 4:09
  • Works for me! What nmap version are you using? Some of the output lines I get: 61900/tcp closed unknown conn-refused 62078/tcp closed iphone-sync conn-refused 63331/tcp closed unknown conn-refused 64623/tcp closed unknown conn-refused 64680/tcp closed unknown conn-refused (using nmap 6.47)
    – Mark Koek
    Mar 14, 2016 at 12:20
  • Nmap version 7.01
    – fabio
    Mar 14, 2016 at 16:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .