Commit 36b09e76 authored by Alynna Trypnotk's avatar Alynna Trypnotk

Catch only "bot" inside the user-agent string LAWL

parent 48820d7e
Pipeline #19 failed with stages
...@@ -19,7 +19,7 @@ ip6tables -t filter -F RTBL >/dev/null 2>&1 || true ...@@ -19,7 +19,7 @@ ip6tables -t filter -F RTBL >/dev/null 2>&1 || true
ip6tables -t filter -X RTBL >/dev/null 2>&1 || true ip6tables -t filter -X RTBL >/dev/null 2>&1 || true
ip6tables -t filter -N RTBL >/dev/null 2>&1 || true ip6tables -t filter -N RTBL >/dev/null 2>&1 || true
ip6tables -t filter -A INPUT ! -s 2603:300b:768:b000::/64 -j RTBL ip6tables -t filter -A INPUT ! -s 2603:300b:768:b000::/64 -j RTBL
tail -n 10000 /var/log/nginx/access.log | egrep -iv "google|yahoo|bing" | grep -i "bot" | cut -d' ' -f1 | uniq > /var/cache/bots tail -n 10000 /var/log/nginx/access.log | egrep -iv "google|yahoo|bing" | egrep -i "\(.*bot.*\)" | cut -d' ' -f1 | uniq > /var/cache/bots
for j in $(cat /var/cache/bots); do for j in $(cat /var/cache/bots); do
if [[ $j == *.*.*.* ]]; then if [[ $j == *.*.*.* ]]; then
iptables -I BOTBLOCKER -t filter -s $j -j DROP iptables -I BOTBLOCKER -t filter -s $j -j DROP
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment