Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Apply access modifiers to a number of IPs in bulk -- this is intended to

block networks of proxies that may be used by attackers.  By default the
modifier 'nopostanon' is applied to exit nodes of the Tor anonymizing
network.
  • Loading branch information...
commit c942de67ee1edccc762c325a791e513796ac135f 1 parent efae415
@jamiemccarthy jamiemccarthy authored
View
7 plugins/BlockProxyNet/Makefile.PL
@@ -0,0 +1,7 @@
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+ 'NAME' => 'Slash::BlockProxyNet',
+ 'VERSION_FROM' => 'block_proxy_net.pl', # finds $VERSION
+);
View
7 plugins/BlockProxyNet/PLUGIN
@@ -0,0 +1,7 @@
+# $Id$
+name=BlockProxyNet
+description="Apply an access modifier like nopost to a proxy network"
+mysql_dump=mysql_dump.sql
+mysql_schema=mysql_schema.sql
+task=block_proxy_net.pl
+
View
16 plugins/BlockProxyNet/mysql_dump.sql
@@ -0,0 +1,16 @@
+# This should be usable as long as this service continues to be
+# available.
+INSERT INTO bpn_sources (name, active, source, regex, al2name) VALUES ('torharvard', 'yes', 'http://serifos.eecs.harvard.edu:8000/cgi-bin/exit.pl', '<a class="(?:unverified|standard)" href="/cgi-bin/whois\\.pl\\?q=(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})">', 'nopostanon');
+
+# If the above service becomes unavailable, this works too, but it is
+# off by default since the above is easier. Give the location of the
+# cached-directory file on your system (the default location is where
+# Debian installs it: 'apt-get install tor'), and set its permissions
+# to be readable by your Slash unix user, maybe by adding that user
+# to group debian-tor. And if you turn this on, you can turn the
+# above source off.
+INSERT INTO bpn_sources (name, active, source, regex, al2name) VALUES ('torlocal', 'no', '/var/lib/tor/cached-directory', '(?m)^router \\s*\\S+\\s+(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})', 'nopostanon');
+
+# You may want to create a new user for this, for convenient logging.
+INSERT INTO vars (name, value, description) VALUES ('bpn_adminuid', '', 'Admin uid for BlockProxyNet plugin access modifiers');
+
View
9 plugins/BlockProxyNet/mysql_schema.sql
@@ -0,0 +1,9 @@
+CREATE TABLE bpn_sources (
+ name VARCHAR(30) NOT NULL,
+ active ENUM('no', 'yes') NOT NULL DEFAULT 'yes',
+ source VARCHAR(255) NOT NULL DEFAULT '',
+ regex VARCHAR(255) NOT NULL DEFAULT '',
+ al2name VARCHAR(30) NOT NULL DEFAULT 'nopostanon',
+ PRIMARY KEY name (name)
+) TYPE=InnoDB;
+
Please sign in to comment.
Something went wrong with that request. Please try again.