Skip to content

Instantly share code, notes, and snippets.

View zabustak's full-sized avatar
💭
I may be slow to respond.

Zabustak Narvorsky zabustak

💭
I may be slow to respond.
View GitHub Profile
@zabustak
zabustak / ddos.conf
Created December 24, 2022 22:47 — forked from mattia-beta/ddos.conf
IPtables DDoS Protection for VPS
### 1: Drop invalid packets ###
/sbin/iptables -t mangle -A PREROUTING -m conntrack --ctstate INVALID -j DROP
### 2: Drop TCP packets that are new and are not SYN ###
/sbin/iptables -t mangle -A PREROUTING -p tcp ! --syn -m conntrack --ctstate NEW -j DROP
### 3: Drop SYN packets with suspicious MSS value ###
/sbin/iptables -t mangle -A PREROUTING -p tcp -m conntrack --ctstate NEW -m tcpmss ! --mss 536:65535 -j DROP
### 4: Block packets with bogus TCP flags ###