Last active
December 21, 2015 05:42
-
-
Save alexander-bauer/dee3398b1048dd39fa2a to your computer and use it in GitHub Desktop.
gchq-q2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mkdir urls | |
cd urls | |
cat ../urls.txt | xargs -L 1 curl -O |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
grep -RL Sorry urls/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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