Nmap Development mailing list archives

Lua issues


From: CheesStick peak <crnxyrnx () gmail com>
Date: Mon, 6 Feb 2012 12:14:20 +0100

Hello

Im currently working with the nmap script engine and with lua.
Im more into perl but i wanted to give lua a try so I started scripting a
bit.

Now it looks for me that the nse is not working like normal lua. I have an
example according my work with tables:


local table= { 123, 231 , "aaa" , xxx = { "x1", "x2"} , 666 , test="showme"
, 777 }

now when I do:
for i,v in ipairs(table) do print(i,v) end

it gives me:
1    123
2    231
3    aaa
4    666
5    777
(the same does table.concat(table,"\n") btw.)

BUT, according to different lua sites it should be:
1      123
2      231
3      aaa
4      table: 0035xxxx
5      666
test  showme
7      777

... ?

So i hope you can help me, because all I want is to know what http header
http.get gives me back:

local req = http.get ( "example.com" , 80, "/index.php")
print req.status         -- 200
print (req['header'])     --table: 0x97874a0
print (table.getn(req['header']))    --- erm... what??wtf?

sincerely

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


Current thread: