Package core :: Package controllers :: Package vdaemon :: Module vdaemon :: Class vdaemon
[hide private]
[frames] | no frames]

Class vdaemon




This class represents a virtual daemon, a point of entry for metasploit plugins to exploit. This class should be subclassed into winVd and lnxVd, each implementing a different way of sending the metasploit shellcode to the remote web server.


Author: Andres Riancho ( andres.riancho@gmail.com )

Instance Methods [hide private]
  __init__(self, execMethod)
  _dump(self, src, length=20)
prints a hexString
  _exec(self, command)
A wrapper for executing commands
  _execShellcode(self)
This method should be implemented according to the remote operating system.
  _generateExe(self, shellcode)
This method should be implemented according to the remote operating system.
  _handleMetasploit(self, clientsocket, address)
Handles a metasploit plugin sending the payload to the virtual server.
  _sendExeToServer(self, exeFile)
This method should be implemented according to the remote operating system.
  _sendToMSF(self, msg)
  getIPAddress(self)
  run(self)
This is the main loop.
  setListenPort(self, port)
  setRemoteIP(self, ip)
  stop(self)
w3af w3afThreads MUST implment a stop method.

Inherited from threads.w3afThread.w3afThread: start2

Inherited from threading.Thread: __repr__, getName, isAlive, isDaemon, join, setDaemon, setName, start

Inherited from threading.Thread (private): _set_daemon

Inherited from threading._Verbose (private): _note

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, execMethod)
(Constructor)

 
None
Overrides: threads.w3afThread.w3afThread.__init__

_dump(self, src, length=20)

 
prints a hexString

_exec(self, command)

 
A wrapper for executing commands

_execShellcode(self)

 

This method should be implemented according to the remote operating system. The idea here is to execute the payload that was sent using _sendExeToServer and generated by _generateExe . In lnxVd I should run "chmod +x file; ./file"

This method should be implemented in winVd and lnxVd.

_generateExe(self, shellcode)

 

This method should be implemented according to the remote operating system. The idea here is to generate an ELF/PE file and return a string that represents it.

This method should be implemented in winVd and lnxVd.

_handleMetasploit(self, clientsocket, address)

 
Handles a metasploit plugin sending the payload to the virtual server.

_sendExeToServer(self, exeFile)

 

This method should be implemented according to the remote operating system. The idea here is to send the exeFile to the remote server and save it in a file.

This method should be implemented in winVd and lnxVd.

_sendToMSF(self, msg)

 
None

getIPAddress(self)

 
None

run(self)

 
This is the main loop.
Overrides: threads.w3afThread.w3afThread.run

setListenPort(self, port)

 
None

setRemoteIP(self, ip)

 
None

stop(self)

 
w3af w3afThreads MUST implment a stop method.
Overrides: threads.w3afThread.w3afThread.stop
(inherited documentation)