Skip to content

Instantly share code, notes, and snippets.

@fnzv
Created April 29, 2019 10:27
Show Gist options
  • Save fnzv/9efb5d728910cd9e0a5abda7c63fcbcd to your computer and use it in GitHub Desktop.
Save fnzv/9efb5d728910cd9e0a5abda7c63fcbcd to your computer and use it in GitHub Desktop.
Remmina password extract
#!/usr/bin/python
from Crypto.Cipher import DES3
import base64
import os
import re
from os.path import expanduser
home = expanduser("~")
# costanti :)
REMMINA_FOLDER = os.getenv('REMMINA_FOLDER', home+'/'+'.remmina/')
REMMINA_PREF = 'remmina.pref'
REGEXP_ACCOUNTS = r'[0-9]{13}\.remmina(.swp)?'
REGEXP_PREF = r'remmina.pref'
diz = {}
fs = open(REMMINA_FOLDER+REMMINA_PREF)
fso = fs.readlines()
fs.close()
for i in fso:
if re.findall(r'secret=', i):
r_secret = i[len(r'secret='):][:-1]
print 'found secret', r_secret
for f in os.listdir(REMMINA_FOLDER):
if re.findall(REGEXP_ACCOUNTS, f):
o = open( REMMINA_FOLDER+f, 'r')
fo = o.readlines()
o.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment