Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- import argparse
- key = (0x4e, 0x32, 0x56, 0x6b, 0x4d, 0x54, 0x63, 0x7a, 0x59, 0x6a, 0x64, 0x6d, 0x59, 0x6d, 0x56, 0x69, 0x5a, 0x47, 0x4e, 0x6d, 0x59, 0x54, 0x4d, 0x33, 0x4d, 0x6d, 0x51, 0x35, 0x59, 0x54, 0x59, 0x77, 0x4e, 0x57, 0x56, 0x6d, 0x59, 0x57, 0x5a, 0x6d, 0x59, 0x57, 0x5a, 0x4d, 0x62, 0x55, 0x67, 0x7a, 0x51, 0x6b, 0x70, 0x4d, 0x61, 0x30, 0x46, 0x48, 0x56, 0x6d, 0x31, 0x4d, 0x65, 0x6b, 0x51, 0x79, 0x54, 0x48, 0x64, 0x34, 0x4d, 0x46, 0x70, 0x48, 0x52, 0x58, 0x5a, 0x61, 0x52, 0x33, 0x67, 0x78, 0x54, 0x56, 0x46, 0x4d, 0x4d, 0x45, 0x46, 0x36, 0x57, 0x6a, 0x4e, 0x4e, 0x65, 0x6b, 0x6c, 0x35, 0x57, 0x6e, 0x70, 0x4a, 0x51, 0x55, 0x5a, 0x35, 0x51, 0x54, 0x52, 0x48, 0x53, 0x32, 0x4e, 0x53, 0x62, 0x30, 0x67, 0x78, 0x4d, 0x30, 0x67, 0x7a, 0x54, 0x55, 0x39, 0x49, 0x53, 0x30, 0x56, 0x6d, 0x53, 0x6d, 0x46, 0x78, 0x4d, 0x47, 0x39, 0x49, 0x55, 0x31, 0x56, 0x79, 0x56, 0x47, 0x4e, 0x42, 0x52, 0x6e, 0x6c, 0x42, 0x4d, 0x6b, 0x64, 0x49, 0x63, 0x55, 0x4a, 0x42, 0x53, 0x57, 0x4e, 0x6e, 0x52, 0x56, 0x52, 0x72, 0x54, 0x33, 0x4a, 0x35, 0x59, 0x6a, 0x42, 0x48, 0x53, 0x48, 0x46, 0x48, 0x52, 0x7a, 0x46, 0x6a, 0x4e, 0x48, 0x46, 0x4b, 0x54, 0x56, 0x68, 0x79, 0x56, 0x45, 0x46, 0x55, 0x53, 0x6d, 0x46, 0x31, 0x52, 0x30, 0x5a, 0x53, 0x63, 0x55, 0x68, 0x4d, 0x4d, 0x46, 0x4e, 0x58, 0x53, 0x44, 0x46, 0x4e, 0x5a, 0x55, 0x56, 0x53, 0x59, 0x6d, 0x74, 0x49, 0x65, 0x6a, 0x55, 0x30, 0x53, 0x54, 0x46, 0x31, 0x56, 0x55, 0x68, 0x49, 0x4f, 0x55, 0x39, 0x77, 0x52, 0x30, 0x35, 0x72, 0x51, 0x56, 0x4a, 0x78, 0x56, 0x30, 0x67, 0x78, 0x59, 0x32, 0x35, 0x79, 0x53, 0x6b, 0x46, )
- parser = argparse.ArgumentParser(description='Decrypt .crypted files by ransomware')
- parser.add_argument('-s', '--source_file', action='store', nargs="+", required=True, help="Crypted files (source files list)")
- args = parser.parse_args()
- for source_file in args.source_file:
- bf = open(source_file, "rb")
- nf = open(source_file + ".recovered", "wb")
- i = 0
- print("byte# bad key new str(new)")
- read_bytes = 0
- while read_bytes < 2048:
- bad_byte = bf.read(1)
- new_byte = (key[i] ^ ord(bad_byte))
- print(str(read_bytes) + " " + hex(ord(bad_byte)) + " " + hex(key[i]) + " " + hex(new_byte) + " " + str(new_byte) + " ")
- nf.write(bytes([new_byte]))
- i = i + 1
- if i > 254:
- i = 0
- read_bytes = read_bytes + 1
- while bad_byte:
- bad_byte = bf.read(1)
- nf.write(bad_byte)
- nf.close()
- bf.close()
Advertisement
Add Comment
Please, Sign In to add comment