This commit is contained in:
Your Name 2024-09-25 03:29:23 +00:00
commit cf462bf279
3 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,17 @@
#!/bin/bash
FIREWALL="/opt/firewall/firewall.sh"
ACCESS="/tmp/minute.log"
ATTACK="module-akkoma-accounts DDOS Attack "
SEARCH_SPAM=$(grep $2 $ACCESS | grep "api/v1/accounts" | 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

View File

@ -0,0 +1,17 @@
#!/bin/bash
FIREWALL="/opt/firewall/firewall.sh"
ACCESS="/tmp/minute.log"
ATTACK="module-akkoma-instance DDOS Attack "
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
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

View File

@ -0,0 +1,16 @@
#!/bin/bash
FIREWALL="/opt/firewall/firewall.sh"
ACCESS="/tmp/minute.log"
ATTACK="module-akkoma-search DDOS Attack "
SEARCH_SPAM=$(grep $2 $ACCESS | grep "api/v2/search" | grep $1 | wc -l)
CHECK=$(cat $NFT_CACHE | sort -u | grep $1)
if [[ "$SEARCH_SPAM" -gt 10 ]]; then
echo "$IP $CHECK $COUNT"
if [ "$CHECK" = "" ]; then
bash $FIREWALLipBlockParser "$1"
bash $FIREWALL message "$ATTACK $1"
redis-cli SADD tmp_block $1
else
echo "$ATTACK Ignoring Duplicate IP: $1"
fi
fi