Skip to content

Instantly share code, notes, and snippets.

@nick3499
Created August 11, 2021 00:57
Show Gist options
  • Save nick3499/5ba3905e149e54f1adcc611df9ece7b1 to your computer and use it in GitHub Desktop.
Save nick3499/5ba3905e149e54f1adcc611df9ece7b1 to your computer and use it in GitHub Desktop.
Python3: Translate Encoded Pictograms to picoCTF Key: urllib.request.urlopen(); read(); decode(); ascii()
#!/bin/python3
'''Translate encoded pictograms to picoCTF key.'''
import urllib.request
with urllib.request.urlopen('https://mercury.picoctf.net/static/\
0d3145dafdc4fbcf01891912eb6c0968/enc') as f:
decoded = f.read().decode('utf-8')
key = ''
for i in range(0, len(decoded)):
n = ascii(decoded[i])[3:7]
key += chr(int(n[0:2], 16))
key += chr(int(n[2:4], 16))
print(key)
@nick3499
Copy link
Author

Users may be able to run this script without downloading it:

$ curl -s https://gist.githubusercontent.com/nick3499/5ba3905e149e54f1adcc611df9ece7b1/raw/48f1267b78f689a3ef1870c111123916fb0d3c56/pictograms_to_picoctf_key.py | python3

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