Skip to content

Instantly share code, notes, and snippets.

@nk0t
Created September 5, 2013 13:17
Show Gist options
  • Save nk0t/6449973 to your computer and use it in GitHub Desktop.
Save nk0t/6449973 to your computer and use it in GitHub Desktop.
ASIS CTF RE/Serial Number
asis = [0x41, 0x53, 0x49, 0x53, 0x5f]
flag = [+0x06, -0x24, +0x09, -0x29, -0x2d, -0x2b,
-0x24, +0x06, +0x08, -0x24, +0x07, +0x06,
+0x09, -0x25, +0x09, +0x09, -0x26, +0x09,
-0x25, +0x09, -0x2c, +0x05, -0x26, -0x2d,
+0x08, +0x07, +0x08, +0x04, +0x07, -0x25,
-0x29, -0x2a]
for key in range(256):
a = [f+key&0xff for f in flag]
b = [chr(i) in '0123456789abcdef' for i in a]
if False not in b:
print 'key: ' + str(key)
print ''.join(map(chr, asis + a))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment