
CDT Ansible playbook for deploying CVE-2017-7494 aka "SambaCry" to an Ubuntu box
CDT Team Delta - Vulnerable Samba Deployment
This repo is an Ansible-based deployment of a vulnerable Samba file server affected by CVE-2017-7494, a critical remote code execution vulnerability. This will hopefully be deployed for team Delta during the Grey Team phase.
CVE-2017-7494 is a critical vulnerability in Samba versions 3.5.0 through 4.6.4 that allows a remote attacker to execute arbitrary code by uploading a malicious shared object (.so) file to a writable SMB share and forcing the Samba service to load it. Successful exploitation typically results in root-level command execution.
git clone https://github.com/Zanex360/cdt-vulnsamba-deploy
cd cdt-vulnsamba-deploy
ansible-playbook -i inventory.ini playbook.yml
After deployment, the Samba service will be accessible over TCP 445 and intentionally exploitable via CVE-2017-7494.
Deployment Guide
deployment_documentation.md
Exploitation Guide
exploit_documentation.md
Red Team: Competitors can practice SMB enumeration, identify insecure writable shares, and exploit CVE-2017-7494 to gain remote code execution and full system compromise.
Blue Team: Defenders can monitor Samba logs, analyze SMB traffic, and develop detection and mitigation strategies for malicious file uploads and abnormal service behavior.
Grey Team: This project provides a vulnerable service for competition infrastructure along with documentation regarding the service.
The Ansible playbook performs the following high-level tasks:
/opt/samba-4.5.9smb.confcdt-vulnsamba-deploy/
├── playbook.yml
├── inventory.ini
├── vars/main.yml
├── roles/
│ └── samba/
│ ├── tasks/
│ │ ├── main.yml
│ │ ├── deps.yml
│ │ ├── build.yml
│ │ ├── configure.yml
│ │ └── service.yml
│ ├── handlers/
│ │ └── main.yml
│ └── templates/
│ └── smb.conf.j2
├── files/
│ └── samba-4.5.9.tar.gz
├── screenshots/
├── deployment_documentation.md
├── exploit_documentation.md
├── .gitignore
└── README.md
smb.conf