Nmap Development mailing list archives

Re: NSE SNMPv1 Library


From: "Michal Szczesny" <athanor () wp pl>
Date: Thu, 26 Nov 2009 21:27:16 +0100

Dnia 26-11-2009 o godz. 20:45 David Fifield napisaƂ(a):
On Tue, Nov 24, 2009 at 01:19:33AM -0800, Michal Szczesny wrote:
Hi,
I tried to query different OIDs with the sysdecr.nse and I've noticed
that it is not returning any date when the OID in question points to
Object Identifier type value, like for example: 1.3.6.1.2.1.1.2.0
(sysObjectID).

I have no problems with quering OIDs where Type is String or Integer.

I had a look into snmp.lua library but it's well over my head to analyze
code there.

Could someone test querying OID type values with by

snmp.encode(snmp.buildPacket(snmp.buildGetRequest({},
"1.3.6.1.2.1.1.2.0"))) ?

Maybe I should decode the reponse in different way, now I just using:

status, response = socket:receive_bytes(1)

local sysObjectId = snmp.fetchFirst(response)

What is the value of the sysObjectId after running that code? Is it nil
or something else? Try

print(tostring(sysObjectId))

Can you tell if the remote host is sending anything back in response to
the query?

David Fifield

Hi David,

Well in the end I had a look into that scary snmp.lua library :) and the 
answer was there.
I was not decoding result as I should :

result = snmp.fetchFirst(response) and then:

sysObjectId = snmp.oid2str(result)

and magically we have OID as a value ...

----------------------------------------------------
Hamlet w kopalni, David Lynch w Katowicach. 
Festiwal Ars Cameralis Filmy, fotografie, litografie Davida Lyncha.
Twin Peaks, Yo La Tengo. wwW.cameralis.art.pl, 
http://klik.wp.pl/?adr=http%3A%2F%2Fcorto.www.wp.pl%2Fas%2Fms_dm_Koncert-Twin-Peaks_241109.html&sid=921


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


Current thread: