pymetasploit
Описание
Упрощённая версия PyMetasploit, работающая с Python3
Языки
- Python100%
Pymetasploit
A simplified version of the famous PyMetaSploit3, which implements the pure functionality of interacting with remote msfrpcd without using threads.
Installing
You can install the library as follow:
Or:
Usage
Firstly you need to start msfrpcd (like follow):
where:
- set the password-P secret;secret- listen port 55553;-p 55553- run listener in the foreground.-f
Now to connect to listener you need to create class:
This class supports following methods:
-
- Trying to login in msfrpcd;login() -
- Trying to remove login token in msfrpcd;logout() -
- Added token to msfrpcd as valid and use new token with requests;add_token(token) -
- Return all tokens that used in msfrpcd;token_list() -
: Delete specified token, stored in MsfRpcd server side;token_remove(token) -
- Create a new MetaSploit console and return them;create_console() -
- Return all consoles in msfrpcd;console_list() -
- Destroy console in msfrpcd by its id.destroy_console(console_id)
MetaSploit console can be created via method:
An MsfRpcConsole object has following methods:
-
- write data to console;write(data) -
- Return any output currently buffered by the console that has not already been read and returned it as binary string. Note that a newly allocated console will have the initial banner available to read. If console is already busy, this method set attributeread()asbusyin an instance of the class;True -
- Read data from the console as long as console is busy and returned it as binary string. If callback is notread_all(callback=None), call callback function on every call methodNone, that return a non-empty result;read -
- Delete a current running console instance.destroy
MetaSploit console we can also create via context manager: