All Projects → sammwyy → ddos-mitigation

sammwyy / ddos-mitigation

Licence: other
Tips to mitigate and secure your large-scale server against DDoS attacks.

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to ddos-mitigation

anti-ddos-lite
Anti-DDoS-Lite (Anti-Crawler app) is a small PHP app to protect your site against DDoS attack.
Stars: ✭ 96 (+65.52%)
Mutual labels:  ddos, ddos-attacks, ddos-mitigation
Raven-Storm
Raven-Storm is a powerful DDoS toolkit for penetration tests, including attacks for several protocols written in python. Takedown many connections using several exotic and classic protocols.
Stars: ✭ 235 (+305.17%)
Mutual labels:  ddos, ddos-attacks
ddos
Simple dos attack utility
Stars: ✭ 36 (-37.93%)
Mutual labels:  ddos, ddos-attacks
Fastnetmon
FastNetMon - very fast DDoS sensor with sFlow/Netflow/IPFIX/SPAN support
Stars: ✭ 2,860 (+4831.03%)
Mutual labels:  ddos, ddos-mitigation
PoW-Shield
Project dedicated to fight Layer 7 DDoS with proof of work, featuring an additional WAF. Completed with full set of features and containerized for rapid and lightweight deployment.
Stars: ✭ 99 (+70.69%)
Mutual labels:  ddos, ddos-mitigation
Pummel
Socks5 Proxy HTTP/HTTPS-Flooding (cc) attack
Stars: ✭ 53 (-8.62%)
Mutual labels:  ddos, ddos-attacks
UnboundBL
🛑 DNSBL (adblock) on OPNsense with UnboundBL & Unbound DNS
Stars: ✭ 63 (+8.62%)
Mutual labels:  firewall, iptables
Iptables Boilerplate
rock solid default firewall-rules for webhosts
Stars: ✭ 249 (+329.31%)
Mutual labels:  firewall, iptables
AMP-Research
Research on UDP/TCP amplification vectors, payloads and mitigations against their use in DDoS Attacks
Stars: ✭ 246 (+324.14%)
Mutual labels:  ddos, ddos-attacks
Mignis
Mignis is a semantic based tool for firewall configuration.
Stars: ✭ 43 (-25.86%)
Mutual labels:  firewall, iptables
DDOS Detection
ddos attack detector using ML Algorithms
Stars: ✭ 38 (-34.48%)
Mutual labels:  ddos, ddos-attacks
Aoyama
A New version of Python3 botnet, old version: http://github.com/Leeon123/Python3-botnet
Stars: ✭ 161 (+177.59%)
Mutual labels:  ddos, ddos-attacks
Anti-DDOS-Script
Anti DDOS Protection that will stop DDOS from taking down your Linux Server
Stars: ✭ 51 (-12.07%)
Mutual labels:  ddos, firewall
epiphany
A pre-DDoS security assessment tool
Stars: ✭ 106 (+82.76%)
Mutual labels:  ddos, ddos-mitigation
sqredirect
Redirection and filtering Source Engine game traffic in bundle with sqproxy
Stars: ✭ 21 (-63.79%)
Mutual labels:  ddos, ddos-mitigation
websploit
Websploit is an advanced MITM framework.
Stars: ✭ 105 (+81.03%)
Mutual labels:  ddos, ddos-attacks
Net Shield
An Easy and Simple Anti-DDoS solution for VPS,Dedicated Servers and IoT devices - Beta
Stars: ✭ 202 (+248.28%)
Mutual labels:  firewall, iptables
Polycube
eBPF/XDP-based software framework for fast network services running in the Linux kernel.
Stars: ✭ 217 (+274.14%)
Mutual labels:  firewall, iptables
Secure Wireguard Implementation
A guide on implementing a secure Wireguard server on OVH (or any other Debian VPS) with DNSCrypt, Port Knocking & an SSH-Honeypot
Stars: ✭ 200 (+244.83%)
Mutual labels:  ddos, iptables
awesome-ddos-tools
Collection of several DDos tools.
Stars: ✭ 75 (+29.31%)
Mutual labels:  ddos, ddos-attacks

