Merge branch 'main' of https://git.poster.place/verita84/firewall
This commit is contained in:
commit
986b619aa7
17
modules/module-akkoma-timeline-home.sh
Normal file
17
modules/module-akkoma-timeline-home.sh
Normal file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
FIREWALL="/opt/firewall/firewall.sh"
|
||||
ACCESS="/tmp/minute.log"
|
||||
ATTACK="module-akkoma-timeline-home DDOS Attack "
|
||||
SEARCH_SPAM=$(grep $2 $ACCESS | grep -E "timelines/home" | grep $1 | wc -l)
|
||||
CHECK=$(cat $NFT_CACHE | sort -u | grep $1)
|
||||
if [[ "$SEARCH_SPAM" -gt 30 ]]; then
|
||||
echo "$IP $CHECK $COUNT"
|
||||
if [ "$CHECK" = "" ]; then
|
||||
bash $FIREWALLipBlockParser "$1"
|
||||
bash $FIREWALL message "$ATTACK $1"
|
||||
redis-cli SADD tmp_block $1
|
||||
echo "$ATTACK $1"
|
||||
else
|
||||
echo "$ATTACK Ignoring Duplicate IP: $1"
|
||||
fi
|
||||
fi
|
17
modules/module-akkoma-timeline-public.sh
Normal file
17
modules/module-akkoma-timeline-public.sh
Normal file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
FIREWALL="/opt/firewall/firewall.sh"
|
||||
ACCESS="/tmp/minute.log"
|
||||
ATTACK="module-akkoma-timeline-public DDOS Attack "
|
||||
SEARCH_SPAM=$(grep $2 $ACCESS | grep "timelines/public" | grep $1 | wc -l)
|
||||
CHECK=$(cat $NFT_CACHE | sort -u | grep $1)
|
||||
if [[ "$SEARCH_SPAM" -gt 30 ]]; then
|
||||
echo "$IP $CHECK $COUNT"
|
||||
if [ "$CHECK" = "" ]; then
|
||||
bash $FIREWALLipBlockParser "$1"
|
||||
bash $FIREWALL message "$ATTACK $1"
|
||||
redis-cli SADD tmp_block $1
|
||||
echo "$ATTACK $1"
|
||||
else
|
||||
echo "$ATTACK Ignoring Duplicate IP: $1"
|
||||
fi
|
||||
fi
|
10
modules/module-get-spam.sh
Normal file
10
modules/module-get-spam.sh
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
FIREWALL="/opt/firewall/firewall.sh"
|
||||
ACCESS="/tmp/minute.log"
|
||||
ATTACK="module-get-spam DDOS Attack "
|
||||
GET_SPAM=$(grep $2 $ACCESS | grep -E "GET / HTTP" | wc -l)
|
||||
if [[ "$GET_SPAM" -gt 20 ]]; then
|
||||
bash $FIREWALL ipBlockParser "$1"
|
||||
bash $FIREWALL message "$ATTACK $1"
|
||||
redis-cli SADD tmp_block $1
|
||||
fi
|
Loading…
Reference in New Issue
Block a user