Skip to content

Instantly share code, notes, and snippets.

@pawlos
Created January 6, 2020 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pawlos/a42ad33ac63720ec8e260559e7523ec4 to your computer and use it in GitHub Desktop.
Save pawlos/a42ad33ac63720ec8e260559e7523ec4 to your computer and use it in GitHub Desktop.
from itertools import *
import string
def xor(data, key):
return ''.join([chr(d ^ ord(k)) for d,k in zip(data, cycle(key))])
data = [0x1C,0x5C,0x22,0x00,0x00,0x17,0x02,0x62,0x07,0x00,0x06,0x0D,0x08,0x75,0x45,0x17,0x17,0x3C,0x3D,0x1C,0x31,0x32,0x02,0x2F,0x12,0x72,0x39,0x0D,0x23,0x1E,0x28,0x29,0x69,0x31,0x00,0x39]
extra = '_'+'-'+'$' +'!'+'@'+'*'+'.'
valid = string.ascii_letters + string.digits + extra
letters = string.ascii_letters+string.digits
for x,y,z,a,b in product(letters, repeat=5):
if ord(x) ^ ord(y) != 0x41:
continue
if ord(z) & 1 == 1:
continue
if ord(b) * 0xc800 - 0x520800 >= 3:
continue
if (ord(a)*3 - 246) >= 2:
continue
key = a+'oT'+x+y+z+'eR'+b+'nG'
res = xor(data, key)
if not all([c in valid for c in res]):
continue
if '.com' in res.lower():
print('{0} -> {1}'.format(key, res))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment