Created
June 29, 2015 18:21
-
-
Save dlangille/b42209ea16da256d8578 to your computer and use it in GitHub Desktop.
When FreshPorts gets hit by torrent seekers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm garbage | |
grep '"-" 408 - "-" "-"' /usr/websites/log/freshports.org-access.log | cut -f 1 -d ' ' > garbage | |
grep Bittorrent /usr/websites/log/freshports.org-access.log | cut -f 1 -d ' ' >> garbage | |
grep microsoftupdate /usr/websites/log/freshports.org-access.log | cut -f 1 -d ' ' >> garbage | |
grep 'GET /announce?info_hash=' /usr/websites/log/freshports.org-access.log | cut -f 1 -d ' ' >> garbage | |
sort garbage | uniq > allbad | |
sudo mv allbad /usr/local/etc/bittorent-clients | |
sudo pfctl -t bittorent-clients -T replace -f /usr/local/etc/bittorent-clients | |
egrep '"-" 408 - "-" "-"|Bittorrent|microsoftupdate|info_hash|GET /iframe.php|GET /feeds/page.php|GET /banners' /usr/websites/log/freshports.org-access.log | cut -f 1 -d ' ' >> garbage | |
sort garbage | uniq | grep -v 96.245.100.201 > allbad | |
sudo mv allbad /usr/local/etc/bittorent-clients | |
sudo pfctl -t bittorent-clients -T replace -f /usr/local/etc/bittorent-clients | |
tail -F freshports.org-access.log | egrep '"-" 408 - "-" "-"|Bittorrent|microsoftupdate|info_hash|GET /iframe.php|GET /feeds/page.php|GET /banners' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment