Created
August 11, 2015 22:02
-
-
Save olivierlemoal/63fcf354e7735989d9ec to your computer and use it in GitHub Desktop.
Decrypt files encoded with LoroBot malware
This file contains hidden or 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 python3 | |
from itertools import cycle | |
import binascii | |
key = binascii.unhexlify("C9936BCADFBFC0614649334746AE8FCC") | |
key = bytearray(key) | |
def xor(data, key): | |
return bytearray([a ^ b for (a, b) in zip(data, cycle(key))]) | |
with open("Bluehills_crypted.jpg", "rb") as f: | |
crypted_file = bytearray(f.read()) | |
decrypted_file = xor(crypted_file, key) | |
with open("Bluehills.jpg", "wb") as f: | |
f.write(decrypted_file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment