Created
September 2, 2020 16:00
-
-
Save ryancor/2d5d70dd03a539e5057392b1ea3d4864 to your computer and use it in GitHub Desktop.
EXTORY Intrinsics Challenge => https://www.virustotal.com/gui/file/7db71da650e096af7d351b03005593a368e75de8bb69d1761d30d7fd3a59708b/detection
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
def decrypt_debug_strings(): | |
e_array = [bytes.fromhex('a100ef00ed00bd00bb00be00f700bc00a100bc'), bytes.fromhex('8d00b800aa00b200b400be00ab00f700bc00a100bc'), | |
bytes.fromhex('b000bd00b800ef00ed00f700bc00a100bc0000'), bytes.fromhex('b300b800af00b800ae00f700bc00a100bc0000')] | |
n = 0 | |
d_bytes = '' | |
for encrypted_string in range(len(e_array)): | |
for _ in range(len(e_array[encrypted_string]) - 10): | |
d_bytes += chr(e_array[encrypted_string][n] ^ 0xD9) | |
n += 2 | |
d_bytes += chr(0xA) | |
n = 0 | |
return d_bytes | |
def decrypt_response(): | |
rand_ascii_array = ["hgblelelbkjjgldd", "hielblaldkdd"] | |
n = 0 | |
d_bytes = '' | |
for i in range(len(rand_ascii_array)): | |
for _ in range(int(len(rand_ascii_array[i]) / 2)): | |
tmp_byte = (((ord(rand_ascii_array[i][n+1]) << 2) + ord(rand_ascii_array[i][n+1])) * 2) + ord(rand_ascii_array[i][n]) | |
d_bytes += chr(tmp_byte - 0x42B) | |
n += 2 | |
d_bytes += chr(0xA) | |
n = 0 | |
return d_bytes | |
def solve(input): | |
e_input = bytearray(16) | |
output = bytearray(16) | |
key = bytes.fromhex('a500cd00b600a400e000c500c600c600af00ab00aa00fc00c400d000ec00d600') | |
for i in range(len(input)): | |
e_input[i] = input[i] ^ 0xCD | |
n = 0 | |
for i in range(len(input)): | |
output[i] = e_input[i] ^ key[n] | |
n += 2 | |
return output | |
def main(): | |
d_bytes = decrypt_debug_strings() | |
print("Decrypted Debugger Strings!\n" + d_bytes) | |
d_bytes = decrypt_response() | |
print("\nDecrypted Responses\n" + d_bytes) | |
hardcoded_input = bytes.fromhex("5D410A1C785A2E662A52137434444F22") | |
password = solve(hardcoded_input) | |
print("\nDecrypted Password =>") | |
print(password) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment