A lightweight tool demonstrating TCP SYN flood attack for network security research and education.
This tool demonstrates the SYN flood attack technique, a form of denial-of-service (DoS) attack that exploits the TCP three-way handshake. It sends a continuous stream of TCP SYN packets with randomized source IP addresses to a target system, potentially exhausting its connection resources.
⚠️ IMPORTANT: This tool is developed for educational and research purposes only. Using this tool against systems without explicit permission is illegal and unethical.
- Send TCP SYN packets with randomized source IP addresses
- Configurable target IP address and port
- Adjustable packet transmission rate
- Real-time statistics display (packets sent, duration, rate)
- Clean termination with Ctrl+C, showing final statistics
- Linux operating system
- GCC compiler
- Root privileges (required for raw socket operations)
git clone https://github.com/Moh-Gebril/syn-flood.git
cd syn-floodmakeThis will create the executable in the bin/ directory.
make installsudo ./bin/syn_flood <destination_ip> <port> [packet_delay_ms]destination_ip: Target IP addressport: Target port number (1-65535)packet_delay_ms: Optional delay between packets in milliseconds (default: 0)
sudo ./bin/syn_flood 192.168.1.1 80 5This will start a SYN flood demonstration against 192.168.1.1 on port 80 with a 5ms delay between packets.
The tool provides real-time statistics during execution:
[INFO] Starting SYN flood attack on 192.168.1.1:80
[INFO] Press Ctrl+C to stop the attack
[INFO] Packets sent: 5000 | Duration: 25 seconds | Rate: 200.00 pps
.
├── bin/ # Compiled binary directory
├── build/ # Object files directory
├── headers/ # Header files
│ ├── ip_header.h # IP header structure
│ ├── network_utils.h # Network utility functions
│ └── tcp_header.h # TCP header structure
├── main.c # Main implementation file
├── network_utils.c # Network utility implementations
├── LICENSE # MIT License
├── Makefile # Build system
└── README.md # This file
This project demonstrates concepts including:
- TCP/IP protocol manipulation
- Raw socket programming
- Network packet construction
- Checksums and packet integrity
- Denial-of-service attack vectors
This project is licensed under the MIT License - see the LICENSE file for details.
This project was inspired by the SEED Labs project (https://seedsecuritylabs.org/), which provides hands-on laboratory exercises for computer security education.
Mohamed Gebril