Skip to content

Instantly share code, notes, and snippets.

@alexander-bauer
Last active December 21, 2015 05:42
Show Gist options
  • Save alexander-bauer/dee3398b1048dd39fa2a to your computer and use it in GitHub Desktop.
Save alexander-bauer/dee3398b1048dd39fa2a to your computer and use it in GitHub Desktop.
gchq-q2
#!/bin/sh
mkdir urls
cd urls
cat ../urls.txt | xargs -L 1 curl -O
#!/bin/sh
grep -RL Sorry urls/
#!/usr/bin/env python3
import itertools
url = 'https://s3-eu-west-1.amazonaws.com/puzzleinabucket/{}{}{}{}{}{}.html'
def gen(known = [], url = url, num = 6, possible = ['A', 'B', 'C', 'D', 'E', 'F']):
def matches_known(combination):
for a, b in zip(known, combination):
if a and a !=b:
return False
return True
return filter(matches_known,
itertools.product(possible, repeat=num))
if __name__ == "__main__":
g = gen(['D', '', '', 'A', '', 'E'])
for answers in g:
print(url.format(*answers))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment