Skip to content

Instantly share code, notes, and snippets.

View Ahmah2009's full-sized avatar
:electron:
Overthinking

Ahmad M ElShareif Ahmah2009

:electron:
Overthinking
View GitHub Profile
@Ahmah2009
Ahmah2009 / gist:e09d72ed6b2280b5c45e5eb568f1a743
Created November 8, 2018 11:14 — forked from dmytro/gist:7887843
Shell script for SYN flood DOS attacks prevention. Use sqlite3 to filter IP's
#!/bin/bash
SLEEP=120
MAX_CONN=20
MY_IP=0.0.0.0 # Configure your IP here
while true; do
(
echo "create table ips (ip string);"
echo 'begin transaction;'
netstat -an | grep -v ESTABLISHED | grep ${MY_IP}:80 | awk '{print $5}' | cut -f4 -d: | while read IP; do
#!/bin/bash
# Script iptables by olto
# Réinitialisation
iptables -F
echo - Réinitialisation... : [OK]
# Suppression des chaînes utilisateurs