Resolve hosts for tortoisesvn module reporting

report_host() does not expect a DNS name, but an IPv4 or IPv6 address.
In many cases, an SVN password is going to be associated with only a
hostname.

This may be a bug in report_host -- it's certainly inconveninent.
However, we don't usually wnat report_host to be making tons of DNS
lookups when importing hosts, so this forced step is likely intended.

Also, begin/rescue/end blocks that don't hint at what errors are
intended to be caught are rarely a good idea, so this at least informs
the user which exception was raised.
unstable
Tod Beardsley 2012-06-21 11:47:37 -05:00
parent b9a2c88733
commit c795c2e438
1 changed files with 4 additions and 2 deletions

View File

@ -109,7 +109,8 @@ class Metasploit3 < Msf::Post
next if file_name == "." or file_name == ".."
savedpwds = analyze_file(path+file_name)
end
rescue
rescue => e
print_error "Exception raised: #{e.message}"
print_status("No configuration files located: TortoiseSVN may not be installed or configured.")
return
end
@ -176,13 +177,14 @@ class Metasploit3 < Msf::Post
source_id = nil
end
report_auth_info(
:host => host,
:host => ::Rex::Socket.resolv_to_dotted(host), # XXX: Workaround for unresolved hostnames
:port => portnum,
:sname => sname,
:source_id => source_id,
:source_type => "exploit",
:user => user_name,
:pass => password)
print_debug "Should have reported..."
# Set savedpwds to 1 on return
return 1