Skip to content

Instantly share code, notes, and snippets.

@khr0x40sh
Created March 23, 2023 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khr0x40sh/0c0f2513674e3fff715dc6ecae5795a1 to your computer and use it in GitHub Desktop.
Save khr0x40sh/0c0f2513674e3fff715dc6ecae5795a1 to your computer and use it in GitHub Desktop.
HTB:CA2023 Forensics Interstellar python decrypt for phase 1
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad, unpad
### borrowed from https://gist.github.com/lopes/168c9d74b988391e702aac5f4aa69e41
def decrypt(data, key, iv):
cipher = AES.new(key, AES.MODE_CBC, iv)
return unpad(cipher.decrypt(data[0:]), AES.block_size)
key = [0,1,1,0,0,1,1,0,0,1,1,0,1,1,0,0]
iv = [0,1,1,0,0,0,0,1,0,1,1,0,0,1,1,1]
### get the encrypted bytes
with open('./destdir/94974f08-5853-41ab-938a-ae1bd86d8e51','rb') as f:
bytes = f.read()
with open('./phase1.dec','wb') as f:
f.write(decrypt(bytes, bytearray(key),bytearray(iv)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment