Nmap Development mailing list archives

stdnse.format_output causing scripts to appear with blank output


From: David Fifield <david () bamsoftware com>
Date: Sun, 31 Jan 2010 12:40:24 -0700

There is a problem with stdnse.format_output as it is used in scripts.
When it gets passed an empty table, it returns the empty string. When a
script returns the empty string, it shows up in the output table with no
output.

See citrix-enum-apps-xml and citrix-enum-servers-xml here.

$ nmap --datadir . --script=safe scanme.nmap.org

Starting Nmap 5.20 ( http://nmap.org ) at 2010-01-31 12:27 MST
Nmap scan report for scanme.nmap.org (64.13.134.52)
Host is up (0.072s latency).
Not shown: 994 filtered ports
PORT      STATE  SERVICE
25/tcp    closed smtp
53/tcp    open   domain
70/tcp    closed gopher
80/tcp    open   http
|_citrix-enum-apps-xml:
|_citrix-enum-servers-xml:
| http-headers:
|   Date: Sun, 31 Jan 2010 19:28:13 GMT
|   Server: Apache/2.2.3 (CentOS)
|   Accept-Ranges: bytes
|   Content-Length: 739
|   Connection: close
|   Content-Type: text/html; charset=UTF-8
|
|_  (Request type: HEAD)
|_http-date: Sun, 31 Jan 2010 19:28:14 GMT; +1s from local time.
|_html-title: Go ahead and ScanMe!
113/tcp   closed auth
31337/tcp closed Elite

In r16655 I made it so that top-level calls to stdnse.format_output will
return nil, not the empty string. I did a quick grep of scripts and all
of them seem to return the result of stdnse.format_output directly, and
won't have a problem if the result they return is not a string. Are
there any problems with doing this?

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


Current thread: