This commit is contained in:
Your Name 2024-09-24 21:48:25 -06:00
parent 1aad32eb95
commit 701fab5b6c
11 changed files with 11 additions and 11 deletions

View File

@ -313,15 +313,6 @@ 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
bash $MODULES/module-akkoma-instance.sh "$i" "$DATE"
bash $MODULES/module-akkoma-timeline-public.sh "$i" "$DATE"
bash $MODULES/module-akkoma-timeline-home.sh "$i" "$DATE"
bash $MODULES/module-akkoma-accounts.sh "$i" "$DATE"
bash $MODULES/module-akkoma-search.sh "$i" "$DATE"
bash $MODULES/module-lightning.sh "$i" "$DATE"
bash $MODULES/module-php.sh "$i" "$DATE"
bash $MODULES/module-go.sh "$i" "$DATE"
bash $MODULES/module-get-spam.sh "$i" "$DATE"
COUNT=$(grep $DATE $ACCESS | grep $i | grep -Fivf <(printf '%s\n' "${SAFE_TRAFFIC[@]}") | grep -Fivf <(printf '%s\n' "${SAVED_BOTS[@]}") | wc -l) COUNT=$(grep $DATE $ACCESS | grep $i | grep -Fivf <(printf '%s\n' "${SAFE_TRAFFIC[@]}") | grep -Fivf <(printf '%s\n' "${SAVED_BOTS[@]}") | wc -l)
CHECK=$(cat $NFT_CACHE | sort -u | grep $i) CHECK=$(cat $NFT_CACHE | sort -u | grep $i)

View File

@ -2,6 +2,7 @@
FIREWALL="/opt/firewall/firewall.sh" FIREWALL="/opt/firewall/firewall.sh"
ACCESS="/tmp/minute.log" ACCESS="/tmp/minute.log"
ATTACK="module-akkoma-accounts DDOS Attack " ATTACK="module-akkoma-accounts DDOS Attack "
echo $ATTACK
SEARCH_SPAM=$(grep $2 $ACCESS | grep "api/v1/accounts" | grep $1 | wc -l) SEARCH_SPAM=$(grep $2 $ACCESS | grep "api/v1/accounts" | 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

View File

@ -2,6 +2,7 @@
FIREWALL="/opt/firewall/firewall.sh" FIREWALL="/opt/firewall/firewall.sh"
ACCESS="/tmp/minute.log" ACCESS="/tmp/minute.log"
ATTACK="module-akkoma-instance DDOS Attack " ATTACK="module-akkoma-instance DDOS Attack "
echo $ATTACK
SEARCH_SPAM=$(grep $2 $ACCESS | grep -E "api/v1/instance" | 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) CHECK=$(cat $NFT_CACHE | sort -u | grep $1)
if [[ "$SEARCH_SPAM" -gt 30 ]]; then if [[ "$SEARCH_SPAM" -gt 30 ]]; then

View File

@ -2,6 +2,7 @@
FIREWALL="/opt/firewall/firewall.sh" FIREWALL="/opt/firewall/firewall.sh"
ACCESS="/tmp/minute.log" ACCESS="/tmp/minute.log"
ATTACK="module-akkoma-search DDOS Attack " ATTACK="module-akkoma-search DDOS Attack "
echo $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 10 ]]; then if [[ "$SEARCH_SPAM" -gt 10 ]]; then

View File

