Skip to content

Instantly share code, notes, and snippets.

@felipou
Last active January 24, 2024 14:11
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save felipou/f5472ad5f6a414528b44beb102e17fb4 to your computer and use it in GitHub Desktop.
Save felipou/f5472ad5f6a414528b44beb102e17fb4 to your computer and use it in GitHub Desktop.
DBeaver password decryption script
# https://stackoverflow.com/questions/39928401/recover-db-password-stored-in-my-dbeaver-connection
import sys
import base64
print(sys.argv[1])
PASSWORD_ENCRYPTION_KEY = b"sdf@!#$verf^wv%6Fwe%$$#FFGwfsdefwfe135s$^H)dg"
data_enc = sys.argv[1]
data_bin = base64.b64decode(data_enc)
output = bytearray(b"")
for i in range(len(data_bin)):
output.append(data_bin[i] ^ PASSWORD_ENCRYPTION_KEY[i % len(PASSWORD_ENCRYPTION_KEY)])
print(output)
if output[-2] == 0 and output[-1] == 129:
print("PASSWORD:", output[:-2].decode("utf-8"))
else:
print("Error decrypting")
@rdp
Copy link

rdp commented Aug 23, 2019

requires python3, for followers...

@felipou
Copy link
Author

felipou commented Oct 3, 2019

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