Skip to content

Instantly share code, notes, and snippets.

@mekza
Created April 29, 2013 23:04
Show Gist options
  • Save mekza/5485523 to your computer and use it in GitHub Desktop.
Save mekza/5485523 to your computer and use it in GitHub Desktop.
Bruteforce on Board of Canada's landing page (http://cosecha-transmisiones.com/ & http://cosecha-transmisiones.com/terminal.js)
#!/usr/bin/python
# -*- coding:utf-8 -*-
import itertools
import requests
import json
characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
password_length = 6
gen = itertools.combinations_with_replacement(characters,password_length)
for password in gen:
pwd = ''.join(password)
url = 'http://cosecha-transmisiones.com/password.php?attempt=%s' % pwd
r = requests.get(url)
if r.status_code == requests.codes.ok:
data = json.loads(r.text)
if data['error'] is not True:
print data['url'],pwd
@johnhunt
Copy link

I might try a dictionary attack first I think

@johnhunt
Copy link

Here's my attempt:

$handle = fopen('/usr/share/dict/words', 'r');
while (($buffer = fgets($handle, 512)) !== false) {
if (strlen($buffer) != 7) continue;
echo $buffer;

$bocData = file_get_contents('http://cosecha-transmisiones.com/password.php?attempt=' . $buffer);
$data = json_decode($bocData);
if (!empty($data->url)) {
  echo "Secret found: " . $data->url;
  exit;
}
}

@johnhunt
Copy link

Their server gave up handling requests by G or so.. d'oh!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment