From e84381825b539d2f31600d992f020a8f16785fdf Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Mon, 22 Jun 2020 20:50:19 +0200 Subject: [PATCH] add http-lister.sh --- ddos-mitigator/http-lister.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 ddos-mitigator/http-lister.sh diff --git a/ddos-mitigator/http-lister.sh b/ddos-mitigator/http-lister.sh new file mode 100755 index 0000000..c1977e4 --- /dev/null +++ b/ddos-mitigator/http-lister.sh @@ -0,0 +1,13 @@ +#!/bin/sh +input_files=/var/log/apache2/access_*.log +tmpdir=$(mktemp -d) + +cd "${tmpdir}" +netstat -nat |grep 94.199.214.20:443|tr -s '[:blank:]'|cut -d' ' -f5|cut -d: -f1 | sort > raw-http.txt + +uniq -c raw-http.txt | sort -n > sorted-http.txt +cut -d. -f1-3 raw-http.txt | sort | uniq -c | sort -n > sorted-http-24.txt +cut -d. -f1-2 raw-http.txt | sort | uniq -c | sort -n > sorted-http-16.txt +cut -d. -f1 raw-http.txt | sort | uniq -c | sort -n > sorted-http-8.txt + +echo "Have fun in ${tmpdir}!"