A comprehensive, modular cybersecurity testing environment using Multipass VMs with intentionally vulnerable services designed for hands-on educational purposes.
This project creates a controlled, isolated environment where students and cybersecurity professionals can practice penetration testing techniques safely. It features two VMs: an Attacker machine with testing tools and a Target machine running vulnerable services.
- π§ Modular Architecture: Separated scripts, services, and templates for easy maintenance
- π¨ Dynamic MOTD System: Immersive ASCII art banners with real-time system information
- π οΈ Advanced Testing Tools: Port scanner, web fuzzer, interactive client with exploitation hints
- π Comprehensive Logging: Structured logs with JSON export capabilities
- π Educational Focus: Built-in guidance and security reminders
git clone https://github.com/manzolo/cybersecurity-lab
cd cybersecurity-lab- Multipass - Cross-platform VM manager
- 4GB RAM minimum (8GB recommended)
- 20GB free disk space
- Linux, macOS, or Windows with WSL
-
Create the complete environment:
./lab.sh create # Creates VMs, deploys scripts, configures services -
Run automated vulnerability tests:
./lab.sh test # Comprehensive security assessment
-
Access interactive testing:
./lab.sh client # Connect to vulnerable TCP server multipass shell attacker # Direct access to attacker VM
| Command | Description |
|---|---|
./lab.sh |
Launch interactive menu |
./lab.sh create |
Create complete lab environment |
./lab.sh test |
Run automated vulnerability tests |
./lab.sh client |
Interactive TCP client session |
./lab.sh status |
Show detailed VM and service status |
./lab.sh destroy |
Clean up all resources |
| Command | Description |
|---|---|
./lab.sh restart-services |
Restart all lab services |
./lab.sh service-status |
Detailed service health check |
./lab.sh preview-motd |
Preview welcome screens for both VMs |
Once connected to the attacker VM (multipass shell attacker), use these aliases:
lab-help- Show all available lab commandslab-test- Run comprehensive vulnerability test suitelab-connect- Interactive TCP client with exploitation hintslab-scan <ip>- Advanced port scanner with service detectionlab-web <ip>- Web vulnerability fuzzer (XSS, directory traversal)lab-logs- View recent attack logs and statistics
- Command Injection:
execcommand executes arbitrary system commands - Directory Traversal:
filecommand reads arbitrary files - Information Disclosure: Various commands leak system information
- Cross-Site Scripting (XSS):
/echoendpoint reflects input without sanitization - Directory Traversal:
/fileendpoint allows reading arbitrary files - Remote Code Execution:
/execendpoint executes system commands - Information Disclosure:
/config,/debug, and/infoendpoints
# XSS Testing
curl 'http://target_ip:8080/echo?msg=<script>alert(1)</script>'
# Directory Traversal
curl 'http://target_ip:8080/file?name=../../../etc/passwd'
# Command Injection via TCP
nc target_ip 9000
> exec whoami
> file /etc/passwdcybersecurity-lab/
βββ lab.sh # Main orchestration script
βββ README.md # This documentation
βββ config/ # Generated configurations (auto-created)
βββ logs/ # System logs (auto-created)
βββ scripts/ # Modular bash components
β βββ menu.sh # Interactive menu system
β βββ vm_management.sh # VM lifecycle management
β βββ testing.sh # Test execution framework
β βββ utils.sh # Common utilities
βββ templates/ # Cloud-init templates
β βββ target-cloud-init.yaml
β βββ attacker-cloud-init.yaml
βββ target-scripts/ # Python scripts for target VM
β βββ vulnerable-server.py # Intentionally vulnerable TCP server
β βββ web-server.py # Vulnerable web application
β βββ monitor.sh # System monitoring script
βββ attacker-scripts/ # Python scripts for attacker VM
β βββ port-scanner.py # Advanced port scanner
β βββ connection-tester.py # Connection reliability tester
β βββ interactive-client.py # Interactive exploitation client
β βββ web-fuzzer.py # Web vulnerability fuzzer
βββ services/ # Systemd service definitions
βββ vulnerable-server.service
βββ vulnerable-web.service
βββ target-monitor.service
This lab environment is designed to teach:
- Network Reconnaissance: Port scanning and service enumeration
- Vulnerability Assessment: Automated and manual vulnerability discovery
- Web Application Security: XSS, directory traversal, and injection attacks
- System Exploitation: Command injection and privilege escalation techniques
- Logging and Monitoring: Understanding attack patterns and detection
- Secure Development: Learning from intentionally vulnerable code
This environment contains intentional security vulnerabilities and should:
- β Only be used in isolated, controlled environments
- β Never be deployed on production networks
- β
Be destroyed after use:
./lab.sh destroy - β Only be used on systems you own or have explicit permission to test
VMs won't start:
multipass info --all # Check VM status
multipass purge # Clean up orphaned VMsServices not running:
./lab.sh service-status # Check detailed service status
./lab.sh restart-services # Restart all servicesScripts not working:
./lab.sh update-scripts # Redeploy all scriptsMultipass issues:
# On Ubuntu/Debian
sudo snap refresh multipass
# On macOS
brew upgrade --cask multipassContributions are welcome! Please:
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Test your changes:
./lab.sh test - Commit your changes:
git commit -m 'Add feature' - Push to the branch:
git push origin feature-name - Create a Pull Request
git clone https://github.com/manzolo/cybersecurity-lab
cd cybersecurity-lab
./lab.sh create # Test the environment
./lab.sh test # Run the test suiteThis project is licensed under the MIT License
- Built with Multipass by Canonical
- Inspired by various cybersecurity training platforms
- Educational methodology influenced by OWASP guidelines
For additional learning, check out:
π Happy Ethical Hacking!
Remember: The best way to learn cybersecurity is through hands-on practice in controlled environments like this one.