## IPTABLES TO BLOCK TORRENT (working correctly)
iptables -A INPUT -m string --string "BitTorrent" --algo bm --to 65535 -j DROP
iptables -A INPUT -m string --string "BitTorrent protocol" --algo bm --to 65535 -j DROP
iptables -A INPUT -m string --string "peer_id=" --algo bm --to 65535 -j DROP
iptables -A INPUT -m string --string ".torrent" --algo bm --to 65535 -j DROP
iptables -A INPUT -m string --string "announce.php?passkey=" --algo bm --to 65535 -j DROP
iptables -A INPUT -m string --string "torrent" --algo bm --to 65535 -j DROP
iptables -A INPUT -m string --string "announce" --algo bm --to 65535 -j DROP
iptables -A INPUT -m string --string "info_hash" --algo bm --to 65535 -j DROP
iptables -A INPUT -m string --string "peer_id" --algo kmp --to 65535 -j DROP
iptables -A INPUT -m string --string "BitTorrent" --algo kmp --to 65535 -j DROP
iptables -A INPUT -m string --string "BitTorrent protocol" --algo kmp --to 65535 -j DROP
iptables -A INPUT -m string --string "bittorrent-announce" --algo kmp --to 65535 -j DROP
iptables -A INPUT -m string --string "announce.php?passkey=" --algo kmp --to 65535 -j DROP
iptables -A INPUT -m string --string "find_node" --algo kmp --to 65535 -j DROP
iptables -A INPUT -m string --string "info_hash" --algo kmp --to 65535 -j DROP
iptables -A INPUT -m string --string "get_peers" --algo kmp --to 65535 -j DROP
iptables -A INPUT -m string --string "announce" --algo kmp --to 65535 -j DROP
iptables -A INPUT -m string --string "announce_peers" --algo kmp --to 65535 -j DROP
iptables -A INPUT -m string --string "BitTorrent" --algo bm --to 65535 -j DROP
iptables -A INPUT -m string --string "BitTorrent protocol" --algo bm --to 65535 -j DROP
iptables -A INPUT -m string --string "peer_id=" --algo bm --to 65535 -j DROP
iptables -A INPUT -m string --string ".torrent" --algo bm --to 65535 -j DROP
iptables -A INPUT -m string --string "announce.php?passkey=" --algo bm --to 65535 -j DROP
iptables -A INPUT -m string --string "torrent" --algo bm --to 65535 -j DROP
iptables -A INPUT -m string --string "announce" --algo bm --to 65535 -j DROP
iptables -A INPUT -m string --string "info_hash" --algo bm --to 65535 -j DROP
iptables -A INPUT -m string --string "peer_id" --algo kmp --to 65535 -j DROP
iptables -A INPUT -m string --string "BitTorrent" --algo kmp --to 65535 -j DROP
iptables -A INPUT -m string --string "BitTorrent protocol" --algo kmp --to 65535 -j DROP
iptables -A INPUT -m string --string "bittorrent-announce" --algo kmp --to 65535 -j DROP
iptables -A INPUT -m string --string "announce.php?passkey=" --algo kmp --to 65535 -j DROP
iptables -A INPUT -m string --string "find_node" --algo kmp --to 65535 -j DROP
iptables -A INPUT -m string --string "info_hash" --algo kmp --to 65535 -j DROP
iptables -A INPUT -m string --string "get_peers" --algo kmp --to 65535 -j DROP
iptables -A INPUT -m string --string "announce" --algo kmp --to 65535 -j DROP
iptables -A INPUT -m string --string "announce_peers" --algo kmp --to 65535 -j DROP
hi. Thanks for your post. I am new to ubuntu. Can the following rules be used on ubuntu server 12.04? how can i implement them. Thanks
ReplyDeleteyes you can use it in any version of Linux.
DeleteYou can implement them by running the command as for example sudo iptables -A INPUT -m string --string "BitTorrent" --algo bm --to 65535 -j DROP
Deletehi. Does this block torrents 100% or does it just slow them down?
ReplyDeleteyes it block torrents 100%...
DeleteThis comment has been removed by the author.
ReplyDeleteStep to step guide?
ReplyDeletesorry don't work...test in my centos 6.7 x64..
ReplyDeletehow to deployed it? if iptables is running with these rules and all traffic of source machines are passing through this machine then it will block p2p traffic 100%
DeleteHi,
ReplyDeleteIt doesn't block the seed the torrent
@Usman
Deleteif you routed all your traffic to this proxy machine and iptables is running with these rules then it blocks p2p traffic 100%
you can check it by using 'tcpdump -i eth0' by grepping above mentioned p2p strings.
How can you claim that this solution is 100%? How it will stop torrents traffic on HTTPS?
ReplyDeleteIf you are wondering how to hide IP address when downloading a torrent, top choice should be via best VPN for torrenting. There are multiple other options when it comes to hiding your torrenting activity, but a VPN is by far the most convenient and easiest to set up.
ReplyDeleteUmm, looks quite interesting thread. As we all know that there are 1000's of other things we can do to block IP address but I personally think VPN is one of the best so far. Plus, vpn with cheap torrent services is great. well, good luck! x
ReplyDeleteI have read all the comments and suggestions posted by the visitors for this article are very fine,We will wait for your next article so only.Thanks! yggtorrent
ReplyDelete