A multi-stage penetration testing lab built with Vagrant and VirtualBox.
This lab contains 3 machines (cb01, cb02, cb03) connected via a private network:
| Machine | IP | Role | Challenge |
|---|---|---|---|
| cb01 | 192.168.56.101 | Web Server | File Upload → Reverse Shell |
| cb02 | 192.168.56.102 | Artifactory Server | Default Credentials → Cron Exploitation |
| cb03 | 192.168.56.103 | Target Server | SSH Pivot → Library Hijack → Ansible Vault |
- VirtualBox (version 6.1+)
- Vagrant (version 2.2+)
- At least 4 GB RAM (6 GB recommended)
- 30 GB free disk space
# Navigate to the lab directory
cd /home/adip/LinuxChainLab
# Start all VMs (takes 15-25 minutes on first run)
vagrant up
# Check VM status
vagrant status- Browse to
http://192.168.56.101/ - Upload
php-reverse-shell.php(edit IP/port first!) - Start listener:
nc -lvnp 4444 - Access shell at
http://192.168.56.101/uploads/php-reverse-shell.php
- Find cron:
/etc/cron.d/update-job - Target cb02:
192.168.56.102:8081 - Credentials:
admin:password - Upload malicious
update.shto Artifactory - Wait for cron execution → get shell as
devon cb01
- Get SSH key:
/home/dev/.ssh/id_rsa - Connect:
ssh -i id_rsa dev@192.168.56.103
- Examine setuid binary:
/usr/local/bin/status - Check library:
ldd /usr/local/bin/status - Create malicious library in
/opt/custom/lib/ - Run binary → get root shell
- Find vault:
/root/ansible/secret.txt - Decrypt:
ansible-vault decrypt --vault-password-file /root/ansible/vault_pass.txt /root/ansible/secret.txt - FLAG:
FLAG{Ansible_Vault_Decrypted}
| Service | Username | Password |
|---|---|---|
| cb01 dev user | dev | devpassword |
| cb02 Artifactory | admin | password |
| cb03 dev user | dev | devpassword |
| Ansible vault | (password file) | vaultpassword |
After vagrant up, access the lab:
- Attacker (host): Use
192.168.56.1or your VirtualBox host-only adapter IP
# SSH into machines
vagrant ssh cb01
vagrant ssh cb02
vagrant ssh cb03
# Stop all VMs
vagrant halt
# Destroy all VMs
vagrant destroy -f
# Rebuild a specific VM
vagrant destroy cb01 -f && vagrant up cb01- Vagrant not starting? Ensure VirtualBox is installed and running
- Network issues? Check VirtualBox host-only adapter is configured
- Artifactory slow? First start can take 5+ minutes
- SSH issues? Run
vagrant reloadto regenerate keys
LinuxChainLab/
├── Vagrantfile # VM configuration
├── php-reverse-shell.php # Pre-configured reverse shell
├── README.md # This file
└── scripts/
├── cb01-setup.sh # Web server setup
├── cb02-setup.sh # Artifactory setup
└── cb03-setup.sh # Target server setup
vagrant destroy -fFor educational purposes only. Use on systems you own or have permission to test.