Nmap Development mailing list archives

Re: NSE - hostrule function passed an empty host object


From: Peter Hogg <dev () vokoda com>
Date: Thu, 27 Jan 2011 15:48:59 +0000

When I run without su privileges, I get some different parts of host,
but still not the traceroute info:


NSE: Script scanning 74.125.230.116.
bin_ip: J}æt
name:
ip: 74.125.230.116

NSE: Script Scanning completed.



Very confused.

On Thu, Jan 27, 2011 at 3:35 PM, Peter Hogg <dev () vokoda com> wrote:
Hi, I'm trying to create a hostrule to check that traceroute data is
available for the given host - very simple. This is what I have:

require 'nsedebug'

hostrule = function(host)
 if not host.traceroute then
    print(nsedebug.tostr(host))
    return false
 end
 return true
end


When I test this using the --traceroute option, it returns false.
Furthermore the host object contains only a 'mac_addr_sr' key. I must
be doing something very stupid. I'm on OS X 10.6, Nmap 5.21 compiled
from source. Here is the output:


bash-3.2$ sudo nmap --script test --traceroute 74.125.230.116 -d

.....lots of debug text.....

NSE: Script scanning 74.125.230.116.
mac_addr_src:
NSE: Script Scanning completed.
Nmap scan report for 74.125.230.116
Host is up, received echo-reply (0.043s latency).
Scanned at 2011-01-27 15:23:32 GMT for 7s
Not shown: 995 filtered ports
Reason: 995 no-responses
PORT     STATE  SERVICE REASON
80/tcp   open   http    syn-ack
113/tcp  closed auth    reset
443/tcp  open   https   syn-ack
554/tcp  closed rtsp    reset
1935/tcp closed rtmp    reset

TRACEROUTE (using port 113/tcp)
HOP RTT       ADDRESS
1   35.62 ms  REMOVED BY ME
2   31.45 ms  REMOVED BY ME
3   34.86 ms  REMOVED BY ME
4   38.83 ms  REMOVED BY ME
5   105.04 ms REMOVED BY ME
6   28.95 ms  REMOVED BY ME
7   37.38 ms  acc1-10GigE-3-3-0.sf.21cn-ipp.bt.net (109.159.251.91)
8   39.30 ms  core2-te0-12-0-6.ilford.ukcore.bt.net (109.159.251.7)
9   41.69 ms  core4te-0-7-1-0.telehouse.ukcore.bt.net (62.172.102.29)
10  37.15 ms  74.125.230.116
Final times for host: srtt: 42924 rttvar: 20263  to: 123976

Read from /opt/local/share/nmap: nmap-services.
Nmap done: 1 IP address (1 host up) scanned in 7.08 seconds
          Raw packets sent: 2016 (88.680KB) | Rcvd: 22 (1052B)


Any ideas on what I might be doing wrong?

Thanks

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: