# python-medusa
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/python-medusa)
![PyPI - Version](https://img.shields.io/pypi/v/python-medusa)
![PyPI - License](https://img.shields.io/pypi/l/python-medusa)
![PyPI - Format](https://img.shields.io/pypi/format/python-medusa)
![GitHub watchers](https://img.shields.io/github/watchers/hanxinkong/python-medusa)
![GitHub forks](https://img.shields.io/github/forks/hanxinkong/python-medusa)
![GitHub Repo stars](https://img.shields.io/github/stars/hanxinkong/python-medusa)
## 简介
python-medusa是一个闻名的爆破工具medusa的python库,可以帮助使用medusa进行端口爆破,希望能为使用者带来益处。如果您也想贡献好的代码片段,请将代码以及描述,通过邮箱( [xinkonghan@gmail.com](mailto:hanxinkong<xinkonghan@gmail.com>)
)发送给我。代码格式是遵循自我主观,如存在不足敬请指出!
----
**文档地址:
** <a href="https://python-medusa.xink.top/" target="_blank">https://python-medusa.xink.top/ </a>
**PyPi地址:
** <a href="https://pypi.org/project/python-medusa" target="_blank">https://pypi.org/project/python-medusa </a>
**GitHub地址:
** [https://github.com/hanxinkong/python-medusa](https://github.com/hanxinkong/python-medusa)
----
## 安装
<div class="termy">
```console
pip install python-medusa
```
</div>
## 支持的协议 (不完全统计)
* AFP
* CVS
* FTP
* HTTP
* IMAP
* MS-SQL
* MySQL
* NCP (NetWare)
* NNTP
* PcAnywhere
* POP3
* PostgreSQL
* rexec
* rlogin
* rsh
* SMB
* SMTP (AUTH/VRFY)
* SNMP
* SSH
* SSHv2
* Telnet
* VmAuthd
* VNC
## 简单使用
✨在使用之前,请确保已安装`medusa`应用程序
```python
from medusa import PortBlaster
mds = PortBlaster()
print("medusa version:", mds.medusa_version)
mds.brute(
hosts='192.168.2.185',
ports='22',
user='root',
password='root',
arguments='-M ssh',
isfile_hosts=False,
isfile_user=False,
isfile_password=False
)
print("medusa command line:", mds.command_line)
print(mds.get_medusa_last_output)
# print('medusa bruteinfo: ', mds.bruteinfo)
# print('medusa brutestats: ', mds.brutestats)
for host in mds.all_hosts:
print("Host: %s (%s)" % (host, mds[host]))
```
参数说明
| 字段名 | 类型 | 必须 | 描述 |
|-----------------|---------|----|-----------------------|
| hosts | string | 是 | 主机,可多个(用,号分隔) |
| ports | string | 否 | 端口,可多个(23,80,666-777) |
| user | string | 否 | 用户(默认:root) |
| password | string | 否 | 密码(默认:root) |
| arguments | string | 否 | 附加参数(详见附加参数说明) |
| isfile_hosts | boolean | 否 | 主机从文件导入,可多个(每行为一个) |
| isfile_user | boolean | 否 | 用户从文件导入,可多个(每行为一个) |
| isfile_password | boolean | 否 | 密码从文件导入,可多个(每行为一个) |
附加参数说明
```shell
-O [FILE] 指定成功后文件日志信息路径
-e [n/s/ns] N意为空密码,S意为密码与用户名相同
-M [TEXT] 模块执行名称
-m [TEXT] 传递参数到模块
-d 显示所有的模块名称
-n [NUM] 使用非默认端口
-s 启用SSL
-r [NUM] 重试间隔时间,默认为3秒
-t [NUM] 设定线程数量
-L 并行化,每个用户使用一个线程
-f 在任何主机上找到第一个账号/密码后,停止破解
-q 显示模块的使用信息
-v [NUM] 详细级别(0-6)
-w [NUM] 错误调试级别(0-10)
-V 显示版本
-Z [TEXT] 继续扫描上一次
```
## 依赖
内置依赖
- `re` Type Hints for Python.
- `os` Type Hints for Python.
- `shlex` Type Hints for Python.
- `subprocess` Type Hints for Python.
- `sys` Type Hints for Python.
- `json` Type Hints for Python.
_注:依赖顺序排名不分先后_
## 链接
Github:https://github.com/hanxinkong/python-medusa
在线文档:https://python-medusa.xink.top
## 贡献者
## 许可证
该项目根据 **MIT** 许可条款获得许可.
## 免责声明
1. 若使用者滥用本项目,本人 **无需承担** 任何法律责任.
2. 本程序仅供娱乐,源码全部开源,**禁止滥用** 和二次 **贩卖盈利**. **禁止用于商业用途**.
Raw data
{
"_id": null,
"home_page": "https://python-medusa.xink.top/",
"name": "python-medusa",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "boom,medusa,tool,blast,attack,port",
"author": "hanxinkong",
"author_email": "xinkonghan@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/8f/72/17b175470043f8c862e1c42d7f16795e9fa6a561a581f7e43bef3b6ab8bc/python-medusa-1.0.1.tar.gz",
"platform": null,
"description": "# python-medusa\r\n\r\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/python-medusa)\r\n![PyPI - Version](https://img.shields.io/pypi/v/python-medusa)\r\n![PyPI - License](https://img.shields.io/pypi/l/python-medusa)\r\n![PyPI - Format](https://img.shields.io/pypi/format/python-medusa)\r\n![GitHub watchers](https://img.shields.io/github/watchers/hanxinkong/python-medusa)\r\n![GitHub forks](https://img.shields.io/github/forks/hanxinkong/python-medusa)\r\n![GitHub Repo stars](https://img.shields.io/github/stars/hanxinkong/python-medusa)\r\n\r\n## \u7b80\u4ecb\r\n\r\npython-medusa\u662f\u4e00\u4e2a\u95fb\u540d\u7684\u7206\u7834\u5de5\u5177medusa\u7684python\u5e93,\u53ef\u4ee5\u5e2e\u52a9\u4f7f\u7528medusa\u8fdb\u884c\u7aef\u53e3\u7206\u7834\uff0c\u5e0c\u671b\u80fd\u4e3a\u4f7f\u7528\u8005\u5e26\u6765\u76ca\u5904\u3002\u5982\u679c\u60a8\u4e5f\u60f3\u8d21\u732e\u597d\u7684\u4ee3\u7801\u7247\u6bb5\uff0c\u8bf7\u5c06\u4ee3\u7801\u4ee5\u53ca\u63cf\u8ff0\uff0c\u901a\u8fc7\u90ae\u7bb1\uff08 [xinkonghan@gmail.com](mailto:hanxinkong<xinkonghan@gmail.com>)\r\n\uff09\u53d1\u9001\u7ed9\u6211\u3002\u4ee3\u7801\u683c\u5f0f\u662f\u9075\u5faa\u81ea\u6211\u4e3b\u89c2\uff0c\u5982\u5b58\u5728\u4e0d\u8db3\u656c\u8bf7\u6307\u51fa\uff01\r\n\r\n----\r\n**\u6587\u6863\u5730\u5740\uff1a\r\n** <a href=\"https://python-medusa.xink.top/\" target=\"_blank\">https://python-medusa.xink.top/ </a>\r\n\r\n**PyPi\u5730\u5740\uff1a\r\n** <a href=\"https://pypi.org/project/python-medusa\" target=\"_blank\">https://pypi.org/project/python-medusa </a>\r\n\r\n**GitHub\u5730\u5740\uff1a\r\n** [https://github.com/hanxinkong/python-medusa](https://github.com/hanxinkong/python-medusa)\r\n\r\n----\r\n\r\n## \u5b89\u88c5\r\n\r\n<div class=\"termy\">\r\n\r\n```console\r\npip install python-medusa\r\n```\r\n\r\n</div>\r\n\r\n## \u652f\u6301\u7684\u534f\u8bae (\u4e0d\u5b8c\u5168\u7edf\u8ba1)\r\n\r\n* AFP\r\n* CVS\r\n* FTP\r\n* HTTP\r\n* IMAP\r\n* MS-SQL\r\n* MySQL\r\n* NCP (NetWare)\r\n* NNTP\r\n* PcAnywhere\r\n* POP3\r\n* PostgreSQL\r\n* rexec\r\n* rlogin\r\n* rsh\r\n* SMB\r\n* SMTP (AUTH/VRFY)\r\n* SNMP\r\n* SSH\r\n* SSHv2\r\n* Telnet\r\n* VmAuthd\r\n* VNC\r\n\r\n## \u7b80\u5355\u4f7f\u7528\r\n\r\n\u2728\u5728\u4f7f\u7528\u4e4b\u524d,\u8bf7\u786e\u4fdd\u5df2\u5b89\u88c5`medusa`\u5e94\u7528\u7a0b\u5e8f\r\n\r\n```python\r\nfrom medusa import PortBlaster\r\n\r\nmds = PortBlaster()\r\nprint(\"medusa version:\", mds.medusa_version)\r\nmds.brute(\r\n hosts='192.168.2.185',\r\n ports='22',\r\n user='root',\r\n password='root',\r\n arguments='-M ssh',\r\n isfile_hosts=False,\r\n isfile_user=False,\r\n isfile_password=False\r\n)\r\nprint(\"medusa command line:\", mds.command_line)\r\nprint(mds.get_medusa_last_output)\r\n# print('medusa bruteinfo: ', mds.bruteinfo)\r\n# print('medusa brutestats: ', mds.brutestats)\r\n\r\nfor host in mds.all_hosts:\r\n print(\"Host: %s (%s)\" % (host, mds[host]))\r\n```\r\n\r\n\u53c2\u6570\u8bf4\u660e\r\n\r\n| \u5b57\u6bb5\u540d | \u7c7b\u578b | \u5fc5\u987b | \u63cf\u8ff0 |\r\n|-----------------|---------|----|-----------------------|\r\n| hosts | string | \u662f | \u4e3b\u673a,\u53ef\u591a\u4e2a\uff08\u7528,\u53f7\u5206\u9694\uff09 |\r\n| ports | string | \u5426 | \u7aef\u53e3,\u53ef\u591a\u4e2a\uff0823,80,666-777\uff09 |\r\n| user | string | \u5426 | \u7528\u6237\uff08\u9ed8\u8ba4\uff1aroot\uff09 |\r\n| password | string | \u5426 | \u5bc6\u7801\uff08\u9ed8\u8ba4\uff1aroot\uff09 |\r\n| arguments | string | \u5426 | \u9644\u52a0\u53c2\u6570\uff08\u8be6\u89c1\u9644\u52a0\u53c2\u6570\u8bf4\u660e\uff09 |\r\n| isfile_hosts | boolean | \u5426 | \u4e3b\u673a\u4ece\u6587\u4ef6\u5bfc\u5165,\u53ef\u591a\u4e2a\uff08\u6bcf\u884c\u4e3a\u4e00\u4e2a\uff09 |\r\n| isfile_user | boolean | \u5426 | \u7528\u6237\u4ece\u6587\u4ef6\u5bfc\u5165,\u53ef\u591a\u4e2a\uff08\u6bcf\u884c\u4e3a\u4e00\u4e2a\uff09 |\r\n| isfile_password | boolean | \u5426 | \u5bc6\u7801\u4ece\u6587\u4ef6\u5bfc\u5165,\u53ef\u591a\u4e2a\uff08\u6bcf\u884c\u4e3a\u4e00\u4e2a\uff09 |\r\n\r\n\u9644\u52a0\u53c2\u6570\u8bf4\u660e\r\n\r\n```shell\r\n-O [FILE] \u6307\u5b9a\u6210\u529f\u540e\u6587\u4ef6\u65e5\u5fd7\u4fe1\u606f\u8def\u5f84\r\n-e [n/s/ns] N\u610f\u4e3a\u7a7a\u5bc6\u7801\uff0cS\u610f\u4e3a\u5bc6\u7801\u4e0e\u7528\u6237\u540d\u76f8\u540c\r\n-M [TEXT] \u6a21\u5757\u6267\u884c\u540d\u79f0\r\n-m [TEXT] \u4f20\u9012\u53c2\u6570\u5230\u6a21\u5757\r\n-d \u663e\u793a\u6240\u6709\u7684\u6a21\u5757\u540d\u79f0\r\n-n [NUM] \u4f7f\u7528\u975e\u9ed8\u8ba4\u7aef\u53e3\r\n-s \u542f\u7528SSL\r\n-r [NUM] \u91cd\u8bd5\u95f4\u9694\u65f6\u95f4\uff0c\u9ed8\u8ba4\u4e3a3\u79d2\r\n-t [NUM] \u8bbe\u5b9a\u7ebf\u7a0b\u6570\u91cf\r\n-L \u5e76\u884c\u5316\uff0c\u6bcf\u4e2a\u7528\u6237\u4f7f\u7528\u4e00\u4e2a\u7ebf\u7a0b\r\n-f \u5728\u4efb\u4f55\u4e3b\u673a\u4e0a\u627e\u5230\u7b2c\u4e00\u4e2a\u8d26\u53f7/\u5bc6\u7801\u540e\uff0c\u505c\u6b62\u7834\u89e3\r\n-q \u663e\u793a\u6a21\u5757\u7684\u4f7f\u7528\u4fe1\u606f\r\n-v [NUM] \u8be6\u7ec6\u7ea7\u522b\uff080-6\uff09\r\n-w [NUM] \u9519\u8bef\u8c03\u8bd5\u7ea7\u522b\uff080-10\uff09\r\n-V \u663e\u793a\u7248\u672c\r\n-Z [TEXT] \u7ee7\u7eed\u626b\u63cf\u4e0a\u4e00\u6b21\r\n```\r\n\r\n## \u4f9d\u8d56\r\n\r\n\u5185\u7f6e\u4f9d\u8d56\r\n\r\n- `re` Type Hints for Python.\r\n- `os` Type Hints for Python.\r\n- `shlex` Type Hints for Python.\r\n- `subprocess` Type Hints for Python.\r\n- `sys` Type Hints for Python.\r\n- `json` Type Hints for Python.\r\n\r\n_\u6ce8\uff1a\u4f9d\u8d56\u987a\u5e8f\u6392\u540d\u4e0d\u5206\u5148\u540e_\r\n\r\n## \u94fe\u63a5\r\n\r\nGithub\uff1ahttps://github.com/hanxinkong/python-medusa\r\n\r\n\u5728\u7ebf\u6587\u6863\uff1ahttps://python-medusa.xink.top\r\n\r\n## \u8d21\u732e\u8005\r\n\r\n## \u8bb8\u53ef\u8bc1\r\n\r\n\u8be5\u9879\u76ee\u6839\u636e **MIT** \u8bb8\u53ef\u6761\u6b3e\u83b7\u5f97\u8bb8\u53ef.\r\n\r\n## \u514d\u8d23\u58f0\u660e\r\n\r\n1. \u82e5\u4f7f\u7528\u8005\u6ee5\u7528\u672c\u9879\u76ee,\u672c\u4eba **\u65e0\u9700\u627f\u62c5** \u4efb\u4f55\u6cd5\u5f8b\u8d23\u4efb.\r\n2. \u672c\u7a0b\u5e8f\u4ec5\u4f9b\u5a31\u4e50,\u6e90\u7801\u5168\u90e8\u5f00\u6e90,**\u7981\u6b62\u6ee5\u7528** \u548c\u4e8c\u6b21 **\u8d29\u5356\u76c8\u5229**. **\u7981\u6b62\u7528\u4e8e\u5546\u4e1a\u7528\u9014**.\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "python-medusa\u662f\u4e00\u4e2a\u95fb\u540d\u7684\u7206\u7834\u5de5\u5177medusa\u7684python\u5e93,\u53ef\u4ee5\u5e2e\u52a9\u4f7f\u7528medusa\u8fdb\u884c\u7aef\u53e3\u7206\u7834",
"version": "1.0.1",
"project_urls": {
"Homepage": "https://python-medusa.xink.top/"
},
"split_keywords": [
"boom",
"medusa",
"tool",
"blast",
"attack",
"port"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9f41bf38904f4a2445accde1fc62593801c13d7cc64c57c87893777fabc1238f",
"md5": "1ccca72713570f36eb94b3dbac6be733",
"sha256": "fe6c6d4d06ead290b203f382cf79975550fbb21bd13d4bf4fd0b010213b1a309"
},
"downloads": -1,
"filename": "python_medusa-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1ccca72713570f36eb94b3dbac6be733",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 8313,
"upload_time": "2023-09-10T07:21:51",
"upload_time_iso_8601": "2023-09-10T07:21:51.492601Z",
"url": "https://files.pythonhosted.org/packages/9f/41/bf38904f4a2445accde1fc62593801c13d7cc64c57c87893777fabc1238f/python_medusa-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8f7217b175470043f8c862e1c42d7f16795e9fa6a561a581f7e43bef3b6ab8bc",
"md5": "56abfd4c7ae351f9084584eda292e197",
"sha256": "689414d6a6f0521b055057698b9de116e4e2cc0d97a490b4994c9d3623518edf"
},
"downloads": -1,
"filename": "python-medusa-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "56abfd4c7ae351f9084584eda292e197",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8964,
"upload_time": "2023-09-10T07:21:53",
"upload_time_iso_8601": "2023-09-10T07:21:53.552800Z",
"url": "https://files.pythonhosted.org/packages/8f/72/17b175470043f8c862e1c42d7f16795e9fa6a561a581f7e43bef3b6ab8bc/python-medusa-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-10 07:21:53",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "python-medusa"
}