Skip to content

Instantly share code, notes, and snippets.

@thedod
Last active December 13, 2015 18:09
Show Gist options
  • Save thedod/4953334 to your computer and use it in GitHub Desktop.
Save thedod/4953334 to your computer and use it in GitHub Desktop.
wikileaks https-everywhere ruleset
var rule_list = [
"rules/default.rulesets",
"rules/wikileaks.xml",
];

The problem

  • I live in █████████

  • Http connection to wikileaks is blocked, https connection isn't (so far)

  • If I click on an http wikileaks link in a tweet, here's what happens

    • In the browser's URL bar I see the shortened t.co link
    • Browser connects, gets redirected to a blocked url, and waits
    • [perhaps █████████ also monitors this, but let's assume I'm a fearless idiot for a moment]
    • Since browser can't connect to the long url, it never displays the "bad" url in the url bar (so that I could add the s to it manually)
  • Instead of clicking on the link, I have to copy the t.co link, and feed it to curl -I (then copy the URL, paste it into the browser, and add the s).

Takes a ninja to read a tweet :)

A theoretical solution

Best could be if other people didn't tweet http links to wikileaks, but this can't be changed, and even @WikiLeaks keep doing that ;)

A practical solution

First, you need to have HTTPS Everywhere installed on your browser (regardless of this problem, I think you need to install it).

Then you need to add wikileaks.xml to the rulesets. How you do this depends on your browser and operating system.

Firefox

Chromium on Linux

  • cd to a folder named ~/.config/chromium/Default/Extensions/ID/VERSION/. You can see what the ID is at chrome://extensions/ in your browser, and VERSION is probably the latest (if you see more than one sub-folder there).
  • Copy wikileaks.xml to rules/.
  • Edit rule_list.js and add the line "rules/wikileaks.xml", (see example).
  • Either restart your browser, or disable and enable again the plugin (at chrome://extensions).

Chrome/chromium on Windows, Apple, etc.

If you know how to do this, please leave a comment below.


**Update:** a better ruleset was [added](https://gitweb.torproject.org/https-everywhere.git/commit/e33a89d99925369a0c22ccf9ea84a798dbc013cd) to the https-evetywhere repository, so I copied it here as is, and hopefully, this would be out-of-the box functionality in a future release.
<ruleset name="WikiLeaks">
<target host="wikileaks.org" />
<target host="*.wikileaks.org" />
<securecookie host="^(?:w*\.)?wikileaks\.org$" name=".+" />
<rule from="^http://((?:chat|search|shop|www)\.)?wikileaks\.org/"
to="https://$1wikileaks.org/" />
</ruleset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment