NOTE: BitHammer is FOR RESEARCH
PURPOSES ONLY.
Get permission from a network's
owner before using it.
You assume all responsibility
for it's use.
BitTorrent is ok. Using BitTorrent on your own network is your own business. Using BitTorrent on public wifi is not. BitTorrent aggressively soaks up bandwidth and connections, rendering other programs useless, and other users and admins frustrated.
http://askubuntu.com/questions/16680/using-a-bittorrent-client-slows-down-internet-connection
Over a year of traveling, I've consistently struggled with broken wifi spots overloaded with torrent traffic. After talking with the frustrated non-technical people who owned/managed them, I wrote this program to help network users and owners.
This program:
- Listens for BitTorrent clients on the network,
- Adds their IPs and MACs to a ban list,
- Bans them from the network for as long as the program is running.
Install python
, scapy
, and git
:
sudo apt-get install python python-scapy git
Run the program:
git clone git@github.com:MichaelJCole/bithammer.git
cd bithammer
sudo python ./bithammer
The scapy
network library requires sudo
for root priviledges. Built and tested with Python 2.7.6. This is my first Python program :)
In theory, BitHammer should work outside Linux, but I don't care to test it. Code and documentation pull requests are welcome. This may help to install scapy
- the networking library used.
The program listens for BitTorrent users advertising themselves via LPD:
http://en.wikipedia.org/wiki/Local_Peer_Discovery
The program then bans those users from the network via ARP Cache poisoning:
http://en.wikipedia.org/wiki/ARP_spoofing
Network Traffic to/from the banned computer is redirected to your computer, which your computer ignores because it's improperly addressed. This effectively bans the target from the network.
ARP cache poisoning continues as long as the program is running. Restarting the program clears the ban list. It may take some time for the ban to clear.
I am not a lawyer. I recommend the courtesy of getting permission before using it on someone else's network.
There are a variety of reasons it may not work as you would like.
- The wifi access point may isolate users from each other, preventing LPD
- BitTorrent clients may be on another sub-net, preventing LPD
- BitTorrent clients may not be advertising with LDP
- You're bandwidth problem may unrelated to BitTorrent
- Something else
Climate change, ocean fishery collapse, and crappy wifi are all tradgedies of the commons.
http://en.wikipedia.org/wiki/Tragedy_of_the_commons
It's not personal. It's just that your ignorance and selfishness are ruining things for everyone else.
The best workaround to BitHammer is to get a 'private internet VPN' and run your BitTorrent traffic through that. Google it. This will:
- Prevent BitHammer from banning you,
- Keep your usage to levels home internet routers can handle,
- Prevent the WiFi owner from getting file-sharing letters from lawyers.
Yes, alternatives include:
- Block BitTorrent on your router
- Configuring traffic QOS on the router
- Banning user's on the router
These are advanced router configurations and may be confusing to the average user and 'home' router equipment:
Login to your router with the admin password:
- Get your router's IP address (e.g. 192.168.1.1)
- Open http://192.168.1.1 in a web browser
- Login with your admin password
Configure your router:
- To block BitTorrent, block ports 6881 to 6999 (easy, but not always effective)
- To block devices, use the MAC ids from BitHammer: http://blog.dlink.com/how-to-block-devices-from-your-home-network/
- To slow down BitTorrent so other traffic takes precedence, configure "Traffic Shaping" or "Quality of Service (QoS)" - this depends on your router.