From 990db6086122bba2fa9ce3b573881d4735bc0159 Mon Sep 17 00:00:00 2001 From: jah Date: Thu, 6 Aug 2009 09:56:07 +0000 Subject: [PATCH] Prevent an error ocuring when --script-arg snmplist is not supplied. snmplist is not a required arg since a default list of community strings is provided. --- scripts/snmp-brute.nse | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/snmp-brute.nse b/scripts/snmp-brute.nse index c03d10ec6..fcc21c9f3 100644 --- a/scripts/snmp-brute.nse +++ b/scripts/snmp-brute.nse @@ -4,7 +4,7 @@ Attempts to find an SNMP community string by brute force guessing. -- 2008-07-03 --- --- @args snmpcommunity The SNMP community string to use. If supplied, this +-- @args snmpcommunity The SNMP community string to use. If not supplied, this -- script will not run. -- @args snmplist The filename of a list of community strings to try. @@ -45,7 +45,7 @@ action = function(host, port) local request = snmp.buildGetRequest({}, "1.3.6.1.2.1.1.3.0") - local commFile = nmap.fetchfile(nmap.registry.args.snmplist) + local commFile = nmap.registry.args.snmplist and nmap.fetchfile(nmap.registry.args.snmplist) local commTable -- fetch wordlist from file (from unpwdb-lib)