Reputation: 799
If NMap scans a host the output shows the latency:
C:\Program Files (x86)\Nmap>nmap -sn -n 192.168.100.150
Starting Nmap 6.46 ( http://nmap.org ) at 2014-07-30 17:28 Romance Daylight Time
Nmap scan report for 192.168.100.150
Host is up (0.036s latency).
MAC Address: 00:FF:63:1A:0B:0B (Unknown)
Nmap done: 1 IP address (1 host up) scanned in 1.27 seconds
But if I try to generate the XML the latency doesn't appear:
C:\Program Files (x86)\Nmap>nmap -sn -n 192.168.100.150 -oX C:\temp\output.xml
XML output:
<?xml version="1.0"?>
<!DOCTYPE nmaprun PUBLIC "-//IDN nmap.org//DTD Nmap XML 1.04//EN" "https://svn.nmap.org/nmap/docs/nmap.dtd">
<?xml-stylesheet href="file:///C:/Program Files (x86)/Nmap/nmap.xsl" type="text/xsl"?>
<!-- Nmap 6.46 scan initiated Wed Jul 30 17:32:00 2014 as: nmap -sn -n -oX C:\\temp\\output.xml 192.168.100.150 -->
<nmaprun scanner="nmap" args="nmap -sn -n -oX C:\\temp\\output.xml 192.168.100.150" start="1406734320" startstr="Wed Jul 30 17:32:00 2014" version="6.46" xmloutputversion="1.04">
<verbose level="0"/>
<debugging level="0"/>
<host><status state="up" reason="arp-response" reason_ttl="0"/>
<address addr="192.168.100.150" addrtype="ipv4"/>
<address addr="00:FF:63:1A:0B:0B" addrtype="mac"/>
<hostnames>
</hostnames>
<times srtt="198000" rttvar="198000" to="990000"/>
</host>
<runstats><finished time="1406734321" timestr="Wed Jul 30 17:32:01 2014" elapsed="1.45" summary="Nmap done at Wed Jul 30 17:32:01 2014; 1 IP address (1 host up) scanned in 1.45 seconds" exit="success"/><hosts up="1" down="0" total="1"/>
</runstats>
</nmaprun>
I found an old post (2009) that asked the same question and it's supposed that has been fixed in version 5.10: http://seclists.org/nmap-dev/2009/q4/432 https://svn.nmap.org/nmap/todo/done.txt
Any solution?
Upvotes: 1
Views: 712
Reputation: 6005
The latency is in a different format in the srtt
attribute of the <times>
element. This is the "smoothed average round trip time" which is given in microseconds. This means your XML output:
<times srtt="198000" rttvar="198000" to="990000"/>
would mean a latency of 0.20s
(Nmap always reports latency to 2 significant digits).
Upvotes: 2