# snek-sploit
Python typed RPC client for Metasploit Framework.
![](logo.png)
## Installation
```shell
pip install snek-sploit
```
## Usage
```python
from snek_sploit import MetasploitClient
if __name__ == '__main__':
client = MetasploitClient("msf", "root")
print(client.core.rpc.version())
```
Examples can be found in the *[examples](https://github.com/SadParad1se/snek-sploit/tree/master/examples)* directory.
## Starting MSF RPC server
In Metasploit console:
```shell
load msgrpc ServerHost=127.0.0.1 ServerPort=55553 User=msf Pass='root' SSL=true
```
In shell:
```shell
msfrpcd -U msf -P root
```
With [Docker](https://docs.docker.com/engine/install/):
```shell
docker run --tty --network host --detach sadparad1se/metasploit-framework:rpc
```
With [Docker Compose](https://docs.docker.com/compose/install/):
```shell
git clone https://github.com/SadParad1se/snek-sploit.git
cd snek-sploit
docker compose up -d
```
You can find more information in the [Metasploit Framework documentation](https://docs.rapid7.com/metasploit/rpc-api/).
### Using the MSF RPC certificate
MSF RPC loads the SSL certificate by default from `/root/.msf4/msf-ws-cert.pem` (use the `-c` flag to choose a different location). If not, generate it as mentioned [here](https://github.com/rapid7/metasploit-framework/issues/15569#issuecomment-901158008).
To use it in the client, save it locally and pass the path:
```python
from snek_sploit import MetasploitClient
MetasploitClient("msf", "root", certificate="/path/to/cert.pem")
```
Raw data
{
"_id": null,
"home_page": "https://github.com/SadParad1se/snek-sploit",
"name": "snek-sploit",
"maintainer": "Ji\u0159\u00ed R\u00e1ja",
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": "jiri.raja@gmail.com",
"keywords": "metasploit, msf, rpc, client",
"author": "Ji\u0159\u00ed R\u00e1ja",
"author_email": "jiri.raja@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/5b/3f/2081fc8b8088aabcceaa4d06d119fc965e0142f2be8e69715d754d8ea6f3/snek_sploit-0.8.4.tar.gz",
"platform": null,
"description": "# snek-sploit\nPython typed RPC client for Metasploit Framework.\n\n![](logo.png)\n\n## Installation\n\n```shell\npip install snek-sploit\n```\n\n## Usage\n\n```python\nfrom snek_sploit import MetasploitClient\n\n\nif __name__ == '__main__':\n client = MetasploitClient(\"msf\", \"root\")\n print(client.core.rpc.version())\n\n```\n\nExamples can be found in the *[examples](https://github.com/SadParad1se/snek-sploit/tree/master/examples)* directory.\n\n## Starting MSF RPC server\nIn Metasploit console:\n```shell\nload msgrpc ServerHost=127.0.0.1 ServerPort=55553 User=msf Pass='root' SSL=true\n```\n\nIn shell:\n```shell\nmsfrpcd -U msf -P root\n```\n\nWith [Docker](https://docs.docker.com/engine/install/):\n```shell\ndocker run --tty --network host --detach sadparad1se/metasploit-framework:rpc\n```\n\nWith [Docker Compose](https://docs.docker.com/compose/install/):\n```shell\ngit clone https://github.com/SadParad1se/snek-sploit.git\ncd snek-sploit\ndocker compose up -d\n```\n\nYou can find more information in the [Metasploit Framework documentation](https://docs.rapid7.com/metasploit/rpc-api/).\n\n### Using the MSF RPC certificate\nMSF RPC loads the SSL certificate by default from `/root/.msf4/msf-ws-cert.pem` (use the `-c` flag to choose a different location). If not, generate it as mentioned [here](https://github.com/rapid7/metasploit-framework/issues/15569#issuecomment-901158008).\n\nTo use it in the client, save it locally and pass the path:\n```python\nfrom snek_sploit import MetasploitClient\n\n\nMetasploitClient(\"msf\", \"root\", certificate=\"/path/to/cert.pem\")\n\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python RPC client for Metasploit Framework",
"version": "0.8.4",
"project_urls": {
"Homepage": "https://github.com/SadParad1se/snek-sploit",
"Repository": "https://github.com/SadParad1se/snek-sploit"
},
"split_keywords": [
"metasploit",
" msf",
" rpc",
" client"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d8f288db3dd20d703fdfb4412c06ff82ff865b7977218c4c15b5c1b83112394e",
"md5": "be5f88140c925449cbf30e0c9d552764",
"sha256": "0a3543ea9f3d41bbfb5916d9dea6d5b727e8a3ff3b398f9f7a316089a6ce0b4e"
},
"downloads": -1,
"filename": "snek_sploit-0.8.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "be5f88140c925449cbf30e0c9d552764",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 28956,
"upload_time": "2024-07-18T17:26:40",
"upload_time_iso_8601": "2024-07-18T17:26:40.085523Z",
"url": "https://files.pythonhosted.org/packages/d8/f2/88db3dd20d703fdfb4412c06ff82ff865b7977218c4c15b5c1b83112394e/snek_sploit-0.8.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5b3f2081fc8b8088aabcceaa4d06d119fc965e0142f2be8e69715d754d8ea6f3",
"md5": "ea9554f63bf85e0137c0bd05f08d3719",
"sha256": "3b8d0f61bd3f386481a5833bcbca7b2da4db57a4eab779b0f32ec08a11b990ce"
},
"downloads": -1,
"filename": "snek_sploit-0.8.4.tar.gz",
"has_sig": false,
"md5_digest": "ea9554f63bf85e0137c0bd05f08d3719",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 22100,
"upload_time": "2024-07-18T17:26:41",
"upload_time_iso_8601": "2024-07-18T17:26:41.371591Z",
"url": "https://files.pythonhosted.org/packages/5b/3f/2081fc8b8088aabcceaa4d06d119fc965e0142f2be8e69715d754d8ea6f3/snek_sploit-0.8.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-18 17:26:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "SadParad1se",
"github_project": "snek-sploit",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "snek-sploit"
}