Skip to content

Instantly share code, notes, and snippets.

@leblanc-simon
Created June 30, 2015 10:13
Show Gist options
  • Save leblanc-simon/a9831c0eb827eb9ad237 to your computer and use it in GitHub Desktop.
Save leblanc-simon/a9831c0eb827eb9ad237 to your computer and use it in GitHub Desktop.
Get password from Odoo session
#!/usr/bin/python
import os
from werkzeug.contrib.sessions import FilesystemSessionStore
session_store = FilesystemSessionStore(os.path.expanduser('~/.local/share/Odoo/sessions'))
passwds = []
for sid in session_store.list():
session = session_store.get(sid)
if session.get('password'):
passwds.append({
'login': session.get('login'),
'password': session.get('password'),
'database': session.get('db')
})
passwds.sort(key=lambda tup: tup['login'])
for passwd in passwds:
print passwd['login'] + ' : ' + passwd['password']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment