This repository contains an automated framework for simulating Distributed Denial of Service (DDoS) attacks in a controlled environment. The framework uses Terraform for infrastructure provisioning and Ansible for orchestrating the simulation.
ddos-attack/
├── Orchestration/
│ └── Ansible/
│ └── Attack/
│ ├── tasks/
│ ├── group_vars/
│ ├── continuous-ddos-playbook.yml
│ ├── clear_website.yml
│ ├── reboot_cleanup_all.yml
│ └── inventory.ini
├── terraform/
│ ├── main.tf
│ ├── variables.tf
│ ├── provider.tf
│ └── terraform.tfvars
└── scripts/
├── normal.sh
├── syn_flood.sh
└── route.sh
The infrastructure is managed using Terraform with vSphere as the provider. Key components include:
- VM provisioning from templates
- Network configuration
- Resource pool management
- Customizable deployment parameters
The Ansible playbooks handle the simulation orchestration:
- Role assignment for attacker and normal traffic nodes
- Traffic generation and attack execution
- Packet capture and monitoring
- Cleanup and system maintenance
normal.sh: Generates legitimate traffic patternssyn_flood.sh: Executes SYN flood attacksroute.sh: Manages traffic routing configurations
- Infrastructure Setup
cd terraform
terraform init
terraform plan
terraform apply- Configure Ansible Vault
cd Orchestration/Ansible/Attack
ansible-vault create group_vars/all/vault.yml- Update Inventory
Modify
inventory.iniwith your infrastructure details.
- Start Continuous DDoS Simulation
ansible-playbook continuous-ddos-playbook.yml --ask-vault-pass- Clean Up After Simulation
ansible-playbook reboot_cleanup_all.yml --ask-vault-passThe framework supports different attack intensities:
- Low: 5-35% of nodes as attackers
- Mid: 35-65% of nodes as attackers
- High: 65-85% of nodes as attackers
- Packet captures are stored in
/var/log/pcap/ - Simulation logs are in
/var/log/ddos_sim/ - Individual attack logs are maintained on each node
- Credentials are stored in Ansible Vault
- Terraform sensitive variables are marked appropriately
- Infrastructure credentials are managed via separate provider configuration
- All script execution is contained within the defined network
- Terraform >= 1.0
- Ansible >= 2.9
- vSphere environment
- Ubuntu-based templates
- Python 3.x
- Use
clear_website.ymlfor web server maintenance reboot_cleanup_all.ymlfor complete system reset- Regular monitoring of log directories to prevent disk space issues
- Always use Ansible Vault for sensitive data
- Keep Terraform state files secure
- Monitor resource usage during simulations
- Regular cleanup of log files
- Test in isolated network environments
- This framework is for research and testing purposes only
- Should only be used in controlled, isolated environments
- All simulations should comply with relevant policies and regulations
- Monitor system resources during extended simulations
- Fork the repository
- Create a feature branch
- Submit a pull request with detailed description
- Ensure all tests pass
- Update documentation as needed
[Insert your license information here]
This tool is for research and educational purposes only. Users are responsible for ensuring all activities comply with applicable laws and regulations.