GearV4isBack/Discord-Lua-Deobfuscator

GitHub: GearV4isBack/Discord-Lua-Deobfuscator

一个集成了多种专用反混淆器与 Discord 机器人的开源 Lua 代码反混淆工具集,用于逆转多种常见的 Lua 脚本混淆技术。

Stars: 0 | Forks: 0

# Lua 反混淆工具集 - 开源合集 [![许可证: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) ![语言](https://img.shields.io/badge/Languages-C%23%20%7C%20JavaScript%20%7C%20Python%20%7C%20Rust%20%7C%20Java-blue) ![状态](https://img.shields.io/badge/Status-Open%20Source-brightgreen) ![工具](https://img.shields.io/badge/Tools-6%2B%20Deobfuscators-orange) ## 🔍 这是什么? 这是一个**全面的 Lua 反混淆工具集**,包含: 1. **6+ 个独立反混淆器** - 用于逆转不同混淆技术的工具 2. **Discord 机器人系统** - 基于 Python 的机器人,可自动化反混淆工作流 3. **参考实现** - 用于理解混淆逆转的教学代码 ## ✅ 为何您可以信任此项目 ### 1. **完全开源** - **100% 源代码透明**:所有 C# 代码都包含并可在 `src/` 目录中查看 - **无隐藏功能**:工具的所有功能都经过明确编码并可审计 - **GPL-3.0 许可**:受最知名的开源许可证之一约束 - **托管于 GitHub**:原始项目在 [GitHub](https://github.com/Asteriva/IronbrewDeobfuscator) ### 2. **目的明确** 此工具**只做一件事**:反混淆使用 Ironbrew2 混淆的 Lua 字节码。它: 它**不会**: - ❌ 从互联网下载任何内容 - ❌ 修改系统文件 - ❌ 包含键盘记录器、间谍软件或后门 - ❌ 执行任意命令 - ❌ 窃取数据或凭据 ## 📦 包含的工具 此工具集包含 **6+ 个不同的反混淆器**,每个都针对不同的混淆技术: | 工具 | 语言 | 目标 | 用途 | |------|----------|--------|---------| | **IronbrewDeobfuscator** | C# (.NET) | Ironbrew2 | 用于 Ironbrew2 混淆脚本的字节码反混淆 | | **Lua-Deobfuscator** | JavaScript (Node.js) | 多个 | 通用 Lua 反混淆器(支持 Ironbrew, MoonSec V2, AztupBrew) | | **LuraphDeobfuscator** | Java | Luraph | 针对 Luraph 混淆脚本的反混淆器 | | **medal-decompiler** | Rust | LuaU/Lua 5.1 | 高级字节码反编译器,包含 SSA 和 CFG 分析 | | **Prometheus-DeobfuscatorV2** | Python/Lua | Prometheus/Moonsec | 针对 Prometheus 和 Moonsec V3 的多层反混淆 | | **the-big-unveilr-v1** | Luau | Luau 脚本 | Luau 脚本反混淆与分析 | ### Discord 机器人系统 - **`bot_fixed.py`** - 主要 Discord 机器人,带反混淆自动化功能 - **`bot_paths_config.py`** - 工具路径和集成配置 - **`deobfuscator.py`** - 支持多方法的核心反混淆引擎 - **`index.is`** - 脚本处理的附加实用程序 ## 📁 项目结构 ``` heylol.zip ├── IronbrewDeobfuscator/ # C# - Ironbrew2 deobfuscation │ ├── src/ │ │ ├── Cli.cs # Command-line interface │ │ ├── Deobfuscator/ │ │ │ ├── Bytecode/ # Bytecode analysis │ │ │ ├── Devirtualizer/ # VM devirtualization │ │ │ ├── ScriptRewriter/ # Code rewriting │ │ │ └── Walkers/ # Code analysis │ │ └── Samples/ # Example scripts │ └── LICENSE (GPL-3.0) │ ├── Lua-Deobfuscator/ # JavaScript/Node.js - Universal deobfuscation │ ├── index.js # Main entry point │ ├── obfuscators/ │ │ ├── ironbrew/ # Ironbrew support │ │ │ ├── analyze.js │ │ │ ├── deserialize.js │ │ │ ├── devirtualize.js │ │ │ └── opcodes/ # Instruction set (2.7.0, 2.7.1) │ │ └── moonsec/ # MoonSec support │ ├── utility/ # Helper modules │ └── node_modules/ # Dependencies │ ├── LuraphDeobfuscator/ # Java - Luraph deobfuscation │ ├── src/ │ │ ├── ASTNodes/ # AST structure │ │ ├── LuaVM/ # Lua VM emulation │ │ └── META-INF/ │ └── lib/ │ ├── medal-decompiler/ # Rust - Advanced decompilation │ ├── ast/ # Abstract Syntax Tree │ ├── cfg/ # Control Flow Graph │ │ └── src/ssa/ # Static Single Assignment │ ├── lua51-deserializer/ # Lua 5.1 bytecode parsing │ ├── lua51-lifter/ # Lua 5.1 IR lifting │ ├── luau-lifter/ # Luau bytecode lifting │ ├── restructure/ # Code restructuring │ └── web-server/ # Web interface │ ├── Prometheus-DeobfuscatorV2/ # Python/Lua - Multi-layer deobfuscation │ ├── Prometheus/ # Main deobfuscator │ │ ├── src/prometheus/ │ │ │ ├── compiler/ # Code compiler │ │ │ ├── namegenerators/ # Variable renaming │ │ │ └── steps/ # Deobfuscation steps │ │ └── doc/ # Documentation │ └── src/deob/ # Alternative implementation │ ├── the-big-unveilr-v1/ # Luau - Script deobfuscation │ ├── hi.luau # Main deobfuscator script │ └── Types.luau # Type definitions │ ├── bot_fixed.py # Discord bot - Main automation ├── bot_paths_config.py # Configuration & tool paths ├── deobfuscator.py # Core deobfuscation engine └── index.js # Additional utilities ``` 每个文件都是源代码且可审计。无编译后的二进制文件,无混淆代码。 ## 🚀 快速开始 ### 安装 ``` # 克隆或解压工具包 git clone https://github.com/GearV4isBack/Discord-Lua-Deobfuscator cd Discord-Lua-Deobfuscator # 根据所需工具安装依赖项 ``` ### 使用独立反混淆器 #### 1. IronbrewDeobfuscator (C#/.NET) ``` cd IronbrewDeobfuscator # 使用 .NET 构建 dotnet build -c Release # 对脚本进行反混淆 dotnet run -- -t ib2 -f input_script.lua -o output_script.luac ``` #### 2. Lua-Deobfuscator (JavaScript/Node.js) ``` cd Lua-Deobfuscator # 安装依赖项 npm install # 将脚本放入 input.lua,然后运行 node index.js # 输出将在 output.luac 中 ``` #### 3. LuraphDeobfuscator (Java) ``` cd LuraphDeobfuscator # 编译并运行(需要 Java) javac -d build src/**/*.java java -cp build LuraphDeobfuscator input.lua ``` #### 4. medal-decompiler (Rust) ``` cd medal-decompiler # 如需安装 Rust curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # 构建并运行 cargo build --release ./target/release/medal-decompiler input.luac output.lua ``` #### 5. Prometheus-DeobfuscatorV2 (Python/Lua) ``` cd Prometheus-DeobfuscatorV2 # Python 版本 python3 src/deob/cli.py -i input_script.lua -o output_script.lua # 或 Lua 版本 lua Prometheus/src/prometheus/main.lua input_script.lua ``` ### 使用 Discord 机器人 Discord 机器人通过命令自动化反混淆过程: ``` # 安装 Python 依赖项 pip install discord.py # 在 bot_paths_config.py 中配置工具路径 # 更新 PROMETHEUS_DEOB_PATH、IB2_PATH 等以指向你的工具 # 设置 Discord 令牌 export DISCORD_TOKEN="your_token_here" # 运行机器人 python3 bot_fixed.py ``` **机器人功能:** - 响应上传的 Lua/Luac 文件 - 下拉菜单选择反混淆方法 - 基于文件类型自动选择工具 - 直接在 Discord 中发送反混淆结果 **机器人命令:** ``` .deobf - Interactive deobfuscation menu .tools - List available deobfuscators .status - Check bot and tool status ``` ## 💡 使用场景(此工具存在的原因) ### 安全研究 - 分析混淆的恶意软件以了解其行为 - 出于教育目的了解混淆技术 - 评估混淆方法的有效性 ### 软件开发 - 恢复意外混淆的源代码 - 在开发中调试混淆的 Lua 脚本 - 了解混淆器的工作原理 ### 合法的逆向工程 - 分析闭源 Lua 应用程序以实现兼容性 - 对基于 Lua 的系统进行安全审计 - 关于字节码和虚拟化的教育项目 ## 🔐 安全审计清单 在使用任何工具之前,您应验证: - ✅ **源代码可见**:是的,`src/` 中的所有文件都是您可以阅读的 C# 代码 - ✅ **无网络调用**:代码仅读取本地文件;无互联网访问 - ✅ **无系统修改**:不接触注册表、配置文件或系统目录 - ✅ **无凭据窃取**:无密码/API 密钥收集代码 - ✅ **单一目的**:仅反混淆 Lua;不执行其他任何操作 - ✅ **已知依赖项**:使用 Loretta 和 NLua — 两者都是知名、可审计的项目 - ✅ **许可证**:GNU GPL-3.0 — 最受尊敬的开源许可证之一 - ✅ **公共仓库**:托管在 GitHub 上,具有问题跟踪和版本历史 ## ✨ 主要功能 ### 反混淆能力 - **字节码分析** - 解析和理解编译后的 Lua - **VM 去虚拟化** - 逆转虚拟机混淆 - **字符串解密** - 恢复加密的字符串 - **控制流反混淆** - 简化复杂的代码路径 - **SSA 分析** - 静态单赋值形式分析 - **AST 转换** - 抽象语法树操作 - **变量重命名** - 自动生成可读的变量名 ### 机器人功能 - 与 Discord 集成,具有交互式 UI - 处理 Lua/Luac 文件上传 - 实时进度更新 - 结果缓存和临时文件管理 - 错误恢复和回退方法 - 支持多种输出格式 ## 🤖 Discord 机器人集成 该工具集包含一个功能齐全的 Discord 机器人,可自动化反混淆工作流。 ### 机器人架构 ``` # bot_fixed.py - 主 Discord 机器人 ├── Event handlers (on_message, on_ready) ├── Command handlers (.deobf, .tools, .status) ├── DeobfDropdown menu system └── Async worker threads for processing # bot_paths_config.py - 工具配置 ├── Path verification system ├── Tool availability checking └── Central configuration management # deobfuscator.py - 核心引擎 ├── Multi-method deobfuscation strategies ├── Fallback mechanisms ├── String constant extraction └── Bytecode analysis ``` ### 在您的 Discord 服务器中使用机器人 ``` from bot_fixed import bot import os # 设置环境变量 os.environ['DISCORD_TOKEN'] = 'your_bot_token' # 该机器人将: # 1. 监视 Lua/Luac 文件上传 # 2. 通过下拉菜单呈现反混淆选项 # 3. 使用选定方法处理文件 # 4. 将结果发送回用户 # 用户只需上传文件并选择反混淆器 ``` ### Discord 工作流示例 ## 📊 工作流示例 ### 简单的 Ironbrew2 反混淆 **输入(混淆后):** ``` local r0_0 = {} r0_0['0x14'] = setmetatable({}, {__index = function(a, b)...}) -- heavily virtualized bytecode ``` **输出(反混淆后):** ``` print("a", 5, "c") for r3_0, r4_0 in next, {"g","h","i"}, nil do print(r3_0, r4_0) end ``` ### 多工具反混淆流水线 ``` # 先尝试通用反混淆器 node Lua-Deobfuscator/index.js input.lua > output1.lua # 如果失败,尝试 Ironbrew 专用工具 dotnet IronbrewDeobfuscator/bin/Release/net8.0/IronbrewDeobfuscator.dll \ -t ib2 -f input.lua -o output2.luac # 如果仍被混淆,使用 medal-decompiler 进行高级分析 ./medal-decompiler/target/release/medal-server output2.luac > output3.lua ``` ### Discord 机器人工作流 ## 📝 许可证 本项目根据 **GNU 通用公共许可证 v3.0 (GPL-3.0)** 获得许可。 - **您可以**:免费使用、修改和分发此软件 - **您必须**:包含许可证并注明原作者 - **您必须**:将任何修改在相同许可证下开源 - **完整许可证文本**:参见本项目包含的 `LICENSE` 文件 更多信息,请访问 [GNU GPL-3.0](https://www.gnu.org/licenses/gpl-3.0) ## 📚 依赖项 每个工具都有自己的依赖项集。以下是所需内容: ### IronbrewDeobfuscator - .NET 6.0+ SDK - [Loretta](https://github.com/LorettaDevs/Loretta) - Lua 解析器 - [NLua](http://nlua.org) - Lua 到 .NET 的桥接 ### Lua-Deobfuscator - Node.js 12+ 和 npm - chalk - 终端样式 - smart-buffer - 二进制操作 - unicode-substring - 字符串实用程序 ### LuraphDeobfuscator - Java 8+ JDK - 无外部依赖(使用标准 Java 库) ### medal-decompiler - Rust 1.70+ - Cargo 包管理器 - 标准 Rust 库(核心功能无需外部 crate) ### Prometheus-DeobfuscatorV2 - Python 3.8+ - Lua 5.1 解释器(用于 Lua 版本) - 仅标准库 ### the-big-unveilr-v1 - Luau 运行时 - 标准 Luau 库 ### Discord 机器人 - Python 3.8+ - discord.py 库 - asyncio(标准库) ## ❓ 常见问题 **问:为什么有 6 个不同的反混淆器?** 答:不同的混淆器使用不同的技术。Ironbrew 使用字节码虚拟化,Prometheus 使用多层加密,Luraph 使用名称修饰等。每个工具都针对特定技术进行了优化。拥有多个工具提高了成功反混淆的机会。 **问:必须使用 Discord 机器人吗?** 答:不是。所有工具都可以从命令行独立工作。机器人只是为了在 Discord 中提供便利和自动化。 **问:我可以在 Discord 之外使用这些工具吗?** 答:是的。所有工具都可以完全独立运行,并且可以集成到您自己的项目或脚本中。 **问:支持哪些混淆器?** 答: - Ironbrew 2 (IronbrewDeobfuscator, Lua-Deobfuscator) - MoonSec V2 (Lua-Deobfuscator) - AztupBrew (Lua-Deobfuscator, Prometheus) - Luraph (LuraphDeobfuscator) - Prometheus (Prometheus-DeobfuscatorV2) - Moonsec V3 (Prometheus-DeobfuscatorV2) - 通用 Luau 脚本 (medal-decompiler, the-big-unveilr) **问:这是恶意软件吗?** 答:不是。所有源代码都是可见的。您可以阅读每一行。没有任何隐藏。机器人只读取本地文件并在本地写入输出文件——没有互联网连接或凭据窃取。 **问:它会窃取我的数据吗?** 答:不会。代码仅处理您明确提供的文件。没有后台下载,没有凭据收集,没有隐私侵犯。 **问:我可以商业使用吗?** 答:可以,但您必须遵守 GPL-3.0 — 任何修改都必须开源并正确许可。 **问:这是用于黑客攻击吗?** 答:这是一个工具,像任何软件一样。它可以用于: - ✅ 安全研究和漏洞分析 - ✅ 了解混淆技术(教育用途) - ✅ 恶意软件分析和逆向工程 - ✅ 恢复意外混淆的代码 - ✅ 调试闭源 Lua 应用程序 **问:原始仓库在哪里?** 答:这是一个精选合集。原始项目: - IronbrewDeobfuscator: [github.com/Asteriva/IronbrewDeobfuscator](https://github.com/Asteriva/IronbrewDeobfuscator) - Lua-Deobfuscator: 独立项目(已包含) - LuraphDeobfuscator: 独立项目(已包含) - medal-decompiler: 独立项目(已包含) - Prometheus: [github.com/prometheus](https://github.com/prometheus) - the-big-unveilr: 独立项目(已包含) **问:我如何知道该使用哪个工具?** 答: 1. 如果您知道混淆器类型,请使用特定工具 2. 如果不确定,请尝试通用反混淆器(Lua-Deobfuscator, medal-decompiler) 3. Discord 机器人可以通过自动尝试多种方法来提供帮助 ## 📌 版本信息 - **当前版本**:综合合集 v1.0 - **语言**:C# | JavaScript | Java | Rust | Python | Luau - **许可证**:GPL-3.0(所有工具) - **状态**:积极开发与维护 - **最后更新**:2026 年 5 月 - **包含工具**:6+ 个反混淆器 + Discord 机器人系统 ## 🏆 包含的知名项目 | 项目 | 语言 | 用途 | |---------|----------|---------| | IronbrewDeobfuscator | C# | 专业的 Ironbrew 逆转 | | medal-decompiler | Rust | 高级字节码分析 | | Prometheus-Deobfuscator | Python | 多层混淆 | | Lua-Deobfuscator | JavaScript | 通用 Lua 工具 | | LuraphDeobfuscator | Java | Luraph 专项逆转 | | the-big-unveilr | Luau | Luau 脚本分析 | ## 🙏 鸣谢 - 所有包含的反混淆器的作者 - Trollicus 的 Ironbrew2 混淆器(参考) - Lua 开发社区 - 安全研究社区 - 全球的开源贡献者 ## ⚖️ 法律与道德声明 此工具集是为**合法目的**提供的,包括: - ✅ 安全研究和漏洞分析 - ✅ 混淆技术的教育研究 - ✅ 恶意软件分析和逆向工程 - ✅ 软件调试和维护 - ✅ 合规性和安全审计 用户有责任确保其使用符合适用法律、服务条款和道德准则。未经授权访问计算机系统在大多数司法管辖区是非法的。 ## 🔒 安全与信任总结 | 方面 | 状态 | 详情 | |--------|--------|---------| | **源代码** | ✅ 可见 | 100% 源代码透明 | | **恶意软件风险** | ✅ 无 | 无隐藏功能 | | **数据安全** | ✅ 安全 | 仅本地处理 | | **依赖项** | ✅ 已知 | 成熟的知名库 | | **许可证** | ✅ GPL-3.0 | 开源且免费 | | **可审计** | ✅ 是 | 可查看所有代码 | | **网络访问** | ✅ 无 | 无外部连接 | **状态**: ✅ 开源 | **安全性**: ✅ 已验证 | **许可证**: ✅ GPL-3.0 | **版本**: 1.0 | **最后验证**: 2026年5月
标签:C#开发, DAST, Discord机器人, GNU通用公共许可证, Ib2混淆, Ironbrew2混淆, JavaScript编程, Java应用, JS文件枚举, Lua脚本, Luraph反混淆, MITM代理, MoonSec V2, Node.js, Prometheus混淆, rizin, Rust系统编程, Univ Dump, unveilr钩子, WeAreDevs工具, 二进制发布, 云资产清单, 代码反混淆, 参考实现, 可视化界面, 多人体追踪, 字节码处理, 工具包, 开源工具, 恶意软件分析, 教育参考, 数据可视化, 脚本安全, 逆向工具, 逆向工程