fix
This commit is contained in:
parent
ce40e57ae7
commit
f6bc71762c
27
firewall.sh
27
firewall.sh
@ -337,7 +337,7 @@ module-akkoma-search() {
|
|||||||
ATTACK="module-akkoma-search DDOS Attack "
|
ATTACK="module-akkoma-search DDOS Attack "
|
||||||
SEARCH_SPAM=$(grep $2 $ACCESS | grep "api/v2/search" | grep $1 | wc -l)
|
SEARCH_SPAM=$(grep $2 $ACCESS | grep "api/v2/search" | grep $1 | wc -l)
|
||||||
CHECK=$(cat $NFT_CACHE | sort -u | grep $1)
|
CHECK=$(cat $NFT_CACHE | sort -u | grep $1)
|
||||||
if [[ "$SEARCH_SPAM" -gt 30 ]]; then
|
if [[ "$SEARCH_SPAM" -gt 10 ]]; then
|
||||||
echo "$IP $CHECK $COUNT"
|
echo "$IP $CHECK $COUNT"
|
||||||
if [ "$CHECK" = "" ]; then
|
if [ "$CHECK" = "" ]; then
|
||||||
ipBlockParser "$1"
|
ipBlockParser "$1"
|
||||||
@ -350,9 +350,25 @@ module-akkoma-search() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
module-akkoma() {
|
module-akkoma-instance() {
|
||||||
ATTACK="module-akkoma DDOS Attack "
|
ATTACK="module-akkoma-instance DDOS Attack "
|
||||||
SEARCH_SPAM=$(grep $2 $ACCESS | grep -E "api/v1/instance|api/v1/notifications|timelines/public|timelines/home" | grep $1 | wc -l)
|
SEARCH_SPAM=$(grep $2 $ACCESS | grep -E "api/v1/instance" | 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
|
||||||
|
ipBlockParser "$1"
|
||||||
|
redis-cli SADD tmp_block $1
|
||||||
|
message "$ATTACK $1"
|
||||||
|
echo "$ATTACK $1"
|
||||||
|
else
|
||||||
|
echo "$ATTACK Ignoring Duplicate IP: $1"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
module-akkoma-timelines() {
|
||||||
|
ATTACK="module-akkoma-timelines DDOS Attack "
|
||||||
|
SEARCH_SPAM=$(grep $2 $ACCESS | grep -E "timelines/public|timelines/home" | grep $1 | wc -l)
|
||||||
CHECK=$(cat $NFT_CACHE | sort -u | grep $1)
|
CHECK=$(cat $NFT_CACHE | sort -u | grep $1)
|
||||||
if [[ "$SEARCH_SPAM" -gt 30 ]]; then
|
if [[ "$SEARCH_SPAM" -gt 30 ]]; then
|
||||||
echo "$IP $CHECK $COUNT"
|
echo "$IP $CHECK $COUNT"
|
||||||
@ -403,7 +419,8 @@ watch() {
|
|||||||
IP=($(grep $DATE $ACCESS | grep -Fivf <(printf '%s\n' "${SAFE_TRAFFIC[@]}") | grep -Fivf <(printf '%s\n' "${CRAWLER_DB[@]}") | grep -Fivf <(printf '%s\n' "${SAVED_BOTS[@]}") | grep -vi $MY_IP | grep -vi '127.0.0.1' | cut -d ' ' -f1 | sort -u))
|
IP=($(grep $DATE $ACCESS | grep -Fivf <(printf '%s\n' "${SAFE_TRAFFIC[@]}") | grep -Fivf <(printf '%s\n' "${CRAWLER_DB[@]}") | grep -Fivf <(printf '%s\n' "${SAVED_BOTS[@]}") | grep -vi $MY_IP | grep -vi '127.0.0.1' | cut -d ' ' -f1 | sort -u))
|
||||||
|
|
||||||
for i in "${IP[@]}"; do
|
for i in "${IP[@]}"; do
|
||||||
module-akkoma "$i" "$DATE"
|
module-akkoma-instance "$i" "$DATE"
|
||||||
|
module-akkoma-timelines "$i" "$DATE"
|
||||||
module-akkoma-accounts "$i" "$DATE"
|
module-akkoma-accounts "$i" "$DATE"
|
||||||
module-akkoma-search "$i" "$DATE"
|
module-akkoma-search "$i" "$DATE"
|
||||||
module-lightning "$i" "$DATE"
|
module-lightning "$i" "$DATE"
|
||||||
|
Loading…
Reference in New Issue
Block a user