1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00
Commit Graph

46 Commits

Author SHA1 Message Date
dmiller
b2ebc18360 NSEdoc fixes 2025-03-13 18:13:21 +00:00
dmiller
82586d6327 Remove unused functions from snmp.lua 2024-11-12 20:05:58 +00:00
dmiller
fdf5a2d7e9 Configurable retries for snmp.lua 2024-11-12 20:05:57 +00:00
dmiller
10321be656 snmp.lua: add configurable timeout 2024-11-12 20:05:57 +00:00
dmiller
1a7a96274a Avoid format-string bugs. Fixes #2634 2023-07-20 17:24:16 +00:00
nnposter
e333addec4 Ability to set SNMP protocol version. Closes #1473 2020-10-09 02:43:26 +00:00
paulino
cdcf73c88b Reads version string from options. Fixes #1064. 2017-12-10 06:27:44 +00:00
dmiller
13d06eb738 Use creds username as SNMP community if no ':' indicates password. Fixes #862 2017-04-22 19:31:24 +00:00
dmiller
7e6146d4c5 Convert snmp.lua from bin to string packing 2017-03-29 21:12:42 +00:00
dmiller
877136858f Tag decoder stub for Report-PDU 2017-03-29 20:58:37 +00:00
dmiller
4cef14a873 Switch to string packing instead of bin packing and return order for asn1-related libs 2017-03-29 20:42:01 +00:00
dmiller
85e10c6b2b Use byte values instead of hex strings for ASN.1 types, avoiding upper/lower case mixups 2017-03-29 20:41:57 +00:00
dmiller
0073334d30 Fix snmp.lua after conversion to tohex instead of pack('H') changed hex to lowercase 2017-03-29 14:14:39 +00:00
dmiller
92f52de958 Remove trailing whitespace 2016-08-29 20:30:26 +00:00
dmiller
f4619edece Update http urls for nmap.org to https 2015-11-05 20:41:05 +00:00
gio
f893f2032b Fixes #122 SNMP library and scripts use creds library to handle community 2015-06-13 17:58:55 +00:00
gio
308c213099 NSE snmp manually rebase #122 provided patch 2015-06-13 17:58:49 +00:00
dmiller
c1b2429efd Remove some more creative ways of building a literal byte 2015-03-02 13:47:45 +00:00
batrick
ee6622aea4 nselib stdnse.print_debug -> stdnse.debug
$ f() { find -name \*.lua -exec /bin/echo sed -i "$1" {} \; ; }
$ f 's/stdnse.print_debug( *\([0-9]*\) *, */stdnse.debug\1(/'
$ f 's/stdnse.print_debug( *"\(.*\))/stdnse.debug1("\1)/'
2014-08-03 00:56:45 +00:00
dmiller
4cef3889f1 Remove unused and redundant snmp.dec function 2014-03-03 22:34:25 +00:00
dmiller
1b71f75aad Spelling fixes for Lua files
Mostly in documentation/comments, but a couple code bugs were caught,
including a call to stdnse.pirnt_debug and a mis-declared variable.
2014-02-19 04:15:46 +00:00
dmiller
961ea25225 Re-indent some NSE libraries.
https://secwiki.org/w/Nmap/Code_Standards
2014-02-03 19:47:34 +00:00
dmiller
620f9fdb34 Remove trailing whitespace in lua files
Whitespace is not significant, so this should not be a problem.
https://secwiki.org/w/Nmap/Code_Standards
2014-01-23 21:51:58 +00:00
jah
b1cd867212 Remove a fixed value (28428) which was being set for the Request ID in
snmpWalk; a value based on nmap.clock_ms will now be set instead.
2013-11-03 23:27:38 +00:00
david
aa6717eb1f Lua 5.2 fixed from Daniel Miller.
http://seclists.org/nmap-dev/2012/q2/525
2012-05-29 20:11:39 +00:00
batrick
000f6dc4d9 Lua 5.2 upgrade [1] for NSE.
[1] http://seclists.org/nmap-dev/2012/q2/34
2012-05-27 08:53:32 +00:00
patrik
068c6273ec o [NSE] Applied some code cleanup to the snmp library. [Brendan Byrd] 2011-12-25 20:48:17 +00:00
batrick
4444071f03 use # length operator instead of string.len (canonicalize)
Used this perl command:

$ # perl -pi -e 's/string\.len\((.*?)\)/#\1/g' *.lua

