Last active
May 18, 2022 06:38
-
-
Save tvldz/7f38850dbbf022515db6 to your computer and use it in GitHub Desktop.
2014 FLAREOn Challenge 7 decryption script
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 python | |
# FLARE On Final Challenge 7 | |
# Thomas Valadez (@tvldz) | |
# First, extract the encrypted binary from the C7 executable and save it | |
# as "encrypted.bin" Then, run this script until a valid excutable is decrypted. | |
from itertools import product | |
import array | |
import string | |
keys = [['the final countdown','oh happy dayz'], | |
['UNACCEPTABLE!','omglob'], | |
["you're so good","you're so bad"], | |
["\x66","\x01"], | |
["I'm gonna sandbox your face","Sandboxes are fun to play in"], | |
["Such fire. Much burn. Wow.","I can haz decode?"], | |
["Feel the sting of the Monarch!","\x09\x00\x00\x01"], | |
["\x21\x20\x35\x30\x20\x31\x33\x33\x37"], | |
["MATH IS HARD","LETS GO SHOPPING"], | |
["LETS GO MATH","SHOPPING IS HARD"], | |
["\x01\x02\x03\x05\x00\x78\x30\x38\x0D"], | |
["backdoge.exe"], | |
["192.203.230.10"], | |
["jackRAT"]] | |
encrypted_file = bytearray(open('encrypted.bin', 'rb').read()) | |
def xor(data, key): | |
l = len(key) | |
return bytearray(( | |
(data[i] ^ key[i % l]) for i in range(0,len(data)) | |
)) | |
for x in product(*keys): | |
version = encrypted_file | |
for y in x: | |
version = xor(version,array.array('B', y)) | |
if (version.find("DOS mode") != -1): | |
open('decrypted.exe', 'wb').write(version) | |
print(x) | |
quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment