XbibzOfficial777/sqlmap-xbibz

GitHub: XbibzOfficial777/sqlmap-xbibz

sqlmap 的重构分支,增加了全自动化注入检测、WAF 智能绕过和参数自动发现等增强功能。

Stars: 2 | Forks: 0

# SQLMAP 重构版! [![Version](https://img.shields.io/badge/version-3.0-red.svg)](https://github.com/XbibzOfficial777/sqlmap-xbibz) [![Python 3.x](https://img.shields.io/badge/python-3.x-yellow.svg)](https://www.python.org/) [![License](https://img.shields.io/badge/license-GPLv2-red.svg)](https://raw.githubusercontent.com/sqlmapproject/sqlmap/master/LICENSE) [![Platform](https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20Termux-blue.svg)](https://github.com/XbibzOfficial777/sqlmap-xbibz) [![Recoded](https://img.shields.io/badge/recoded%20by-Xbibz%20Official-orange.svg)](https://tiktok.com/@xbibzofficial) ## v3.0 有哪些新功能 | 功能 | 描述 | |---------|-------------| | **`--auto`** | 完全自动化模式 - 自动检测 WAF、自动应用 tamper 脚本、自动设置 level/risk、零交互 | | **`--spider`** | 通过 Wayback Machine CDX API + DOM 挖掘实现 ParamSpider 风格的参数发现 | | **DalFox WAF 引擎** | 多层 WAF 指纹识别(被动 header + body + 主动探测)以及 28+ 种 WAF 绕过策略 | | **渐进式升级** | 当前绕过链失效时,执行 6 阶段的 tamper 升级 | | **智能重试** | 针对速率限制的自适应连接错误处理,采用指数退避算法 | | **优先级排序** | 根据 SQLi 优先级(高/中/低参数分类)对发现的 URL 进行排序 | | **Termux 支持** | 完整支持免 root 的 Android/Termux,并自动安装依赖 | | **一行代码安装** | 通过 curl 安装,并自动配置 .bashrc/.zshrc | ## 快速安装 ### 一行代码安装 (Linux/macOS) ``` curl -sL https://raw.githubusercontent.com/XbibzOfficial777/sqlmap-xbibz/main/install.sh | bash ``` ### 一行代码安装 (Termux) ``` curl -sL https://raw.githubusercontent.com/XbibzOfficial777/sqlmap-xbibz/main/install.sh | bash ``` ### 手动安装 ``` git clone https://github.com/XbibzOfficial777/sqlmap-xbibz.git cd sqlmap-xbibz chmod +x install.sh ./install.sh ``` ### 卸载 ``` ~/.sqlmap-xbibz/uninstall.sh ``` ## 用法 ### 基础用法(与原版 sqlmap 相同) ``` sqlmap -u "http://target.com/page.php?id=1" --batch ``` ### **新增:完全自动化模式 (--auto)** ``` sqlmap -u "http://target.com/page.php?id=1" --auto ``` `--auto` 会自动执行以下操作: - 设置 batch 模式(无交互提示) - 启用随机 User-Agent 以实现隐身 - 设置检测 level=3, risk=2 - 自动检测 WAF 并应用相应的 tamper 脚本 - 绕过失败时进行 6 阶段的渐进式升级 - 自适应连接错误处理 - 测试通常会被跳过的 casted 参数 ### **新增:参数发现 (--spider)** ``` sqlmap -u "http://target.com" --spider ``` `--spider` 的功能(ParamSpider 风格): - 查询 Wayback Machine CDX API 以获取带参数的历史 URL - 从目标页面进行 DOM 挖掘以发现隐藏参数 - 过滤掉静态资源(图片、CSS、JS 等) - 将参数值替换为 FUZZ 占位符 - 根据 SQLi 优先级对 URL 进行排序(id, uid, cat = 高优先级) - 自动将所有发现的 URL 加入扫描队列 ### **组合使用:完全自动化 + Spider** ``` sqlmap -u "http://target.com" --auto --spider ``` 最大程度自动化:发现所有参数,然后利用 WAF 绕过智能技术对每个参数进行自动扫描。 ### 其他示例 ``` # 带有特定目标的 Auto 模式 sqlmap -u "http://target.com/page?id=1" --auto --dbs # 带有 forms discovery 的 Spider 模式 sqlmap -u "http://target.com" --spider --forms --batch # 带有 proxy 的 Auto 模式 sqlmap -u "http://target.com/page?id=1" --auto --proxy="http://127.0.0.1:8080" # 使用 Auto 模式 Dump 数据库 sqlmap -u "http://target.com/page?id=1" --auto --dump ``` ## WAF 检测与绕过 `--auto` 标志包含受 DalFox 启发的 WAF 智能技术,可检测并绕过: | WAF | Tamper 策略 | 延迟 | |-----|----------------|-------| | Cloudflare | charencode, randomcase, space2comment, between | 100ms | | AWS WAF | space2comment, randomcase, charencode | 0ms | | Akamai | charencode, randomcase, space2plus, percentage | 50ms | | Imperva/Incapsula | charencode, randomcase, space2comment, between, equaltolike | 100ms | | ModSecurity | modsecurityversioned, modsecurityzeroversioned, charencode, randomcase | 0ms | | ModSecurity CRS | modsecurityversioned, modsecurityzeroversioned + OWASP 特定变异 | 0ms | | Wordfence | charencode, randomcase, space2comment, between | 0ms | | F5 BIG-IP ASM | charencode, randomcase, space2comment, between, modsecurityversioned | 50ms | | Barracuda | charencode, randomcase, space2comment, percentage | 50ms | | Safedog | charencode, randomcase, space2comment, percentage | 50ms | | Alibaba Cloud | charencode, randomcase, space2comment, percentage | 50ms | | Azure WAF | charencode, randomcase, space2comment, percentage | 50ms | | ... | 已映射 28+ 种 WAF | ... | ### WAF 检测层(DalFox 风格) 1. **被动 Header 指纹识别** - 零额外请求,匹配响应头 2. **被动 Body 指纹识别** - 零额外请求,匹配 body 模式 3. **状态码加权** - 403/406/429/503 响应可提升检测置信度 4. **主动探测** - 发送一次额外请求,携带恶意 payload 以触发 WAF ### 渐进式升级阶段 当检测到 WAF 但当前 tamper 链失效时: 1. `charencode`(细微改动) 2. `charencode + randomcase`(大小写随机化) 3. `charencode + randomcase + space2comment`(空格替换) 4. `+ between + equaltolike`(关键字替换) 5. `+ chardoubleencode + percentage`(双重编码) 6. `+ equaltolike + randomcomments`(最大程度绕过) ## 功能对比 | 功能 | 原版 sqlmap | sqlmap-xbibz v3.0 | |---------|----------------|-------------------| | `--auto` 模式 | 否 | 是(完全自动化) | | `--spider` 参数发现 | 否 | 是(Wayback + DOM) | | WAF 自动检测 | 基础 (identYwaf) | 增强(DalFox 风格 3 层检测) | | WAF 自动绕过 | 否 | 是(28+ 种 WAF 策略) | | 渐进式升级 | 否 | 是(6 个阶段) | | 智能重试/退避 | 否 | 是(指数退避) | | 参数优先级排序 | 否 | 是(高/中/低) | | Termux 免 root | 部分 | 完整支持 | | curl 一行代码安装 | 否 | 是 | | 自动配置 .bashrc/.zshrc | 否 | 是 | ## 项目结构 ``` sqlmap-xbibz/ sqlmap.py # Main entry point (--auto/--spider hooks) sqlmapapi.py # API entry point install.sh # One-line curl installer uninstall.sh # Clean uninstaller lib/ controller/ auto.py # NEW: AutoEngine v3.0 (ParamSpider + DalFox logic) controller.py # Modified: WAF handler hook checks.py # WAF detection integration core/ settings.py # Modified: Xbibz Official branding + version optiondict.py # Modified: --auto, --spider, autoMode options parse/ cmdline.py # Modified: --auto and --spider arguments request/ basic.py # identYwaf integration (existing) thirdparty/ identywaf/ # WAF identification library (existing) ``` ## 原版 sqlmap 功能 sqlmap 是一个开源的渗透测试工具,可自动执行检测和利用 SQL 注入漏洞以及接管数据库服务器的过程。它配备了一个强大的检测引擎,为终极渗透测试人员提供了许多利基功能,以及广泛的开关列表,包括数据库指纹识别、从数据库中提取数据、访问底层文件系统,以及通过带外连接在操作系统上执行命令。 要获取基本选项和开关的列表,请使用: ``` python sqlmap.py -h ``` 要获取所有选项和开关的列表,请使用: ``` python sqlmap.py -hh ``` 你可以找到原版 sqlmap 功能的[用户手册](https://github.com/sqlmapproject/sqlmap/wiki/Usage)。 ## 链接 * 主页:https://sqlmap.org * 原始代码库:https://github.com/sqlmapproject/sqlmap * 此 Fork 版本:https://github.com/XbibzOfficial777/sqlmap-xbibz * 用户手册:https://github.com/sqlmapproject/sqlmap/wiki * TikTok:https://tiktok.com/@xbibzofficial ## 法律免责声明 未经事先双方同意,使用 sqlmap 攻击目标是非法的。最终用户有责任遵守所有适用的地方、州和联邦法律。开发者不承担任何责任,也不对本程序造成的任何滥用或损坏负责。
标签:CISA项目, Cobalt Strike集成, Python, Termux, 无后门, 逆向工具