☰
RedTiger-Tools插件开发教程:3步创建并发布你自己的插件(附示例代码)
2026/10/30 4:32:26 网站建设 项目流程

【免费下载链接】RedTiger-Tools

RedTiger-Tools is a multifunction automation tool dedicated to pentesting and OSINT. The project is open source and designed to be fully configurable according to user needs. It also includes a plugin system that allows users to extend or create new features, in order to centralize multiple tools into a single unified platform.

项目地址:https://gitcode.com/gh_mirrors/red/RedTiger-Tools
点击查看免费下载

RedTiger-Tools 是一款面向渗透测试(Pentesting)与开源情报收集(OSINT)的多功能开源自动化工具,高度可配置,并内置强大的插件系统——只需把你的 Python 脚本放进Plugins目录,它就能自动出现在主菜单和命令行中。这篇 RedTiger-Tools 插件开发教程带你用 3 步完成:看懂插件规范、写出第一个插件、测试并发布,全程附带示例代码。

01 准备工作:环境安装与项目结构速览

开始写插件前,先确保工具能跑起来:

git clone https://gitcode.com/gh_mirrors/red/RedTiger-Tools cd RedTiger-Tools python setup.py # Windows python3 setup.py # Linux(自动安装 requirements.txt 中的依赖)

接下来认识 4 个与插件开发直接相关的文件:

文件/目录作用
redtiger.py主入口,InjectPlugins函数负责扫描并注册插件
Plugins/插件目录,放入任何.py文件都会被自动加载
Plugins/Example.py官方示例插件,最好的起点
Config/Utils.py公共工具函数:Info()、Input()、Error()、Title()等

02 第一步:看懂插件规范——只需一个 Register() 函数

打开 Plugins/Example.py,你会发现 RedTiger-Tools 插件的约定非常简洁:

  1. 每个插件文件必须定义一个Register()函数,返回一个字典;
  2. 字典包含 4 个键:name(菜单显示名)、description(菜单描述)、function(实际执行的函数)、arguments(CLI 参数定义,可留空);
  3. 主程序 redtiger.py 启动时会遍历Plugins目录(跳过Example.py),凡是能成功调用Register()的模块都会被注入菜单,分类固定为Plugins,同时自动生成命令行参数(如--my-first-plugin)。

一句话总结:插件 =Register()注册信息 +Run()执行逻辑。

03 第二步:写出你的第一个插件(附示例代码)

参考 Plugins/Example.py,在Plugins/下新建MyPlugin.py(文件名勿与内置模块冲突):

from Config.Utils import * # 导入 Info/Input/Title 等公共函数 def Register(): return { "name": "My First Plugin", "description": "示例插件:回显目标 URL 与请求方法", "function": Run, "arguments": { "url": {"required": True, "help": "Target: <url>"}, "method": {"required": False, "help": "HTTP method: GET / POST", "default": "GET", "choices": ["GET", "POST"]}, } } def Run(url=None, method=None): Title("My First Plugin") if not url: url = input("URL -> ") # 交互式兜底输入 if not method: method = "GET" Info(f"URL: {url}, Method: {method}") Continue()

arguments支持常用的 argparse 选项(详见 Plugins/Example.py 中的注释说明):

选项说明
required参数是否必填
type自动转换类型(int/float/str)
help帮助文本
nargs取值数量:1/+/?/*
choices限制可选值列表
default默认值
action如"store_true"转为布尔开关

💡 两个关键细节:Run()的参数名必须与arguments的键一一对应(CLI 传参靠它们);同时建议像示例一样加入input()兜底,让插件在交互模式下也能正常运行。

04 第三步:运行测试并发布你的插件

方式一:交互菜单。启动工具后,你的插件会自动出现在Plugins分类下:

python3 redtiger.py # Windows 用 python redtiger.py

方式二:命令行。插件名会转成长短参数("My First Plugin" →--my-first-plugin/-mfp):

python3 redtiger.py --my-first-plugin --url https://example.com --method POST

🚀发布建议:官方 README 推荐的做法是——为你的插件单独建一个仓库,并在仓库中打上标签#redtiger-tools,方便其他 RedTiger-Tools 用户在生态中快速发现和安装。

📌 常见坑位清单

  • 插件没出现?Register()抛异常时会被 redtiger.py静默跳过(except Exception: continue),先检查语法错误,再确认函数名拼写;
  • 文件名叫Example.py?它会被主程序主动跳过,插件文件请另起名字;
  • 参数不生效?检查Run()参数名是否与arguments键完全一致;
  • 想复用扫描能力?可导入 Program/Utils/NetworkScanningUtils.py 中的网络工具函数,快速搭建进阶插件。

按照这 3 步,你已经拥有了一个能融入 RedTiger-Tools 统一菜单、支持 CLI 调用的完整插件。动手改造 Plugins/Example.py,你的第一个 RedTiger-Tools 插件离发布只差一次git push。

【免费下载链接】RedTiger-Tools

RedTiger-Tools is a multifunction automation tool dedicated to pentesting and OSINT. The project is open source and designed to be fully configurable according to user needs. It also includes a plugin system that allows users to extend or create new features, in order to centralize multiple tools into a single unified platform.

项目地址:https://gitcode.com/gh_mirrors/red/RedTiger-Tools
点击查看免费下载

相关推荐

上一篇:5分钟跑通首次远程连接:BilldDesk最简上手指南
下一篇:APK-Installer:Windows 三步安装 APK

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询