Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Kill Mapped Ports (Annoy Your Room Mates!)
tree: 5428c88a93

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
vendor
.gitignore
.gitmodules
README.markdown
Rakefile
TCMPortMapper.bridgesupport
port_map_killah.rb

README.markdown

PortMapKillah

A daemonizable (via launchd) script that monitors UPnP mappings on the local network and kills any mappings that match against a list of given patterns.

Setup

You will need to install the TCMPortMapper framework. You can do this using the provided Rakefile:

rake tcmportmapper

Which will download and install the TCMPortMapper framework into your personal frameworks directory (~/Library/Frameworks).

Additionally, this script requires MacRuby. However, it would not take much effort make it run under CRuby if needed.

Usage

./port_map_killah.rb [PATTERN [PATTERN2 [...]]]

Simply run the script and pass in as many strings as you want. The strings will be turned into regular expressions that are matched against the descriptions of port mappings. I usually use the script like so:

./port_map_killah.rb uTorrent

Which will kill any mappings created by uTorrent. If you do no include any strings, the port map killah will simply monitor the network.

Output will be printed to standard out as well as the system logger. You can view system logged output using Console.app (/Applications/Utilities/Console.app).

Why

Because some people just don't listen. Using a script like this instead of the router's management tools has the added benefit of not being easily discoverable: they will have a hell of a time figuring out why things aren't working properly.

TODO

  • Rake task to generate a launchd plist
  • Allow the polling period to be configurable (currently every minute)

License

Copyright (c) 2012 Mark Rada

PortMapKillah is available under the MIT License.

You can view the details of the license at www.opensource.org/licenses/MIT

Something went wrong with that request. Please try again.