@ -2,6 +2,7 @@
FIREWALL="/opt/firewall/firewall.sh" FIREWALL="/opt/firewall/firewall.sh"
ACCESS="/tmp/minute.log" ACCESS="/tmp/minute.log"
ATTACK="module-akkoma-timeline-home DDOS Attack " ATTACK="module-akkoma-timeline-home DDOS Attack "
echo $ATTACK
SEARCH_SPAM=$(grep $2 $ACCESS | grep -E "timelines/home" | grep $1 | wc -l) SEARCH_SPAM=$(grep $2 $ACCESS | grep -E "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

View File

@ -2,6 +2,7 @@
FIREWALL="/opt/firewall/firewall.sh" FIREWALL="/opt/firewall/firewall.sh"
ACCESS="/tmp/minute.log" ACCESS="/tmp/minute.log"
ATTACK="module-akkoma-timeline-public DDOS Attack " ATTACK="module-akkoma-timeline-public DDOS Attack "
echo $ATTACK
SEARCH_SPAM=$(grep $2 $ACCESS | grep "timelines/public" | grep $1 | wc -l) SEARCH_SPAM=$(grep $2 $ACCESS | grep "timelines/public" | 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

View File

@ -2,6 +2,7 @@
FIREWALL="/opt/firewall/firewall.sh" FIREWALL="/opt/firewall/firewall.sh"
ACCESS="/tmp/minute.log" ACCESS="/tmp/minute.log"
ATTACK="module-get-spam DDOS Attack " ATTACK="module-get-spam DDOS Attack "
echo $ATTACK
GET_SPAM=$(grep $2 $ACCESS | grep -E "GET / HTTP" | wc -l) GET_SPAM=$(grep $2 $ACCESS | grep -E "GET / HTTP" | wc -l)
if [[ "$GET_SPAM" -gt 20 ]]; then if [[ "$GET_SPAM" -gt 20 ]]; then
bash $FIREWALL ipBlockParser "$1" bash $FIREWALL ipBlockParser "$1"

View File

@ -2,6 +2,7 @@
FIREWALL="/opt/firewall/firewall.sh" FIREWALL="/opt/firewall/firewall.sh"
ACCESS="/tmp/minute.log" ACCESS="/tmp/minute.log"
ATTACK="module-go DDOS Attack " ATTACK="module-go DDOS Attack "
echo $ATTACK
GO_SPAM=$(grep $2 $ACCESS | grep -E "Go-http-client" | wc -l) GO_SPAM=$(grep $2 $ACCESS | grep -E "Go-http-client" | wc -l)
if [[ "$GO_SPAM" -gt 10 ]]; then if [[ "$GO_SPAM" -gt 10 ]]; then
bash $FIREWALL ipBlockParser "$1" bash $FIREWALL ipBlockParser "$1"

View File

@ -2,6 +2,7 @@
FIREWALL="/opt/firewall/firewall.sh" FIREWALL="/opt/firewall/firewall.sh"
ACCESS="/tmp/minute.log" ACCESS="/tmp/minute.log"
ATTACK="module-lightning DDOS Attack " ATTACK="module-lightning DDOS Attack "
echo $ATTACK
LN_SPAM=$(grep $2 $ACCESS | grep "lnurlp/verita84" | wc -l) LN_SPAM=$(grep $2 $ACCESS | grep "lnurlp/verita84" | wc -l)
if [[ "$LN_SPAM" -gt 5 ]]; then if [[ "$LN_SPAM" -gt 5 ]]; then
bash $FIREWALLipBlockParser "$1" bash $FIREWALLipBlockParser "$1"

View File

@ -1,9 +1,9 @@
#!/bin/bash #!/bin/bash
FIREWALL="/opt/firewall/firewall.sh" FIREWALL="/opt/firewall/firewall.sh"
ACCESS="/tmp/minute.log" ACCESS="/tmp/minute.log"
IP=($(grep $DATE $ACCESS | grep "/block=" | cut -d '=' -f2 | cut -d ' ' -f1 | sed 's/"//')) echo "module-nostr"
IP=($(grep $2 $ACCESS | grep "/block=" | cut -d '=' -f2 | cut -d ' ' -f1 | sed 's/"//'))
for i in "${IP[@]}"; do for i in "${IP[@]}"; do
echo $i
if [[ "$i" == *"npub"* ]]; then if [[ "$i" == *"npub"* ]]; then
bash /opt/strfry-policies/block.sh $i bash /opt/strfry-policies/block.sh $i
else else

View File

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