Skip to content

Instantly share code, notes, and snippets.

@olivierlemoal
Created August 11, 2015 22:02
Show Gist options
  • Save olivierlemoal/63fcf354e7735989d9ec to your computer and use it in GitHub Desktop.
Save olivierlemoal/63fcf354e7735989d9ec to your computer and use it in GitHub Desktop.
Decrypt files encoded with LoroBot malware
#! /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