Home page logo

nmap-dev logo Nmap Development mailing list archives

Re: parsing of script-args is broken
From: Patrick Donnelly <batrick () batbytes com>
Date: Mon, 27 Apr 2009 16:38:20 -0600

Hi Jah,

On Mon, Apr 27, 2009 at 7:53 AM, jah <jah () zadkiel plus com> wrote:
Hi Patrick,

This patch looks good to me.  Do you think we should allow lists too:
Your patch will pass that example to loadstring() as:
whereas it is intented as:
["vhost"]={"domain.co.uk", "domain.com"}
supplying the arguments with quoted list-members works fine by the way:
--script-args vhost={'domain.co.uk','domain.com'}
=> ["vhost"]={'domain.co.uk','domain.com'}

A list seems to me to be a reasonable thing to be able to supply to a
script and with this patch, the user will have to quote the list items
themselves which isn't very intuitive given that we can quote key/value
pairs on their behalf.

I don't think array were originally intended but I have updated the
patch to allow this. Correctly implementing this with Lua's limited
regular expressions can be tricky to get correct so if you find any
more bugs (or have suggestions) let us know.


-Patrick Donnelly

"One of the lessons of history is that nothing is often a good thing
to do and always a clever thing to say."

-Will Durant

Attachment: sargs2.patch

Sent through the nmap-dev mailing list
Archived at http://SecLists.Org

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]