Added msf xmlrpc client

git-svn-id: https://beef.googlecode.com/svn/trunk@509 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
sussurro@happypacket.net
2010-11-12 00:12:05 +00:00
parent a99fc10deb
commit 4d172c2f64

29
lib/modules/msfclient.rb Normal file
View File

@@ -0,0 +1,29 @@
require "xmlrpc/client"
module BeEF
class MsfClient < ::XMLRPC::Client
attr_accessor :token
def login(user,pass)
res = self.call("auth.login", user, pass)
if(not (res and res['result'] == "success"))
raise RuntimeError, "MSF Authentication failed"
end
self.token = res['token']
true
end
def call(meth, *args)
if(meth != "auth.login")
if(not self.token)
raise RuntimeError, "client not authenticated"
end
args.unshift(self.token)
end
super(meth, *args)
end
end
end