Skip to content

Commit

Permalink
Allow selection of "TCP" for SNMP packets
Browse files Browse the repository at this point in the history
  • Loading branch information
nrathaus committed Apr 8, 2024
1 parent 01d3161 commit bf489f0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/auxiliary/scanner/snmp/snmp_login.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def initialize
register_options(
[
Opt::RPORT(161),
OptEnum.new('PROTOCOL', [true, 'The SNMP protocol to use', 'udp', ['udp', 'tcp']]),
OptEnum.new('VERSION', [true, 'The SNMP version to scan', '1', ['1', '2c', 'all']]),
OptString.new('PASSWORD', [ false, 'The password to test' ]),
OptPath.new('PASS_FILE', [ false, "File containing communities, one per line",
Expand All @@ -51,6 +52,7 @@ def run_host(ip)
scanner = Metasploit::Framework::LoginScanner::SNMP.new(
host: ip,
port: rport,
protocol: datastore['PROTOCOL'],
cred_details: collection,
stop_on_success: datastore['STOP_ON_SUCCESS'],
bruteforce_speed: datastore['BRUTEFORCE_SPEED'],
Expand Down Expand Up @@ -91,6 +93,10 @@ def rport
datastore['RPORT']
end

def protocol
datastore['PROTOCOL']
end




Expand Down

0 comments on commit bf489f0

Please sign in to comment.