Skip to content

Commit 8814863

Browse files
committed
applied todbs snmp fixs for OSX https://dev.metasploit.com/redmine/issues/7480
added psProcessUsername MIB to snmp_enumusers - to enumerate users on Solaris Systems
1 parent 2fd7bcf commit 8814863

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lib/snmp/manager.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ def send(data, host, port, flags = 0)
6262
@socket.sendto(data, host, port, flags)
6363
rescue NoMethodError
6464
@socket.send(data, 0, host, port)
65+
rescue ::Errno::EISCONN
66+
@socket.close
67+
@socket = UDPSocket.open
68+
@socket.send(data,0,host,port)
6569
end
6670

6771
end

modules/auxiliary/scanner/snmp/snmp_enumusers.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Metasploit3 < Msf::Auxiliary
1414
def initialize
1515
super(
1616
'Name' => 'SNMP Windows Username Enumeration',
17-
'Description' => "This module will use LanManager OID values to enumerate local user accounts on a Windows system via SNMP",
17+
'Description' => "This module will use LanManager/psProcessUsername OID values to enumerate local user accounts on a Windows/Solaris system via SNMP",
1818
'Author' => ['tebo[at]attackresearch.com'],
1919
'License' => MSF_LICENSE
2020
)
@@ -35,6 +35,15 @@ def run_host(ip)
3535
print_good("#{ip} Found Users: #{@users.sort.join(", ")} ")
3636

3737
end
38+
if snmp.get_value('sysDescr.0') =~ /Sun/
39+
40+
@users = []
41+
snmp.walk("1.3.6.1.4.1.42.3.12.1.8") do |row|
42+
row.each { |val| @users << val.value.to_s }
43+
end
44+
45+
print_good("#{ip} Found Users: #{@users.sort.uniq.join(", ")} ")
46+
end
3847

3948
disconnect_snmp
4049

0 commit comments

Comments
 (0)