DDoS Mitigation (Pending Re-Work)

Files

Zeroline This script automatically and safely installs all the iptables rules and kernel modifications that are in this repository instantly.
Download v1.0

DEPRECATED Use Kernel Tweaks instead.

Disclaimer

Some rules may interfere with the functioning of the tools and tips in this repository. Make sure you have an emergency method to disable the Firewall or revert the changes made with this repository in case you lose access to the server.

Index

Kernel Modifications

Drop ICMP ECHO-Requests

To prevent smurf attack.

echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts

Dont accept ICMP Redirect

To prevent smurf attack.

echo 0 > /proc/sys/net/ipv4/conf/all/accept_redirects

Drop source routed packets

echo 0 > /proc/sys/net/ipv4/conf/all/accept_source_route

Enable SYN-Cookie for prevent SYN Flood

To prevent SYN Flood and TCP Starvation.

sysctl -w net/ipv4/tcp_syncookies=1
sysctl -w net/ipv4/tcp_timestamps=1

Increase TCP SYN backlog

To prevent TCP Starvation.

echo 2048 > /proc/sys/net/ipv4/tcp_max_syn_backlog

Decrease TCP SYN-ACK retries

To prevent TCP Starvation.

echo 3 > /proc/sys/net/ipv4/tcp_synack_retries

Enable Address Spoofing Protection

To prevent IP Spoof.

echo 1 > /proc/sys/net/ipv4/conf/all/rp_filter

Disable SYN Packet tracking

To prevent the system from using resources tracking SYN Packets.

sysctl -w net/netfilter/nf_conntrack_tcp_loose=0

IPTables

Drop Invalid Packets

Drop invalid packets with invalid or unknown status.

iptables -A INPUT -m state --state INVALID -j DROP

Block packets with bogus TCP flags

iptables -t mangle -A PREROUTING -p tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags FIN,SYN FIN,SYN -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags SYN,FIN SYN,FIN -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags FIN,RST FIN,RST -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags FIN,ACK FIN -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags ACK,URG URG -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags ACK,FIN FIN -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags ACK,PSH PSH -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags ALL ALL -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags ALL NONE -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags ALL FIN,PSH,URG -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags ALL SYN,FIN,PSH,URG -j DROP
iptables -t mangle -A PREROUTING -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j DROP

Drop ICMP

To prevent Smurf Attack.

iptables -t mangle -A PREROUTING -p icmp -j DROP

Drop Fragments in all Chains

iptables -t mangle -A PREROUTING -f -j DROP

Limit connections per IP

iptables -A INPUT -p tcp -m connlimit --connlimit-above 18 -j REJECT --reject-with tcp-reset

Limit RST Packets

iptables -A INPUT -p tcp --tcp-flags RST RST -m limit --limit 2/s --limit-burst 2 -j ACCEPT
iptables -A INPUT -p tcp --tcp-flags RST RST -j DROP

Use of SYN-PROXY

iptables -t raw -A PREROUTING -p tcp -m tcp --syn -j CT --notrack
iptables -A INPUT -p tcp -m tcp -m conntrack --ctstate INVALID,UNTRACKED -j SYNPROXY --sack-perm --timestamp --wscale 7 --mss 1460
iptables -A INPUT -m state --state INVALID -j DROP

Prevent SSH Bruteforce

iptables -A INPUT -p tcp --dport ssh -m conntrack --ctstate NEW -m recent --set
iptables -A INPUT -p tcp --dport ssh -m conntrack --ctstate NEW -m recent --update --seconds 60 --hitcount 10 -j DROP

Prevent Port Scanner

iptables -N port-scanning
iptables -A port-scanning -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit --limit 1/s --limit-burst 2 -j RETURN
iptables -A port-scanning -j DROP

Sources

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].