⚠️ FOR PENETRATION TESTING, AUTHORIZED ACCESS, AND EDUCATIONAL PURPOSES ONLY
A feature-rich Python network worm for authorized penetration testing that demonstrates worm propagation techniques, lateral movement, and network spreading capabilities.
THIS TOOL IS FOR PENETRATION TESTING, AUTHORIZED ACCESS, AND EDUCATIONAL PURPOSES ONLY.
- AUTHORIZED USE ONLY: Only use on systems you own or have explicit written permission to test
- PENETRATION TESTING: Intended for authorized penetration testing and security research
- EDUCATIONAL PURPOSES: For learning about worm propagation, lateral movement, and network security
- LEGAL COMPLIANCE: Unauthorized use of network worms may be illegal in your jurisdiction
- RESPONSIBLE USE: Always comply with local laws and regulations
- ETHICAL USE: Use responsibly and ethically - respect privacy and obtain proper authorization
By using this tool, you agree that:
- You have proper authorization to use this tool on the target systems
- You understand the legal implications of network worm propagation
- You will not use this tool for malicious purposes
- You accept full responsibility for your actions
The authors and contributors are not responsible for any misuse of this tool.
- ✅ Multiple Spreading Methods: SSH, NFS, PsExec, WMI, RDP, SMB
- ✅ Network Scanning: Automatic network discovery using ARP or ping
- ✅ Multi-Threading: Parallel spreading to multiple targets
- ✅ Configurable: JSON-based configuration file
- ✅ Cross-Platform: Works on Linux, Windows, and macOS
- ✅ Payload Generation: Generates payloads for Python, Bash, and PowerShell
- ✅ Logging: Comprehensive logging to file and console
- ✅ Error Handling: Robust error handling and recovery
- ✅ Infection Tracking: Tracks infected hosts
# Core dependencies
pip install scapy paramiko
# Windows-specific (for lateral movement)
pip install pywin32 WMIOr install from requirements.txt:
pip install -r requirements.txtpython3 worm.pyThis will:
- Execute payload on current system
- Scan network (default: 192.168.1.0/24)
- Attempt to spread to all found hosts
python3 worm.py --range 10.0.0.0/24python3 worm.py --config my_config.jsonpython3 worm.py --verbose| Option | Short | Description | Default |
|---|---|---|---|
--range |
-r |
IP range to scan | 192.168.1.0/24 |
--config |
-c |
Configuration file | worm_config.json |
--log |
-l |
Log file path | worm.log |
--verbose |
-v |
Enable verbose logging | False |
- Attempts SSH connections with common credentials
- Uploads worm code to
/tmp/worm.py - Executes worm remotely
- Verifies infection
- Checks for NFS exports
- Mounts NFS share
- Copies worm to shared directory
- Unmounts share
- Uses PsExec for remote execution
- Executes PowerShell payload
- Requires Windows and PsExec
- Uses Windows Management Instrumentation
- Creates remote processes
- Executes payload via WMI
- Stores RDP credentials
- Executes PowerShell payload via PsExec
- Uses encoded PowerShell commands
- Uses SMB to copy files
- Uploads worm to remote system
- Requires SMB access
The worm uses a JSON configuration file (worm_config.json):
{
"ssh": {
"enabled": true,
"usernames": ["root", "admin", "kali"],
"passwords": ["12345", "1234", "password"],
"port": 22
},
"nfs": {
"enabled": true,
"mount_point": "/mnt"
},
"psexec": {
"enabled": true,
"username": "admin",
"password": "admin"
},
"wmi": {
"enabled": true,
"username": "admin",
"password": "admin"
},
"rdp": {
"enabled": true,
"username": "admin",
"password": "admin"
},
"smb": {
"enabled": true,
"username": "admin",
"password": "admin"
},
"payload": {
"file": "infected.txt",
"message": "This system has been infected."
},
"network": {
"scan_range": "192.168.1.0/24",
"threads": 10
}
}The worm can generate payloads in multiple formats:
- Python: Cross-platform Python script
- Bash: Linux/Unix shell script
- PowerShell: Windows PowerShell script
python3 worm.py
# Scans 192.168.1.0/24 and attempts all spreading methodspython3 worm.py --range 10.10.10.0/24# Edit worm_config.json first
python3 worm.py --config my_config.jsonpython3 worm.py --verbose-
Better Code Structure
- Object-oriented design
- Modular spreading methods
- Configuration management
-
Enhanced Features
- SMB spreading support
- Multiple payload types
- Infection tracking
- Thread pool management
-
Better Error Handling
- Comprehensive exception handling
- Graceful degradation
- Detailed logging
-
Cross-Platform Support
- Works on Linux, Windows, macOS
- Platform-specific feature detection
- Fallback methods
-
Configuration System
- JSON-based configuration
- Easy customization
- Default values
-
Security
- Prominent pentest/authorized/educational disclaimer
- Security warnings
- Responsible use guidelines
- Python 3.6+
- scapy (for network scanning)
- paramiko (for SSH spreading)
- pywin32 (Windows only, for lateral movement)
- WMI (Windows only, for WMI spreading)
- Requires network access to target systems
- Needs valid credentials for spreading methods
- Some methods require specific tools (PsExec, smbclient)
- Windows methods only work on Windows
This project is provided as-is for educational and authorized testing purposes.
Sergios9494
Contributions, issues, and feature requests are welcome!