Commit 2ee74604 by dark-lbp Committed by Marcin Bury

Make snmp_bruteforce support snmp v1 (#278)

parent 9a2d0aa4
...@@ -36,6 +36,7 @@ class Exploit(exploits.Exploit): ...@@ -36,6 +36,7 @@ class Exploit(exploits.Exploit):
target = exploits.Option('', 'Target IP address or file with target:port (file://)') target = exploits.Option('', 'Target IP address or file with target:port (file://)')
port = exploits.Option(161, 'Target port') port = exploits.Option(161, 'Target port')
version = exploits.Option(1, 'Snmp version 0:v1, 1:v2c')
threads = exploits.Option(8, 'Number of threads') threads = exploits.Option(8, 'Number of threads')
snmp = exploits.Option(wordlists.snmp, 'Community string or file with community strings (file://)') snmp = exploits.Option(wordlists.snmp, 'Community string or file with community strings (file://)')
verbosity = exploits.Option('yes', 'Display authentication attempts') verbosity = exploits.Option('yes', 'Display authentication attempts')
...@@ -78,7 +79,7 @@ class Exploit(exploits.Exploit): ...@@ -78,7 +79,7 @@ class Exploit(exploits.Exploit):
string = data.next().strip() string = data.next().strip()
errorIndication, errorStatus, errorIndex, varBinds = cmdGen.getCmd( errorIndication, errorStatus, errorIndex, varBinds = cmdGen.getCmd(
cmdgen.CommunityData(string), cmdgen.CommunityData(string, mpModel=int(self.version)),
cmdgen.UdpTransportTarget((self.target, int(self.port))), cmdgen.UdpTransportTarget((self.target, int(self.port))),
'1.3.6.1.2.1.1.1.0', '1.3.6.1.2.1.1.1.0',
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment