Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Checks for files encrypted by Spora
"""
Spora Encryption Checker
Author: @demonslay335
"""
import sys
import zlib
import struct
import os
def bytestohex(bytes):
return struct.unpack("<L", bytes)[0]
def check_spora(filename):
fencrypted = open(filename,'rb')
content_encrypted = fencrypted.read()
aes_buffer = content_encrypted[-132:]
aes_buffer = aes_buffer[:128]
crc32_buffer = content_encrypted[-4:]
return zlib.crc32(aes_buffer) == bytestohex(crc32_buffer)
if len(sys.argv) == 2:
print("*Spora Encryption Checker*\n")
for subdir, dirs, files in os.walk(str(sys.argv[1])):
for file in files:
full_path = os.path.join(subdir, file)
if(check_spora(full_path)):
print ("[!] File encrypted: %s" % full_path.encode('utf-8'))
else:
print("Error: please provide a path\nSyntax: python %s <path>" % sys.argv[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.