Home page logo

nmap-dev logo Nmap Development mailing list archives

[patch] Fix 2 scripts: p2p-conficker, http-vhosts
From: Daniel Miller <bonsaiviking () gmail com>
Date: Sun, 26 Jun 2011 15:50:52 -0500

Hey list,

Simple patch here to fix a couple issues I found while testing my XML output
patch. p2p-conficker was returning two values, but the runtime only takes
the first one, so it wouldn't produce meaningful output. http-vhosts was
missing a length operator when indexing a table, so you'd get an error about
using a table in an arithmetic calculation. Side note on that one: which is
better, style-wise and for performance?

mytable[#mytable+1] = "value"
table.insert(mytable, "value")


Index: scripts/p2p-conficker.nse
--- scripts/p2p-conficker.nse   (revision 24391)
+++ scripts/p2p-conficker.nse   (working copy)
@@ -621,6 +621,6 @@
                table.insert(response, string.format("%d/%d checks are
positive: Host is likely INFECTED", count, checks))

-       return true, stdnse.format_output(true, response)
+       return stdnse.format_output(true, response)

Index: scripts/http-vhosts.nse
--- scripts/http-vhosts.nse     (revision 24391)
+++ scripts/http-vhosts.nse     (working copy)
@@ -547,7 +547,7 @@
         if not http_response["ERROR"] then
-        result["ERROR"][result["ERROR"] + 1] = targetname
+        result["ERROR"][#result["ERROR"] + 1] = targetname
         local status = tostring(http_response.status)
         if not result[status] then
Sent through the nmap-dev mailing list
Archived at http://seclists.org/nmap-dev/

  By Date           By Thread  

Current thread:
  • [patch] Fix 2 scripts: p2p-conficker, http-vhosts Daniel Miller (Jun 26)
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]