This commit is contained in:
Your Name 2024-09-24 22:30:26 -06:00
parent 2e89c04dc5
commit cf65b1fd61
9 changed files with 18 additions and 18 deletions

View File

@ -2,14 +2,14 @@
FIREWALL="/opt/firewall/firewall.sh"
NFT_CACHE='/tmp/nft.cache'
ACCESS="/tmp/minute.log"
ATTACK="module-akkoma-accounts DDOS Attack "
ATTACK="module-akkoma-accounts"
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 $FIREWALL ipBlockParser "$1"
bash $FIREWALL message "$ATTACK $1"
bash $FIREWALL message "$ATTACK-$1"
redis-cli SADD tmp_block $1
echo "$ATTACK $1"
else

View File

@ -2,14 +2,14 @@
FIREWALL="/opt/firewall/firewall.sh"
NFT_CACHE='/tmp/nft.cache'
ACCESS="/tmp/minute.log"
ATTACK="module-akkoma-instance DDOS Attack "
ATTACK="module-akkoma-instance"
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 $FIREWALL ipBlockParser "$1"
bash $FIREWALL message "$ATTACK $1"
bash $FIREWALL message "$ATTACK-$1"
redis-cli SADD tmp_block $1
echo "$ATTACK $1"
else

View File

@ -2,14 +2,14 @@
FIREWALL="/opt/firewall/firewall.sh"
NFT_CACHE='/tmp/nft.cache'
ACCESS="/tmp/minute.log"
ATTACK="module-akkoma-search DDOS Attack "
ATTACK="module-akkoma-search"
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 $FIREWALL ipBlockParser "$1"
bash $FIREWALL message "$ATTACK $1"
bash $FIREWALL message "$ATTACK-$1"
redis-cli SADD tmp_block $1
else
echo "$ATTACK Ignoring Duplicate IP: $1"

View File

@ -2,14 +2,14 @@
FIREWALL="/opt/firewall/firewall.sh"
NFT_CACHE='/tmp/nft.cache'
ACCESS="/tmp/minute.log"
ATTACK="module-akkoma-timeline-home DDOS Attack "
ATTACK="module-akkoma-timeline-home"
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 $FIREWALL ipBlockParser "$1"
bash $FIREWALL message "$ATTACK $1"
bash $FIREWALL message "$ATTACK-$1"
redis-cli SADD tmp_block $1
echo "$ATTACK $1"
else

View File

@ -2,14 +2,14 @@
FIREWALL="/opt/firewall/firewall.sh"
NFT_CACHE='/tmp/nft.cache'
ACCESS="/tmp/minute.log"
ATTACK="module-akkoma-timeline-public DDOS Attack "
ATTACK="module-akkoma-timeline-public"
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 $FIREWALL ipBlockParser "$1"
bash $FIREWALL message "$ATTACK $1"
bash $FIREWALL message "$ATTACK-$1"
redis-cli SADD tmp_block $1
echo "$ATTACK $1"
else

View File

@ -1,10 +1,10 @@
#!/bin/bash
FIREWALL="/opt/firewall/firewall.sh"
ACCESS="/tmp/minute.log"
ATTACK="module-get-spam DDOS Attack "
ATTACK="module-get-spam"
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"
bash $FIREWALL message "$ATTACK-$1"
redis-cli SADD tmp_block $1
fi

View File

@ -1,10 +1,10 @@
#!/bin/bash
FIREWALL="/opt/firewall/firewall.sh"
ACCESS="/tmp/minute.log"
ATTACK="module-go DDOS Attack "
ATTACK="module-go"
GO_SPAM=$(grep $2 $ACCESS | grep -E "Go-http-client" | wc -l)
if [[ "$GO_SPAM" -gt 10 ]]; then
bash $FIREWALL ipBlockParser "$1"
bash $FIREWALL message "$ATTACK $1"
bash $FIREWALL message "$ATTACK-$1"
redis-cli SADD tmp_block $1
fi

View File

@ -1,10 +1,10 @@
#!/bin/bash
FIREWALL="/opt/firewall/firewall.sh"
ACCESS="/tmp/minute.log"
ATTACK="module-lightning DDOS Attack "
ATTACK="module-lightning"
LN_SPAM=$(grep $2 $ACCESS | grep "lnurlp/verita84" | wc -l)
if [[ "$LN_SPAM" -gt 5 ]]; then
bash $FIREWALL ipBlockParser "$1"
bash $FIREWALL message "$ATTACK $1"
bash $FIREWALL message "$ATTACK-$1"
redis-cli SADD tmp_block $1
fi

View File

@ -1,10 +1,10 @@
#!/bin/bash
FIREWALL="/opt/firewall/firewall.sh"
ACCESS="/tmp/minute.log"
ATTACK="module-php DDOS Attack "
ATTACK="module-php"
PHP_SPAM=$(grep $2 $ACCESS | grep -E ".php|cgi-bin|wp-content|wp-admin|wp-includes" | wc -l)
if [[ "$PHP_SPAM" -gt 10 ]]; then
bash $FIREWALL ipBlockParser "$1"
bash $FIREWALL message "$ATTACK $1"
bash $FIREWALL message "$ATTACK-$1"
redis-cli SADD tmp_block $1
fi