update ddos-mitigator.sh

This commit is contained in:
Manuel Friedli 2020-06-23 02:16:37 +02:00
parent 1a3f09c047
commit a18272ac23

View file

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
input_files=/var/log/apache2/access_*.log input_files=/var/log/apache2/access_*.log
date="14/Jun/2020:18:" date="20/Jun/2020:18"
tmpdir=$(mktemp -d) tmpdir=$(mktemp -d)
cd "${tmpdir}" cd "${tmpdir}"
@ -19,3 +19,6 @@ cut -d. -f1 raw-ipv4.txt | sort | uniq -c | sort -n > sorted-ipv4-8.txt
chmod o+rx "${tmpdir}" chmod o+rx "${tmpdir}"
echo "Have fun in ${tmpdir}!" echo "Have fun in ${tmpdir}!"
grep -E '^ *[0-9]{4,5} ' "${tmpdir}/sorted-ipv4-32.txt" |tr -s '[:blank:]' | cut -d' ' -f3