Nmap Development mailing list archives

Re: [NSE patch] robots.nse performance tuning


From: "Eddie Bell" <ejlbell () gmail com>
Date: Mon, 14 Jan 2008 00:14:10 +0000

Great! I've applied them both to svn

- eddie

On 13/01/2008, Sven Klemm <sven () c3d2 de> wrote:
Hi,

I attached a patch that makes robots.nse tell the server to
immediately close the connection so the script won't run into the
timeout. This results in a nice speed improvement for the script.

The first nmap run is with my modified version and the second is with
 the original script. I truncated the script output because the google
robots.txt is rather large.

nmap -p80 google.com --script robots

Starting Nmap 4.53 ( http://insecure.org ) at 2008-01-13 23:50 CET
Warning: Hostname google.com resolves to 3 IPs. Using 72.14.207.99.
Interesting ports on eh-in-f99.google.com (72.14.207.99):
PORT   STATE SERVICE
80/tcp open  http
|  robots.txt: /news?output=xhtml& /search /groups /images
|_ /gcc/ /aclk /cse? /tbproxy/

Nmap done: 1 IP address (1 host up) scanned in 0.838 seconds

nmap -p80 google.com --script robots_orig

Starting Nmap 4.53 ( http://insecure.org ) at 2008-01-13 23:51 CET
Warning: Hostname google.com resolves to 3 IPs. Using 72.14.207.99.
Interesting ports on eh-in-f99.google.com (72.14.207.99):
PORT   STATE SERVICE
80/tcp open  http
|  robots.txt: /news?output=xhtml& /search /groups /images
|_ /gcc/ /aclk /cse? /tbproxy/

Nmap done: 1 IP address (1 host up) scanned in 4.810 seconds

Cheers,
Sven

--
Sven Klemm
http://cthulhu.c3d2.de/~sven/


Index: robots.nse
===================================================================
--- robots.nse  (revision 6687)
+++ robots.nse  (working copy)
@@ -48,6 +48,7 @@
        query = query .. "Accept-Language: en"
        query = query .. "User-Agent: Nmap NSE"
        query = query .. "Host: " .. host.ip .. ":" .. port.number
+       query = query .. "Connection: close"
        query = query .. '\r\n\r\n';
        try(soc:send(strbuf.dump(query, '\r\n')))



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



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


Current thread: