Skip to content

Commit

Permalink
Fix Python 3, minor bugs, and add Windows installer
Browse files Browse the repository at this point in the history
  • Loading branch information
arp242 committed Mar 14, 2013
1 parent d1b51c6 commit fab2b0f
Show file tree
Hide file tree
Showing 9 changed files with 222 additions and 91 deletions.
1 change: 1 addition & 0 deletions .hgignore
@@ -1,3 +1,4 @@
syntax: glob

*.pyc
dist_win32
53 changes: 32 additions & 21 deletions README.md
@@ -1,45 +1,56 @@
operapass
=========

Opera is a great browser, but one feature it's been lacking for a very long
time is the ability to view the passwords you've saved with the Opera password
manager ("The wand").
Opera is a great browser, but one feature it’s been lacking for a very long
time is the ability to view the passwords you’ve saved with the Opera password
manager (“The wand”).

There are a few closed-source and Windows-only programs out there. An
open-source multi-platform utility to read the wand seemed like a good idea :-)

operapass can be run from in a terminal or with a basic GUI. It should find the
wand.dat in your Opera profile directory, but you can also specify it as the
first parameter (i.e. `operapass-tk path/to/wand.dat`)
first parameter (eg.. `operapass-tk path/to/wand.dat`)

There are two utilities: operapass-dump to dump the password file to your
stdout (i.e. terminal) and operapass-tk for a very basic TKinter GUI.
There are two utilities: `operapass-dump` to dump the password file to your
stdout (ie. terminal) and `operapass-tk` for a very basic TKinter GUI.

It should run on Windows, Linux, FreeBSD, and OSX.

Notes
-----
operapass can currently *only read wand files without a master password*. Note
=====
operapass can currently **only read wand files without a master password**. Note
you can remove and (re-)add a master password at any time in the Opera
preferences.

operapass will use the M2Crypto module when available, and fall back to pyDes
(bundled) when it's not. Note that M2Crypto is *much* faster.
operapass will use the [M2Crypto][1] module when available, and fall back to pyDes
(bundled) when it’s not, note that M2Crypto is *much* faster. M2Crypto isn’t
available for Python 3 yet.

Credits
-------
Copyright © 2011-2012, Martin Tournoij <<martin@arp242.net>>
=======
Copyright © 2011-2013, Martin Tournoij <[martin@arp242.net][2]>
MIT licence applies: http://opensource.org/licenses/MIT
http://code.arp242.net/operapass

The Opera wand format is described here:
http://securityxploded.com/operapasswordsecrets.php
This information was an extremely useful starting point.

operpass also includes pyDes from http://twhiteman.netfirms.com/des.html

Status
------
Should work with most password files, but sometimes there's "junk" in the
password file. It looks like Opera just ignores this but operapass sometimes
shows it.
ChangeLog
=========
Version 1.2, 20130313
---------------------
- Python 3 didn’t always work, fix that
- Windows binaries
- A few minor bugfixes/cleanup

Version 1.1, 20121101
---------------------
- Work with both Python 2 & 3

Version 1.0, 20111004
---------------------
- Initial release


[1]: https://pypi.python.org/pypi/M2Crypto
[2]: mailto: martin@arp242.net
36 changes: 33 additions & 3 deletions operapass-dump
@@ -1,7 +1,9 @@
#!/usr/bin/env python
# encoding=utf-8
#
# Copyright © 2011-2013, Martin Tournoij <martin@arp242.net>
# See below for full copyright
#
# Copyright © 2011-2012, Martin Tournoij <martin@arp242.net>
# MIT licence applies: http://opensource.org/licenses/MIT
# http://code.arp242.net/operapass
#
# This just "dumps" the data to the standard output
Expand All @@ -10,21 +12,49 @@
# programs can import (i.e. CSV and the like).
#

from __future__ import print_function
import sys

from operapass import operapass

if __name__ == '__main__':
print('operapass 1.2, by Martin Tournoij <martin@arp242.net>')
print('http://code.arp242.net/operapass')
print('')

pwfile = operapass.GetPasswordfile()
passwords = operapass.GetPasswordsDict(pwfile)

for p in passwords:
print('-' * 70)
print(p['url'])
for k, v in p['fields'].iteritems():
for k, v in p['fields'].items():
print('\t%s: %s' % (k, v))
print('-' * 70)
print('')

print('')
print('Total of %s passwords' % len(passwords))


# The MIT License (MIT)
#
# Copyright © 2011-2013 Martin Tournoij
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# The software is provided "as is", without warranty of any kind, express or
# implied, including but not limited to the warranties of merchantability,
# fitness for a particular purpose and noninfringement. In no event shall the
# authors or copyright holders be liable for any claim, damages or other
# liability, whether in an action of contract, tort or otherwise, arising
# from, out of or in connection with the software or the use or other dealings
# in the software.
44 changes: 38 additions & 6 deletions operapass-tk
@@ -1,30 +1,38 @@
#!/usr/bin/env python
# encoding=utf-8
#
# Copyright © 2011-2013, Martin Tournoij <martin@arp242.net>
# See below for full copyright
#
# Copyright © 2011-2012, Martin Tournoij <martin@arp242.net>
# MIT licence applies: http://opensource.org/licenses/MIT
# http://code.arp242.net/operapass
#
# Very basic TKinter GUI
#
# TODO: Make this un-very-basic :)
#

from __future__ import print_function
import sys

try:
import Tkinter as tk
if sys.version_info[0] <= 2:
import Tkinter as tk
else:
import tkinter as tk
except ImportError:
print("TKinter is required, but wasn't found.")
print('You can always use operapass-dump from the terminal.')
sys.exit(1)

from operapass import operapass


def Lambda(f, *args, **kwds):
return lambda event, f=f, args=args, kwds=kwds : f(*args, **kwds)
return lambda event, f=f, args=args, kwds=kwds: f(*args, **kwds)


def TkPager(root, output):
root.wm_title('operapass 1.0 -- Press ESC to exit.')
root.wm_title('operapass 1.2 -- Press ESC to exit.')
root.geometry('800x460')
root.bind('<Escape>', Lambda(root.quit))

Expand All @@ -45,6 +53,7 @@ def TkPager(root, output):

return (root)


if __name__ == '__main__':
pwfile = operapass.GetPasswordfile()
passwords = operapass.GetPasswordsDict(pwfile)
Expand All @@ -54,11 +63,34 @@ if __name__ == '__main__':
info += '-' * 70
info += '\n'
info += p['url'] + '\n'
for k, v in p['fields'].iteritems():
for k, v in p['fields'].items():
info += '\t%s: %s\n' % (k, v)
info += '-' * 70
info += '\n\n'

root = tk.Tk()
root = TkPager(root, info)
root.mainloop()


# The MIT License (MIT)
#
# Copyright © 2011-2013 Martin Tournoij
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# The software is provided "as is", without warranty of any kind, express or
# implied, including but not limited to the warranties of merchantability,
# fitness for a particular purpose and noninfringement. In no event shall the
# authors or copyright holders be liable for any claim, damages or other
# liability, whether in an action of contract, tort or otherwise, arising
# from, out of or in connection with the software or the use or other dealings
# in the software.

0 comments on commit fab2b0f

Please sign in to comment.