From 95a4eebe1a9359b834f7bfde5287f3d2035c6cab Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 24 Sep 2024 21:18:59 -0600 Subject: [PATCH] fix --- modules/module-go.sh | 10 ++++++++++ modules/module-php.sh | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 modules/module-go.sh create mode 100644 modules/module-php.sh diff --git a/modules/module-go.sh b/modules/module-go.sh new file mode 100644 index 0000000..3136016 --- /dev/null +++ b/modules/module-go.sh @@ -0,0 +1,10 @@ +#!/bin/bash +FIREWALL="/opt/firewall/firewall.sh" +ACCESS="/tmp/minute.log" +ATTACK="module-go DDOS Attack " +GO_SPAM=$(grep $2 $ACCESS | grep -E "Go-http-client" | wc -l) +if [[ "$GO_SPAM" -gt 10 ]]; then + ./firewall.sh ipBlockParser "$1" + redis-cli SADD tmp_block $1 + bash $FIREWALL message "$ATTACK $1" +fi diff --git a/modules/module-php.sh b/modules/module-php.sh new file mode 100644 index 0000000..eddceb2 --- /dev/null +++ b/modules/module-php.sh @@ -0,0 +1,10 @@ +#!/bin/bash +FIREWALL="/opt/firewall/firewall.sh" +ACCESS="/tmp/minute.log" +ATTACK="module-php DDOS Attack " +PHP_SPAM=$(grep $2 $ACCESS | grep -E ".php|cgi-bin|wp-content|wp-admin|wp-includes" | wc -l) +if [[ "$PHP_SPAM" -gt 10 ]]; then + ./firewall.sh ipBlockParser "$1" + redis-cli SADD tmp_block $1 + bash $FIREWALL message "$ATTACK $1" +fi