Framework Components
The Python framework consists of three main scripts, each targeting different infrastructure:- connect.py - Targets uniforms.flydubai.com with custom encoding
- rce5.py - Targets jordandesert.org.jo with custom encoding
- RCE4.py - Targets 193.188.88.156 with plaintext commands
Command Encoding Mechanism
Custom Substitution Cipher
Two of the scripts (connect.py and rce5.py) implement a custom character substitution cipher:
Encoding Analysis
The cipher performs character-by-character substitution: Original alphabet (en):whoami→ (encoded) → specific character sequence- Commands are obfuscated before transmission
- Server-side ASP script reverses the encoding
Remote Execution Function
All three scripts share a similarremote_exec() function that handles command transmission:
With Encoding (connect.py, rce5.py)
Without Encoding (RCE4.py)
- RCE4.py adds
verify=Falseto bypass SSL certificate validation - Commands in RCE4.py are sent in plaintext (no encoding)
- All scripts use GET requests with custom headers
Interactive Shell Interface
Readline Integration
The scripts implement command-line completion using Python’s readline:Command Loop
The main execution loop follows this pattern:Target Selection System
connect.py (flydubai.com)
rce5.py (jordandesert.org.jo)
RCE4.py (193.188.88.156)
HTTP Header Configuration
All scripts use identical header configuration:Accept-Captcha: Static token, possibly used for authentication or session trackingAccept-Language: Dynamically updated with commands (encoded or plaintext)User-Agent: Mimics Chrome 120 on Linux to blend with legitimate traffic
Security Implications
Strengths
- Custom encoding reduces signature-based detection
- HTTP header tunneling evades basic inspection
- Interactive interface provides operator flexibility
- Target management allows multi-target operations
Weaknesses
- Hardcoded targets reveal compromised infrastructure
- Static Accept-Captcha token serves as unique IOC
- Simple substitution cipher easily reversed
- No authentication on webshell side (any request with correct header works)
- Plaintext storage of target URLs and encoding logic
Detection Strategies
Network Detection
Behavioral Detection
- Repeated GET requests to static resources (images/flash/ directories)
- Responses from image files containing command-line output patterns
- HTTP 200 responses from .phto, .aspx, .php files in image directories
Related Analysis
- Webshell Framework Overview - Framework architecture
- ASP Webshell Analysis - Server-side components