diff --git a/beef.db b/beef.db index 84024285d..d6c01d842 100644 Binary files a/beef.db and b/beef.db differ diff --git a/lib/loader.rb b/lib/loader.rb index ce0f008cf..8e5a7c519 100644 --- a/lib/loader.rb +++ b/lib/loader.rb @@ -10,6 +10,7 @@ require 'parseconfig' require 'singleton' require 'ipaddr' require 'base64' +require 'xmlrpc/client' require 'lib/patches/webrick/httprequest' require 'lib/patches/webrick/cookie' diff --git a/lib/modules/msfclient.rb b/lib/modules/msfclient.rb index 9c7a4652a..d7787e2d2 100644 --- a/lib/modules/msfclient.rb +++ b/lib/modules/msfclient.rb @@ -1,29 +1,31 @@ -require "xmlrpc/client" - module BeEF - + + # + # XML RPC Client for Metasploit + # class MsfClient < ::XMLRPC::Client attr_accessor :token - + + # login into metasploit def login(user,pass) res = self.call("auth.login", user, pass) - if(not (res and res['result'] == "success")) - raise RuntimeError, "MSF Authentication failed" - end + if(not (res and res['result'] == "success")) raise RuntimeError, "MSF Authentication failed" self.token = res['token'] + true end - + + # sends commands to the metasploit xml rpc server def call(meth, *args) if(meth != "auth.login") - if(not self.token) - raise RuntimeError, "client not authenticated" - end + if(not self.token) raise RuntimeError, "client not authenticated" args.unshift(self.token) end + super(meth, *args) end end + end