Also fixed one instance where the above command didn't correctly
translate the intended code (string.len(a .. b .. c)).
2011-05-11 15:08:55 +00:00
david
7d0c08a097 Brief copyediting of NSEDoc for modules. 2010-07-12 19:42:43 +00:00
patrik
112f8f5340 o [NSE] Added snmpWalk function to SNMP library and updated scripts to use it
[Patrik]
2010-04-12 10:30:24 +00:00
patrik
d2e54f0bf2 o [NSE] Added a new library for ASN.1 parsing and adapted the SNMP library to
make use of it. Added 5 scripts that use the new libraries:
  - snmp-netstat shows listening and connected sockets
  - snmp-processes shows process information including name, pid, path and 
    parameters
  - snmp-win32-services shows the names of running Windows services
  - snmp-win32-shares shows the names and path of Windows shares
  - snmp-win32-software shows a list of installed Windows software
  - snmp-win32-users shows a list of local Windows users
2010-02-16 09:15:38 +00:00
david
ac2cbcc97f Fix the decoding of OID component values greater than 127 in snmp.lua.
This is analogous to r16265, which did the same thing for encoding.
2010-01-19 23:45:58 +00:00
david
304762b07d Remove a function I accidentally duplicated in snmp.lua (encodeLength).
Reverse some byte strings after constructing them instead of building
the arrays from the front.
2009-12-14 01:03:53 +00:00
david
3f7be738ad Allow encoding OID component greater than 127 in snmp.lua. Previously
the code just took each value mod 256 and stored it as a single byte.
The OID 1.3.1000.5 would encode as follows

tag len 1.3 1000%256  5
 06  03  2b       e8 05

What you're supposed to do is break each value into 7-bit chunks, and
set the high bit in every octet but the last. Now it is correctly
encoded as

tag len 1.3 1000  5
 06  04  2b 8768 05

The length also would not have been correct for lengths over 127, and
that is fixed also.
2009-12-14 00:55:05 +00:00
batrick
90a712ae2b Patch to libraries that were inappropriately using globals.
Often two (or more) scripts using the same library would
overwrite the globals each was using. This would result
in (at best) an error or (at worst) a deadlock.

The patch changes the global accesses to local.
2009-07-07 00:20:52 +00:00
david
a384e9016f Document script arguments in
pop3-brute.nse: pop3loginmethod, userdb, passdb;
snmp-brute.nse: snmpcommunity, snmplist, userdb, passdb;
snmp-sysdecsr.nse: snmpcommunity;
snmp.lua: snmpcommunity;
unpwdb.lua: userdb, passdb.
2009-01-13 00:10:33 +00:00
fyodor
98d06c4b33 note snmpcommunity script argument name 2009-01-09 20:26:23 +00:00
david
af4497669b Proofread and update documentation of pop3, shortport, snmp, ssh1, ssh2,
strbuf, tab, unpwdb, and url.
2008-10-24 20:12:36 +00:00
david
3ee17ecb5c Fix NSEDoc error messages, except for some "documenting undefined parameter"
that happen when one function is defined to be another by assignment.
2008-10-24 17:05:40 +00:00
david
7e15f259a4 Standardize the @copyright fields of NSE modules; change "See nmaps COPYING for
license" to "Same as Nmap--See http://nmap.org/book/man-legal.html" like
scripts commonly use. I added the field to some modules I know to be under the
Nmap license: bin, datafiles, dns, nmap, unpwdb. I left alone bin, bit, pcre,
and url, which come from outside sources.
2008-10-24 00:44:22 +00:00
jah
eacb951209 Fixed typos for some nsedoc tag names:
INFO processing file `nselib/datafiles.lua'
ERROR undefined handler for tag `type'
INFO processing file `nselib/dns.lua'
ERROR undefined handler for tag `result'
ERROR undefined handler for tag `result'
INFO processing file `nselib/netbios.lua'
ERROR undefined handler for tag `returns'
INFO processing file `nselib/snmp.lua'
ERROR undefined handler for tag `result'
INFO processing file `scripts/SSLv2-support.nse'
ERROR undefined handler for tag `ouput'

Removed a @see tag which refers to Lua's string.format rather than to NSE docs:
INFO generating file `docs/modules/stdnse.html'
ERROR unresolved reference to symbol `string.format'
2008-10-18 20:49:00 +00:00
david
f58f559b81 Reformat and merge documentation for stdnse, shortport, strbuf, snmp, ssh1,
ssh2, smb, pop3, and msrpc.
2008-10-16 00:38:53 +00:00
batrick
462c289f4a Fixed all the modules to give a default name if absent.
Also necessary for the documentation system to know the name
of the module.
2008-08-16 04:20:15 +00:00
pgpickering
d6066bb332 fixed bug in snma.lua: fetchResponseValues(): wrong "local" when decoding 2008-08-02 10:40:03 +00:00
pgpickering
178a40f281 updated NSEDoc documentation for snmp.lua, pop3.lua, base64.lua 2008-08-01 20:33:56 +00:00
pgpickering
d769960f42 added snmp.lua 2008-07-31 22:51:34 +00:00