Skip to content

sorz/bt-tracker-helper

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

BitTorrent Tracker Firewall Helper

Chinese (中文)

It's known that detecting BT traffic itself is difficult. However, in most of time, BT client will connect to some tracker servers during running. This kind of connections can be detected easily by a few of firewall rules.

This program try to simplify the process of configuring firewalls to detect connections with BT tracker servers by providing the following two functions:

  • Reading tracker server addresses from a set of torrents.
  • Resolve server name, and generate firewall rules.

Example

Collect tracker servers from torrent files, then add them to ipset blacklist:

$ ./trackers.py torrent *.torrent > trackers.txt
$ ./trackers.py ipset blacklist trackers.txt > ipset-rules
# ipset restore -file ipset.rules

Or by one line:

# ./trackers.py torrent *.torrent | ./trackers.py ipset blacklist - | ipset restore

You may use iptables to match this ipset, and do filter, logging or something.

Generating iptables commands directly is also supported by ./trackers.py iptables command. If you want more custom, try ./trackers.py raw, which print address, protocol and port number without any other addition information.

About

Help create firewall rules to detect BT connections.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages