Nmap Development mailing list archives

Re: dev Digest, Vol 110, Issue 8


From: Bart <chelloo () gmail com>
Date: Sun, 11 May 2014 20:28:53 +0200

Yes workign great ;))

You are a BOSS man :)) im happy thx alot

nmap -p 22,23,161,162,666,1336,80,8080,8081,2323,2222 -T4 -d1 -v1
--open -Pn "-PU161,162" --script snmp-sysdescr --script-args
snmpcommunity=^'biG=d0tcat^' TEST IP

Im just not sure only if the string is read correct

NSE: Using Lua 5.2.
NSE: Script Arguments seen from CLI: snmpcommunity='biG=d0tcat'
<<--  should it not be without the " ' " ?
NSE: Loaded 1 scripts for scanning.
NSE: Script Pre-scanning.
NSE: Starting runlevel 1 (of 1) scan.

On 11 May 2014 20:21, Bart <chelloo () gmail com> wrote:
Hi Jay,

Thanks for you great feedback :)
I have linux here too so its no problem , i dont have the option to
test now, but i wil do later and let you know .
Again thx for your time

Cheers

Bart


On 11 May 2014 20:15, Jay Bosamiya <jaybosamiya () gmail com> wrote:
Hi Bart,

I was on linux when I first replied to your mail and had tested the command
there and it had worked, but I forgot (momentarily) that windows has a
different escape sequence and you were using windows.
BTW, Linux uses \ to escape characters and windows uses ^

So, on Windows, your command would thus need to be
nmap -p 22,23,161,162,666,1336,80,8080,8081,2323,2222 -T4 -v -Pn
"-PU161,162" --script snmp-sysdescr --script-args
snmpcommunity=^'biG=d0tcat^' TESTIPADRES

While on Linux, your command would need to be

nmap -p 22,23,161,162,666,1336,80,8080,8081,2323,2222 -T4 -v -Pn
"-PU161,162" --script snmp-sysdescr --script-args
snmpcommunity=\'biG=d0tcat\' TESTIPADRES

Try copying and pasting the windows line exactly as it is and report back
with the results.

It should work fine then. On my network, running the above command on my
Windows machine (Windows 8), the error is there no more and nmap executes
fine (except for the fact that biG=d0tcat is not my cm string).

Happy to help :)

FYI, there is some more detailed explanation below if you wish to know what
and how I tested to make sure that the command *should* work.

Cheers,
Jay




In order to try reproducing the bug on windows and to test the escaped
sequence fix, I tried the following.

I ran the following tests
[1] nmap -sU -p 161 --script snmp-sysdescr TESTIPADDRESS -n
[2] nmap -sU -p 161 --script snmp-sysdescr TESTIPADDRESS -n --script-args
snmpcommunity=public
[3] nmap -sU -p 161 --script snmp-sysdescr TESTIPADDRESS -n --script-args
snmpcommunity=^'public^'
[4] nmap -sU -p 161 --script snmp-sysdescr TESTIPADDRESS -n --script-args
snmpcommunity=randomtest
[5] nmap -sU -p 161 --script snmp-sysdescr TESTIPADDRESS -n --script-args
snmpcommunity=biG=d0tcat
[6] nmap -sU -p 161 --script snmp-sysdescr TESTIPADDRESS -n --script-args
snmpcommunity=^'biG=d0tcat^'

The outputs of [1] and [2] and [3] were exactly the same (as expected)
[4] worked as expected and did not show any new data (since randomtest is
not community string in my network)
[5] threw error (same as mentioned by you before)
[6] did not throw error and gave output same as [4] (since biG=d0tcat is not
community string in my network, it is equivalent to randomtest).


On Sunday 11 May 2014 05:27 PM, Bart wrote:

Hi Jay,

Thx for your help and feedback, when i use your new commandline im
getting the same output

C:\Program Files (x86)\Nmap/nse_main.lua:1178: Value around
'=d0tcat'\}' is invalid or is unterminated by a valid separator
stack traceback:
         [C]: in function 'error'
         C:\Program Files (x86)\Nmap/nse_main.lua:1178: in function
'parse_string'
         C:\Program Files (x86)\Nmap/nse_main.lua:1201: in function
'parse_table'
         C:\Program Files (x86)\Nmap/nse_main.lua:1219: in main chunk
         [C]: in ?

The problem is i cannot use some other cm string this is the only one
i can use in my network.

Best regards

Bart





--
Met vriendelijke groet / With kind regards,

Bart



-- 
Met vriendelijke groet / With kind regards,

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


Current thread: