diff --git a/extensions/metasploit/config.yaml b/extensions/metasploit/config.yaml index 4841db1df..67518feb3 100644 --- a/extensions/metasploit/config.yaml +++ b/extensions/metasploit/config.yaml @@ -8,9 +8,10 @@ beef: extension: metasploit: enable: true - host: "192.168.84.1" + host: "127.0.0.1" path: "/RPC2" port: 55553 user: "msf" pass: "abc123" callback_host: "192.168.84.1" + autopwn_url: "autopwn" diff --git a/extensions/metasploit/dbmigration.rb b/extensions/metasploit/dbmigration.rb index f9c2f69cd..c5bad97aa 100644 --- a/extensions/metasploit/dbmigration.rb +++ b/extensions/metasploit/dbmigration.rb @@ -68,6 +68,8 @@ module Metasploit puts e.message puts e.backtrace end + msf.launch_autopwn() + }#thread end end end @@ -76,4 +78,4 @@ module Metasploit end end -end \ No newline at end of file +end diff --git a/extensions/metasploit/rpcclient.rb b/extensions/metasploit/rpcclient.rb index d6469f69a..2f99b122e 100644 --- a/extensions/metasploit/rpcclient.rb +++ b/extensions/metasploit/rpcclient.rb @@ -20,6 +20,7 @@ module Metasploit port = @config.get('beef.extension.metasploit.port') @un = @config.get('beef.extension.metasploit.user') @pw = @config.get('beef.extension.metasploit.pass') + @apurl = @config.get('beef.extension.metasploit.autopwn_url') || "autopwn" @lock = false if(not host or not path or not port or not @un or not @pw) @@ -188,6 +189,24 @@ module Metasploit res['uri'] = uri res end + + def launch_autopwn + return if not @enabled + opts = { + 'LHOST' => @config.get('beef.extension.metasploit.callback_host') , + 'URIPATH' => @apurl + } + get_lock() + begin + res = self.call('module.execute','auxiliary','server/browser_autopwn',opts) + rescue Exception => e + print_error "Failed to launch autopwn\n" + release_lock() + return false + end + release_lock() + + end end