allfro / pymetasploit

A full-fledged msfrpc library for Metasploit framework.
297 stars 141 forks source link

use load #12

Open franchuk82 opened 6 years ago

franchuk82 commented 6 years ago

Hi, how i can use load function (Load a framework plugin)? for example: load wmap

and then i would to use wmap!!!

reeteshranjan commented 6 years ago

I tried client.plugins.load('sqlmap') to load the sqlmap plugin; however, it fails with an error like this:

In [5]: client.plugins.load('sqlmap')
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-1b1c8fdcedfd> in <module>()
----> 1 client.plugins.load('sqlmap')

/home/kaliuser/.virtualenvs/pentestsrv/local/lib/python2.7/site-packages/metasploit/msfrpc.pyc in load(self, plugin)
   1189         - plugin : a name of a plugin to load.
   1190         """
-> 1191         self.rpc.call(MsfRpcMethod, MsfRpcMethod.PluginLoad, plugin)
   1192
   1193     def unload(self, plugin):

/home/kaliuser/.virtualenvs/pentestsrv/local/lib/python2.7/site-packages/metasploit/msfrpc.pyc in call(self, method, *args)
    229         elif self.authenticated:
    230             l.insert(1, self.sessionid)
--> 231             self.client.request('POST', self.uri, packb(l), self._headers)
    232             r = self.client.getresponse()
    233             if r.status == 200:

/home/kaliuser/.virtualenvs/pentestsrv/local/lib/python2.7/site-packages/msgpack/__init__.pyc in packb(o, **kwargs)
     45     See :class:`Packer` for options.
     46     """
---> 47     return Packer(**kwargs).pack(o)
     48
     49 # alias for compatibility to simplejson/marshal/pickle.

msgpack/_packer.pyx in msgpack._packer.Packer.pack (msgpack/_packer.cpp:3661)()

msgpack/_packer.pyx in msgpack._packer.Packer.pack (msgpack/_packer.cpp:3503)()

msgpack/_packer.pyx in msgpack._packer.Packer._pack (msgpack/_packer.cpp:3230)()

msgpack/_packer.pyx in msgpack._packer.Packer._pack (msgpack/_packer.cpp:3382)()

TypeError: can't serialize <class 'metasploit.msfrpc.MsfRpcMethod'>

Not sure how stable this feature is.