ETHICAL DISCLAIMER: This tool is for authorized testing only. Misuse is prohibited.
The PyRai Advanced Test Payload is a sophisticated security testing tool designed to demonstrate post-exploitation capabilities in controlled environments while maintaining strict safety measures.
-
Environment Validation
- Checks for testing environment indicators
- Validates hostname for test/lab/vm/sandbox keywords
- Requires authorization markers
- Only operates in TESTING_MODE
-
Self-Destruct Timer
- Default: 5 minutes (300 seconds)
- Maximum Runtime: 10 minutes
- Automatic Cleanup: Removes all created files
- Manual Override: Can be triggered manually
-
Network Restrictions
- Limited to RFC 3927 test ranges (192.0.2.0/24)
- Localhost communication only
- No external network access
- Hostname and platform details
- Architecture and processor information
- Current user and directory context
- Process information (limited for safety)
- Network addresses (local only)
- Environment variables (filtered)
- Limited Host Scanning: Only first 4 IPs in test range
- Ping Sweeps: Basic connectivity testing
- Service Discovery: Simulated only
- Port Scanning: Demonstration only
All persistence techniques are SIMULATED ONLY and do not actually create persistent access:
-
Cron Job Persistence
- Shows cron entry format
- Demonstrates scheduling techniques
- Status: Simulated only
-
Startup Script Persistence
- Registry entries (Windows)
- Init scripts (Linux)
- Status: Simulated only
-
Service-Based Persistence
- System service creation concepts
- Service configuration examples
- Status: Simulated only
All communication techniques are SIMULATED ONLY:
-
HTTP Beacon
- Demonstrates beacon intervals
- Shows HTTP-based communication
- Target: Localhost only
-
DNS Tunneling
- TXT record exfiltration concepts
- Domain-based communication
- Status: Simulated only
-
Encrypted Channels
- AES-256-GCM encryption concepts
- ECDH key exchange demonstration
- Status: Simulated only
β
Environment validation
β
Authorization marker creation
β° Self-destruct timer initialization
π Hostname and platform enumeration
π User and process information
π Network interface discovery
π Environment variable collection
π Local network ping sweep (limited)
π Host discovery in test ranges
π Service enumeration (simulated)
π Cron job techniques (simulated)
π Startup script methods (simulated)
π Service persistence (simulated)
π‘ HTTP beacon demonstration
π‘ DNS tunneling concepts
π‘ Encrypted channel examples
πΎ JSON results export
π§Ή Automatic file cleanup
π₯ Self-destruct execution
- Location:
/tmp/pyrai_recon.json(Linux) orC:\temp\pyrai_recon.json(Windows) - Format: JSON with structured results
- Content: All reconnaissance data and demonstrations
- Location:
/tmp/pyrai_authorized(Linux) orC:\temp\pyrai_authorized(Windows) - Purpose: Indicates authorized testing session
- Cleanup: Removed during self-destruct
- Location:
/tmp/pyrai_test.txt(Linux) orC:\temp\pyrai_test.txt(Windows) - Purpose: Proves successful execution
- Cleanup: Removed during self-destruct
TESTING_MODE = True # Safety enabled
SELF_DESTRUCT_TIMER = 300 # 5 minutes
MAX_RUNTIME = 600 # 10 minutes maximum
AUTHORIZED_NETWORKS = ["192.0.2.0/24", "127.0.0.0/8"]- Hostname must contain: 'test', 'lab', 'vm', 'sandbox', 'demo'
- Authorization marker file must exist or be creatable
- TESTING_MODE must be enabled
python3 bin/test_payload.py============================================================
PyRai Advanced Test Payload - Enhanced Security Testing
ETHICAL DISCLAIMER: This tool is for authorized testing only.
============================================================
β
Safety checks passed - Authorized testing environment detected
β° Self-destruct timer set for 300 seconds
π Execution started at: 2024-01-15T10:30:00
π Phase 1: System Reconnaissance
β Gathered system information for test-vm-01
π Phase 2: Network Discovery
β Network scan completed
π Phase 3: Persistence Techniques (Demonstration)
β Persistence techniques demonstrated (simulated only)
π‘ Phase 4: C2 Communication (Demonstration)
β C2 communication techniques demonstrated (simulated only)
πΎ Results saved to: /tmp/pyrai_recon.json
π EXECUTION SUMMARY
========================================
Hostname: test-vm-01
Platform: Linux-5.4.0-x86_64
Current User: testuser
Active Hosts Found: 0
Persistence Methods: 3
C2 Methods: 3
β οΈ WARNING: This was a demonstration payload
β οΈ All techniques were simulated for testing purposes
β οΈ Self-destruct will activate in 300 seconds
β³ Payload execution completed. Waiting for self-destruct...
==================================================
SELF-DESTRUCT SEQUENCE INITIATED
==================================================
β Payload file /tmp/test_payload.py removed
β Cleaned up /tmp/pyrai_test.txt
β Cleaned up /tmp/pyrai_authorized
β Cleaned up /tmp/pyrai_recon.json
β Self-destruct completed successfully
==================================================
- Time Limit: Maximum 10 minutes execution
- Network Limit: Test ranges only
- File System: Temporary files only
- Process Limit: Read-only process enumeration
- No Sensitive Data: Avoids collecting passwords or keys
- Filtered Output: Environment variables are filtered
- Limited Scope: Only safe system information
- Automatic: Self-destruct timer
- Manual: Exception-triggered cleanup
- Complete: All created files removed
# 1. Start relay
python relay.py
# 2. Start scanner (to collect credentials)
python scanner.py
# 3. Deploy payload using loader
python loader.py dump/csdb.txt- HTTP Server: Serves payload on port 31338
- Download Command:
wget http://127.0.0.1:31338/test_payload.py - Execution:
python3 test_payload.py - Cleanup: Automatic removal after execution
- Process creation:
python3 test_payload.py - File creation in
/tmp/orC:\temp\ - Network connections to localhost:31338
- JSON file creation with reconnaissance data
- System information enumeration
- Limited network scanning
- File creation and deletion patterns
- Short-lived process execution
- Monitor for process execution patterns
- Watch temporary file creation
- Alert on system enumeration activities
- Track network scanning attempts
- Disable unnecessary services (telnet)
- Change default credentials
- Implement network segmentation
- Deploy endpoint detection tools
- Isolate affected systems
- Analyze reconnaissance data
- Patch identified vulnerabilities
- Update security controls
- Written Permission: Required for all testing
- Scope Limitations: Respect testing boundaries
- Documentation: Maintain detailed test logs
- Responsible Disclosure: Report findings appropriately
- Unauthorized system access
- Production environment testing
- Malicious activities
- Criminal purposes
Remember: This payload is designed for educational and authorized security testing only. Always ensure proper authorization before use and follow responsible disclosure practices for any vulnerabilities discovered.