unode / firefox_decrypt Goto Github PK
View Code? Open in Web Editor NEWFirefox Decrypt is a tool to extract passwords from Mozilla (Firefox™, Waterfox™, Thunderbird®, SeaMonkey®) profiles
License: GNU General Public License v3.0
Firefox Decrypt is a tool to extract passwords from Mozilla (Firefox™, Waterfox™, Thunderbird®, SeaMonkey®) profiles
License: GNU General Public License v3.0
I am running on Linux Deb10 with Firefox-ESR (68). I get the error when trying to decrypt one of my profiles. There is no Master Password set in Firefox. I was able to decrypt another profile successfully.
Master Password for profile
2019-12-21 12:38:35,926 - WARNING - Attempting decryption with no Master Password
2019-12-21 12:38:35,929 - ERROR - Password decryption failed. Passwords protected by a Master Password!
I ran tests/run_all:
decrypt/tests$ ./run_all
Passed: 33
Failed: 0
Unexpected successes: 0
Skipped: 0
Expected failures: 0
Runtime: 2.09 seconds
Hey, do you know where I can put a simulated enter Keyinput to skip Master Password with ' '
Originally placed as a comment in #25 by @NPacific .
Hi @unode ,
I reached your repository by looking a way to decrypt the mozilla passwords.
But the issue is i have protected my password with master password and now i have forgot the password.But know some parts of the password.
So i want to launch bruteforce attack on my file.
So what i have done was called
nss.authenticate("1")
inside a for loop to lauch bruteforce but i noticed after single call to nss.authenticate() we are not allowed to make other call.
It seems to be a lazy approach.
Can you through some light on the issue and help me way out.
So that i can get back my bunch of logins and passwords.
Unable to find a way to contact you so came here to contact
I think there should be a way to point the script to a specific profile folder.
First, thanks for the nice work! I always needed that tool but I never trusted any code. But your code is nicely understandable...so while checking the code I noticed a few bugs related to the libnss3 usage.
There seems to be no real documentation of libnss3, but attached is a class which does a more accurate handling of libnss3, feel free to use it.
I am running Firefox 52.0 64bit on Ubuntu 16.10 and have used this with no issues in the past but not for a couple of months. Now when I run it I am prompted
Master Password for profile NameOfDefaultProfile:
But I have no master password set.
The first couple times I did it with a blank I got a segfault. I tried my system password and my mozilla password and just got a message that it was incorrect. Then for some reason it started working with a blank and now it does that with a message about attempting without a default password and works fine.
Is there any way to generate a single file in the pass multiline format instead? Simply not using --pass-compat
flag didn't seem to help, as it still produced a directory structure. I think this is very close to the default behavior, or may simply be achieved by redirecting from the stdout.
After upgrading from Firefox 57 to Firefox 67 I lost access to all my site logins. But the files (logins.json, key3.db and key4.db) are still there and look proper.
So I am trying to extract my credentials with this great tool, but I am getting this error:
2019-07-08 11:10:08,209 - DEBUG - Authenticating with password 'xxxx'
2019-07-08 11:10:08,209 - DEBUG - Checking user password returned 0
2019-07-08 11:10:08,210 - DEBUG - Database location: /home/user/.mozilla/firefox/kv2roq7n.default/logins.json
2019-07-08 11:10:08,210 - INFO - Using /home/user/.mozilla/firefox/kv2roq7n.default/logins.json for credentials.
2019-07-08 11:10:08,210 - INFO - Decrypting credentials
2019-07-08 11:10:08,210 - DEBUG - Reading password database in JSON format
2019-07-08 11:10:08,212 - DEBUG - Decrypting username data 'MEIEEPgAAAAAAAAAAAAAAAAAAAQwFSIKaZIevcAAwcECFUlErpS8BrMABgqFyo/UP5Q8I0eLbl5H666s9WqqxvAU5h='
2019-07-08 11:10:08,212 - DEBUG - Decryption of data returned -1
2019-07-08 11:10:08,213 - ERROR - Password decryption failed. Passwords protected by a Master Password!
2019-07-08 11:10:08,213 - DEBUG - Error during a call to NSS library, trying to obtain error info
2019-07-08 11:10:08,213 - DEBUG - NULL: Unknown code ___P 3
I tried it with older libnss3, but that does not change anything.
Thanks!
How do I protect myself against this kind of attack?
Trying to get this to work on Windows, the script can't seem to find the nss3.dll
The path to the firefox directory for Windows in the script is:
line 186 -- firefox = r"C:\Program Files (x86)\Mozilla Firefox"
Is that 'r' supposed to be there?
Running Python 2.7 and Win10
Can you clarify...
Is there a program, which is able to import the exported passwords again, like addon "Password Exporter" does on old Mozilla versions?
If not, could you provide such program in future?
LANG=C python firefox_decrypt.py -vvv /tmp/A
2017-02-07 15:51:23,167 - DEBUG - Parsed commandline arguments: Namespace(choice=None, export_pass=False, list=False, no_interactive=False, profile='/tmp/A', verbose=3)
2017-02-07 15:51:23,167 - DEBUG - Skipping password store test, not exporting
2017-02-07 15:51:23,167 - DEBUG - Loading NSS library from libnss3.so
2017-02-07 15:51:23,168 - DEBUG - Reading profiles from /tmp/A/profiles.ini
2017-02-07 15:51:23,169 - WARNING - profile.ini not found in /tmp/A
2017-02-07 15:51:23,169 - WARNING - Continuing and assuming '/tmp/A' is a profile location
Master Password for profile /tmp/A:
2017-02-07 15:51:34,030 - DEBUG - Initializing NSS with profile path '/tmp/A'
2017-02-07 15:51:34,035 - DEBUG - Initializing NSS returned 0
2017-02-07 15:51:34,035 - DEBUG - Retrieving internal key slot
2017-02-07 15:51:34,035 - DEBUG - Internal key slot -1299103056
2017-02-07 15:51:34,036 - DEBUG - Authenticating with password 'lll'
Segmentation fault (core dump)
Hello
Nice work here. Do you mind adding json as export format ?
Regards,
Is your feature request related to a problem? Please describe.
Search the password by string in the URL of the website. It is more convenable than Firefox's gui (too many clicks, it has the button to show the hidden password too...)
Describe the solution you'd like
Have an option to search by domain (url) string
Additional context
Code example:
--- firefox_decrypt.py 2020-04-30 07:43:34.973454793 +0200
+++ firefox_decrypt-s.py 2020-04-30 07:58:49.921552869 +0200
@@ -537,7 +537,7 @@
return user, passw
- def decrypt_passwords(self, export, output_format="human", csv_delimiter=";", csv_quotechar="|"):
+ def decrypt_passwords(self, export, output_format="human", csv_delimiter=";", csv_quotechar="|", string=''):
"""
Decrypt requested profile using the provided password and print out all
stored passwords.
@@ -562,6 +562,10 @@
csv_writer.writeheader()
for url, user, passw, enctype in credentials:
+ if string != '':
+ if url.count(string) == 0:
+ continue
+
got_password = True
# enctype informs if passwords are encrypted and protected by
@@ -920,6 +924,7 @@
help="Verbosity level. Warning on -vv (highest level) user input will be printed on screen")
parser.add_argument("--version", action="version", version=__version__,
help="Display version of firefox_decrypt and exit")
+ parser.add_argument("-s", "--string", action='store', default='', help="Type a string to filter the resaults")
args = parser.parse_args()
@@ -989,6 +994,7 @@
output_format=args.format,
csv_delimiter=args.delimiter,
csv_quotechar=args.quotechar,
+ string=args.string,
)
if args.export_pass:
What file does this open too view the passwords?
Is it opening and decrypting logins.json?
Does it require the key3.db file?
Running this on my macbook got the error
2018-08-13 09:38:29,696 - ERROR - Couldn't find or load 'libnss3.dylib'. This library is essential to interact with your Mozilla profile.
2018-08-13 09:38:29,696 - ERROR - If you are seeing this error please perform a system-wide search for 'libnss3.dylib' and file a bug report indicating any location found. Thanks!
2018-08-13 09:38:29,696 - ERROR - Alternatively you can try launching firefox_decrypt from the location where you found 'libnss3.dylib'. That is 'cd' or 'chdir' to that location and run firefox_decrypt from there.
2018-08-13 09:38:29,696 - ERROR - Please also include the following on any bug report. Errors seen while searching/loading NSS:
2018-08-13 09:38:29,697 - ERROR - Error when loading libnss3.dylib was dlopen(libnss3.dylib, 6): image not found
2018-08-13 09:38:29,697 - ERROR - Error when loading /usr/local/lib/nss/libnss3.dylib was dlopen(/usr/local/lib/nss/libnss3.dylib, 6): image not found
2018-08-13 09:38:29,698 - ERROR - Error when loading /usr/local/lib/libnss3.dylib was dlopen(/usr/local/lib/libnss3.dylib, 6): image not found
2018-08-13 09:38:29,698 - ERROR - Error when loading /opt/local/lib/nss/libnss3.dylib was dlopen(/opt/local/lib/nss/libnss3.dylib, 6): image not found
2018-08-13 09:38:29,698 - ERROR - Error when loading /sw/lib/firefox/libnss3.dylib was dlopen(/sw/lib/firefox/libnss3.dylib, 6): image not found
2018-08-13 09:38:29,698 - ERROR - Error when loading /sw/lib/mozilla/libnss3.dylib was dlopen(/sw/lib/mozilla/libnss3.dylib, 6): image not found
2018-08-13 09:38:29,698 - ERROR - Error when loading /usr/local/opt/nss/lib/libnss3.dylib was dlopen(/usr/local/opt/nss/lib/libnss3.dylib, 6): image not found
2018-08-13 09:38:29,698 - ERROR - Error when loading /opt/pkg/lib/nss/libnss3.dylib was dlopen(/opt/pkg/lib/nss/libnss3.dylib, 6): image not found
And, running a find / -name libnss3.dylib
found it at:
/Applications/Firefox.app/Contents/MacOS/libnss3.dylib
I'm on macOs 10.13.6 with Firefox 61.0.1
Is your feature request related to a problem? Please describe.
There may be problems when importing passwords from the current output. See issue #47 .
Describe the solution you'd like
Additionally export all fields, e.g.: transport prefix, comment, field name login, field name password.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
When using the addon "Password Exporter" on old versions of Mozilla there are 7 fields shown: url. login, password, transport prefix, comment, field name login, field name password.
The project README.md mentions --pass-compat
flat, while the latest release 0.7.0
has no such support. It would be great to keep the released version in sync with the documentation. The master branch 2a31774 didn't work on macOS: prompted two profiles for Firefox, but pressing 1
then pressing Enter simply repeated the prompt, stuck in a loop.
~/D/firefox_decrypt-master $ python firefox_decrypt.py --export-pass
Select the Firefox profile you wish to decrypt
1 -> Profiles/nmpnntrd.default
2 -> Profiles/gtd5qo9s.dev-edition-default
1
Select the Firefox profile you wish to decrypt
1 -> Profiles/nmpnntrd.default
2 -> Profiles/gtd5qo9s.dev-edition-default
2
Select the Firefox profile you wish to decrypt
1 -> Profiles/nmpnntrd.default
2 -> Profiles/gtd5qo9s.dev-edition-default
Traceback (most recent call last):
File "firefox_decrypt.py", line 965, in <module>
main()
File "firefox_decrypt.py", line 935, in main
profile = get_profile(basepath, args.interactive, args.choice, args.list)
File "firefox_decrypt.py", line 822, in get_profile
section = ask_section(profiles, choice)
File "firefox_decrypt.py", line 717, in ask_section
choice = raw_input()
File "<string>", line 0
^
SyntaxError: unexpected EOF while parsing
I navigated to /Applications/Firefox.app/Contents/MacOS
using cd and then pasted and ran python3 firefox_decrypt.py -vvv
from there. /Applications/Firefox.app/Contents/MacOS/libnss3.dylib
exists but firefox_decrypt couldn't find it.
2021-06-22 22:09:33,899 - DEBUG - Running with encodings: stdin: utf-8, stdout: utf-8, stderr: utf-8, locale: UTF-8
2021-06-22 22:09:33,899 - DEBUG - Loading NSS library from libnss3.dylib
2021-06-22 22:09:33,899 - DEBUG - PATH is now ;/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin
2021-06-22 22:09:33,900 - DEBUG - Loading NSS library from /usr/local/lib/nss/libnss3.dylib
2021-06-22 22:09:33,900 - DEBUG - PATH is now /usr/local/lib/nss;;/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin
2021-06-22 22:09:33,900 - DEBUG - Loading NSS library from /usr/local/lib/libnss3.dylib
2021-06-22 22:09:33,900 - DEBUG - PATH is now /usr/local/lib;/usr/local/lib/nss;;/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin
2021-06-22 22:09:33,900 - DEBUG - Loading NSS library from /opt/local/lib/nss/libnss3.dylib
2021-06-22 22:09:33,900 - DEBUG - PATH is now /opt/local/lib/nss;/usr/local/lib;/usr/local/lib/nss;;/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin
2021-06-22 22:09:33,900 - DEBUG - Loading NSS library from /sw/lib/firefox/libnss3.dylib
2021-06-22 22:09:33,901 - DEBUG - PATH is now /sw/lib/firefox;/opt/local/lib/nss;/usr/local/lib;/usr/local/lib/nss;;/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin
2021-06-22 22:09:33,901 - DEBUG - Loading NSS library from /sw/lib/mozilla/libnss3.dylib
2021-06-22 22:09:33,901 - DEBUG - PATH is now /sw/lib/mozilla;/sw/lib/firefox;/opt/local/lib/nss;/usr/local/lib;/usr/local/lib/nss;;/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin
2021-06-22 22:09:33,901 - DEBUG - Loading NSS library from /usr/local/opt/nss/lib/libnss3.dylib
2021-06-22 22:09:33,901 - DEBUG - PATH is now /usr/local/opt/nss/lib;/sw/lib/mozilla;/sw/lib/firefox;/opt/local/lib/nss;/usr/local/lib;/usr/local/lib/nss;;/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin
2021-06-22 22:09:33,901 - DEBUG - Loading NSS library from /opt/pkg/lib/nss/libnss3.dylib
2021-06-22 22:09:33,901 - DEBUG - PATH is now /opt/pkg/lib/nss;/usr/local/opt/nss/lib;/sw/lib/mozilla;/sw/lib/firefox;/opt/local/lib/nss;/usr/local/lib;/usr/local/lib/nss;;/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin
2021-06-22 22:09:33,901 - DEBUG - Loading NSS library from /Applications/Firefox.app/Contents/MacOS/libnss3.dylib
2021-06-22 22:09:33,901 - DEBUG - PATH is now /Applications/Firefox.app/Contents/MacOS;/opt/pkg/lib/nss;/usr/local/opt/nss/lib;/sw/lib/mozilla;/sw/lib/firefox;/opt/local/lib/nss;/usr/local/lib;/usr/local/lib/nss;;/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin
2021-06-22 22:09:33,902 - DEBUG - Loading NSS library from /Applications/Thunderbird.app/Contents/MacOS/libnss3.dylib
2021-06-22 22:09:33,902 - DEBUG - PATH is now /Applications/Thunderbird.app/Contents/MacOS;/Applications/Firefox.app/Contents/MacOS;/opt/pkg/lib/nss;/usr/local/opt/nss/lib;/sw/lib/mozilla;/sw/lib/firefox;/opt/local/lib/nss;/usr/local/lib;/usr/local/lib/nss;;/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin
2021-06-22 22:09:33,902 - DEBUG - Loading NSS library from /Applications/SeaMonkey.app/Contents/MacOS/libnss3.dylib
2021-06-22 22:09:33,902 - DEBUG - PATH is now /Applications/SeaMonkey.app/Contents/MacOS;/Applications/Thunderbird.app/Contents/MacOS;/Applications/Firefox.app/Contents/MacOS;/opt/pkg/lib/nss;/usr/local/opt/nss/lib;/sw/lib/mozilla;/sw/lib/firefox;/opt/local/lib/nss;/usr/local/lib;/usr/local/lib/nss;;/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin
2021-06-22 22:09:33,902 - DEBUG - Loading NSS library from /Applications/Waterfox.app/Contents/MacOS/libnss3.dylib
2021-06-22 22:09:33,902 - DEBUG - PATH is now /Applications/Waterfox.app/Contents/MacOS;/Applications/SeaMonkey.app/Contents/MacOS;/Applications/Thunderbird.app/Contents/MacOS;/Applications/Firefox.app/Contents/MacOS;/opt/pkg/lib/nss;/usr/local/opt/nss/lib;/sw/lib/mozilla;/sw/lib/firefox;/opt/local/lib/nss;/usr/local/lib;/usr/local/lib/nss;;/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin
2021-06-22 22:09:33,902 - ERROR - Couldn't find or load 'libnss3.dylib'. This library is essential to interact with your Mozilla profile.
2021-06-22 22:09:33,902 - ERROR - If you are seeing this error please perform a system-wide search for 'libnss3.dylib' and file a bug report indicating any location found. Thanks!
2021-06-22 22:09:33,902 - ERROR - Alternatively you can try launching firefox_decrypt from the location where you found 'libnss3.dylib'. That is 'cd' or 'chdir' to that location and run firefox_decrypt from there.
2021-06-22 22:09:33,902 - ERROR - Please also include the following on any bug report. Errors seen while searching/loading NSS:
2021-06-22 22:09:33,902 - ERROR - Error when loading libnss3.dylib was dlopen(libnss3.dylib, 6): Library not loaded: @executable_path/libmozglue.dylib
Referenced from: /Applications/Firefox.app/Contents/MacOS/libnss3.dylib
Reason: image not found
2021-06-22 22:09:33,902 - ERROR - Error when loading /usr/local/lib/libnss3.dylib was dlopen(/usr/local/lib/libnss3.dylib, 6): image not found
2021-06-22 22:09:33,902 - ERROR - Error when loading /Applications/Firefox.app/Contents/MacOS/libnss3.dylib was dlopen(/Applications/Firefox.app/Contents/MacOS/libnss3.dylib, 6): Library not loaded: @executable_path/libmozglue.dylib
Referenced from: /Applications/Firefox.app/Contents/MacOS/libnss3.dylib
Reason: image not found
Win 7, 32x
Python 2.7
Firefox 60.0.1
C:\Users\Алиса>python C:\Users\Алиса\Desktop\firefox_decrypt.py -vvv
2018-05-17 21:34:34,355 - INFO - Running firefox_decrypt version: 0.7.0
2018-05-17 21:34:34,355 - DEBUG - Parsed commandline arguments: Namespace(choice
=None, delimiter=';', export_pass=False, format='human', interactive=True, list=
False, pass_cmd=u'pass', pass_compat='default', pass_prefix=u'web', profile='C:
\Users\\xc0\xeb\xe8\xf1\xe0\AppData\Roaming\Mozilla\Firefox', quotechar='"'
, tabular=False, verbose=3)
2018-05-17 21:34:34,355 - DEBUG - Skipping password store test, not exporting
2018-05-17 21:34:34,355 - DEBUG - PATH is now C:\Python27;C:\Python27\Scripts;C
:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Windo
wsPowerShell\v1.0;C:\Program Files\Universal Extractor;C:\Program Files\Univers
al Extractor\bin;C:\Program Files\dotnet;C:\Program Files\Mozilla Firefox
2018-05-17 21:34:34,355 - DEBUG - Loading NSS library from C:\Program Files\Mozi
lla Firefox\nss3.dll
2018-05-17 21:34:34,355 - DEBUG - Reading profiles from C:\Users\Lышёр\AppData\R
oaming\Mozilla\Firefox\profiles.ini
2018-05-17 21:34:34,371 - DEBUG - Read profiles ['General', 'Profile0']
2018-05-17 21:34:34,371 - DEBUG - Profile selection matched Profiles/7xofdivo.de
fault
2018-05-17 21:34:34,371 - DEBUG - Initializing NSS with profile path 'C:\Users\L
ышёр\AppData\Roaming\Mozilla\Firefox\Profiles/7xofdivo.default'
2018-05-17 21:34:34,371 - DEBUG - Initializing NSS returned -1
2018-05-17 21:34:34,371 - ERROR - Couldn't initialize NSS, maybe 'C:\Users\Lышёр
\AppData\Roaming\Mozilla\Firefox\Profiles/7xofdivo.default' is not a valid profi
le?
2018-05-17 21:34:34,387 - DEBUG - Error during a call to NSS library, trying to
obtain error info
2018-05-17 21:34:34,387 - DEBUG - SEC_ERROR_BAD_DATABASE: security library: bad
database.
When running the program without arguments or with the -f csv
argument, it successfully runs. When then adding an output redirect, e.g. ... >..\example.csv
, it shows the following error:
PS D:\progfiles\firefox> python C:\users\x\firefox-decrypt.py -f csv > ..\example.csv
Master Password for profile C:\Users\x\AppData\Roaming\Mozilla\Firefox\Profiles/x.default:
Traceback (most recent call last):
File "C:\users\x\firefox-decrypt.py", line 965, in
main()
File "C:\users\x\firefox-decrypt.py", line 946, in main
csv_quotechar=args.quotechar,
File "C:\users\x\firefox-decrypt.py", line 556, in decrypt_passwords
csv_writer.writerow(output)
File "C:\Program Files\Python37\lib\csv.py", line 155, in writerow
return self.writer.writerow(self._dict_to_list(rowdict))
File "C:\Program Files\Python37\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u03a7' in position 30: character maps to
The symbol \u03a7 seems to be Greek capital Chi, no idea why that is in one of my entries but whatever.
I was able to work around the bug by changing line 555 from if PY3:
to if PY3 and False:
, i.e. forcing it to use the encoding on line 558. The csv output now entirely consists of entries like this:
"b'https://example.com'";"b'example'";"b'password'"
Not ideal, but I can work with it. I'm only using this to run a diff between my newer Windows install and my older Linux install, copy a few passwords to the older install, and be able to uninstall Windows altogether. (I can't just move the profile because the old one has an older Firefox due to add-on incompatibility.)
Your system (please complete the following information):
thank u for this program, it saved me
The bug
On NixOS (currently latest stable), firefox decrypt cannot find libnss3.so
, probably because NixOS stores libraries within its store (which is in /nix/store/
), and firefox decrypt does't look for libnss3.so
there.
To Reproduce
$ git clone https://github.com/unode/firefox_decrypt
[...]
$ cd firefox_decrypt
$ nix-shell -p python39
[...]
$ python firefox_decrypt.py
ERROR [...]
Logs
$ python firefox_decrypt.py
2021-06-13 11:29:49,606 - ERROR - Couldn't find or load 'libnss3.so'. This library is essential to interact with your Mozilla profile.
2021-06-13 11:29:49,606 - ERROR - If you are seeing this error please perform a system-wide search for 'libnss3.so' and file a bug report indicating any location found. Thanks!
2021-06-13 11:29:49,606 - ERROR - Alternatively you can try launching firefox_decrypt from the location where you found 'libnss3.so'. That is 'cd' or 'chdir' to that location and run firefox_decrypt from there.
2021-06-13 11:29:49,606 - ERROR - Please also include the following on any bug report. Errors seen while searching/loading NSS:
2021-06-13 11:29:49,606 - ERROR - Error when loading libnss3.so was libnss3.so: cannot open shared object file: No such file or directory
2021-06-13 11:29:49,606 - ERROR - Error when loading /usr/lib64/libnss3.so was /usr/lib64/libnss3.so: cannot open shared object file: No such file or directory
2021-06-13 11:29:49,606 - ERROR - Error when loading /usr/lib64/nss/libnss3.so was /usr/lib64/nss/libnss3.so: cannot open shared object file: No such file or directory
2021-06-13 11:29:49,606 - ERROR - Error when loading /usr/lib/libnss3.so was /usr/lib/libnss3.so: cannot open shared object file: No such file or directory
2021-06-13 11:29:49,606 - ERROR - Error when loading /usr/lib/nss/libnss3.so was /usr/lib/nss/libnss3.so: cannot open shared object file: No such file or directory
2021-06-13 11:29:49,606 - ERROR - Error when loading /usr/local/lib/libnss3.so was /usr/local/lib/libnss3.so: cannot open shared object file: No such file or directory
2021-06-13 11:29:49,606 - ERROR - Error when loading /usr/local/lib/nss/libnss3.so was /usr/local/lib/nss/libnss3.so: cannot open shared object file: No such file or directory
2021-06-13 11:29:49,606 - ERROR - Error when loading /opt/local/lib/libnss3.so was /opt/local/lib/libnss3.so: cannot open shared object file: No such file or directory
2021-06-13 11:29:49,606 - ERROR - Error when loading /opt/local/lib/nss/libnss3.so was /opt/local/lib/nss/libnss3.so: cannot open shared object file: No such file or directory
2021-06-13 11:29:49,606 - ERROR - Error when loading /home/user/.nix-profile/lib/libnss3.so was /home/user/.nix-profile/lib/libnss3.so: cannot open shared object file: No such file or directory
Technical information
Additional information
The actual path for libnss3.so
is /nix/store/22xfq369sx8dqfxv9g1rixjaiw12j0f5-nss-3.53.1/lib/libnss3.so
, but it cannot be reliably hard-coded, because 22xfq369sx8dqfxv9g1rixjaiw12j0f5
is the hash of the derivation, not of the package, which might change.
Thx for your script!
I'm beginning to use PASS on my Linux PC. So i wanted to test your script
I've download the latest firefox_decrypt.py
and tried running python firefox_decrypt.py
.
I get this syntax error with python 2:
File "firefox_decrypt.py", line 40
LOG: logging.Logger
^
SyntaxError: invalid syntax
With Python 3:
Traceback (most recent call last):
File "firefox_decrypt.py", line 46, in <module>
PWStore = list[dict[str, str]]
TypeError: 'type' object is not subscriptable
Can you help ? Thanks
I've never used python before but am trying to decrypt my email password from firefox (haven't had any luck updating my firefox profile)! I've located the enrypted password but don't know how to use python. If anybody can help I would be so grateful. I will literally pay you.
I put nss3.dll in the script folder and run it from a CMD shell with the script in the working directory.
2018-10-11 21:20:33,456 - ERROR - Problems opening 'nss3.dll' required for password decryption
2018-10-11 21:20:33,456 - ERROR - Error was [WinError 126] Unable to find the specified module.
Ps. Can't the script just download the dll from the internet if not found?
Hello,
This issue is similar to #3
My system info:
Windows 10, 64 bit
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)]
Firefox 59.0.3 (64-bit)
Have attached the detailed log: decrypt_output.log
Please let me know if you require any more details.
There's no way to pass Master password if "--no-interactive" enabled (Windows).
python firefox_decrypt.py -nc 2
2020-06-08 05:51:20,312 - INFO - Running firefox_decrypt version: 0.8.0+git
Traceback (most recent call last):
File "firefox_decrypt.py", line 1010, in <module>
main()
File "firefox_decrypt.py", line 985, in main
nss.authenticate(args.interactive)
File "firefox_decrypt.py", line 498, in authenticate
password = ask_password(self.profile, interactive)
File "firefox_decrypt.py", line 787, in ask_password
if sys.stdin in select.select([sys.stdin], [], [], 0)[0]:
OSError: [WinError 10038] An operation was attempted on something that is not a socket
There should be an option to allow Master password can be passed from command line argument, eg:
python firefox_decrypt.py -nc 2 --password "abc123"
Windows has been a second class citizen where sporadic testing was done and bugs fixed based on user feedback. Tests are written in Bash so it's difficult to run them on Windows unless a cygwin environment is used.
After #28 which pointed out serious flaws related with encoding, primarily visible in non-ASCII deployments, it became clear that to properly support Windows automated testing is required.
AppVeyor stood out as a nice platform for this. AppVeyor is now setup and ready to be merged on #29, however we still need tests to be compatible with Windows.
This will also help the work on #25 which proposed the use of hypotesis, a python testing framework.
Ongoing work lives in the pytests branch.
Hi Renato, my logins.json contains several records with '"encType":0' items (and corresponding "encryptedPassword": item is plaintext value). It seems as 'firefox_decrypt.py' ignore encType value and try decode this value and then crashes:
Traceback (most recent call last):
File "/home/hanzlik/firefox_decrypt.py", line 250, in <module>
main()
File "/home/hanzlik/firefox_decrypt.py", line 237, in main
out = decrypt_passwords(profile, password)
File "/home/hanzlik/firefox_decrypt.py", line 147, in decrypt_passwords
passwd.data = cast(c_char_p(b64decode(passw)), c_void_p)
File "/usr/lib/python2.7/base64.py", line 76, in b64decode
raise TypeError(msg)
TypeError: Incorrect padding
Line 147 is: 'passwd.data = cast(c_char_p(b64decode(passw)), c_void_p)'
I was getting an error like this while trying to use nss3 from both Firefox and Thunderbird.
2017-03-25 21:48:28,524 - ERROR - Error was dlopen(libnss3.dylib, 6): Library not loaded: @executable_path/libmozglue.dylib
Referenced from: /Users/joao/Applications/FirefoxDeveloperEdition.app/Contents/MacOS/libnss3.dylib
Reason: unsafe use of @executable_path in libnss3.dylib with restricted binary
From https://bugzilla.mozilla.org/show_bug.cgi?id=578751 this is an issue that isn't going to be solved.
My final solution was to install nss from homebrew with brew install nss
and adding "/usr/local/opt/nss/lib",
to the paths of nss library in Darwin (around line 245).
Just opening this to inform others.
C:\Users\Алиса\Desktop>C:\Users\Алиса\Desktop\firefox_decrypt.py
Traceback (most recent call last):
File "C:\Users\Lышёр\Desktop\firefox_decrypt.py", line 794, in
main()
File "C:\Users\Lышёр\Desktop\firefox_decrypt.py", line 767, in main
nss.load_profile(profile)
File "C:\Users\Lышёр\Desktop\firefox_decrypt.py", line 325, in load_profile
e = self.NSS._NSS_Init(b"sql:" + self.profile.encode("utf8"))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc0 in position 9: ordinal
not in range(128)
This is a strange one, probably related with how python2 "guesses" the output encoding.
python2 firefox_decrypt.py
works fine, but:
python2 firefox_decrypt.py | grep anything
fails with ascii encoding errors if url, username or password contain special characters.
ismi@kali:~/Downloads/firefox_decrypt-master$ sudo python firefox_decrypt.py --list
2020-04-17 23:07:16,733 - WARNING - profile.ini not found in /root/.mozilla/firefox
2020-04-17 23:07:16,733 - WARNING - Continuing and assuming '/root/.mozilla/firefox' is a profile location
2020-04-17 23:07:16,733 - ERROR - Listing single profiles not permitted.
I get this error on my current version of firefox 68.7.0.
Is your feature request related to a problem? Please describe.
No, I just like standardized code :)
Describe the solution you'd like
Adjust to coding standards, that means especially to introduce line breaks at appropriate places.
Add e.g. flake8 to wercker.yml
, maybe as it has been done at this example
Describe alternatives you've considered
There might be more scripts which could do a similar job
Additional context
I just tried running flake8
locally and the output was this:
Hi Unode and thank you very much for your work !
When first running the code, I stumble over the following issue. Would you have any hint on how to solve it ?
Traceback (most recent call last):
File "C:\Users...\firefox_decrypt.py", line 46, in
PWStore = list[dict[str, str]]
TypeError: 'type' object is not subscriptable
Thank you very much !
HI, I started firefox_decrypt in the following way and got this error, what can be the problem?
(py3.9) C:\Users\MyPC\Desktop\firefox_decrypt-master>python firefox_decrypt.py
2021-07-02 17:18:54,035 - WARNING - Running with unsupported encoding 'locale': cp1252 - Things are likely to fail from here onwards
Traceback (most recent call last):
File "C:\Users\MyPC\Desktop\firefox_decrypt-master\firefox_decrypt.py", line 1106, in
main()
File "C:\Users\MyPC\Desktop\firefox_decrypt-master\firefox_decrypt.py", line 1087, in main
profile = get_profile(basepath, args.interactive, args.choice, args.list)
File "C:\Users\MyPC\Desktop\firefox_decrypt-master\firefox_decrypt.py", line 858, in get_profile
profiles: ConfigParser = read_profiles(basepath)
File "C:\Users\MyPC\Desktop\firefox_decrypt-master\firefox_decrypt.py", line 842, in read_profiles
profiles.read(profileini)
File "C:\Users\MyPC\anaconda3\envs\py3.9\lib\configparser.py", line 697, in read
self._read(fp, filename)
File "C:\Users\MyPC\anaconda3\envs\py3.9\lib\configparser.py", line 1082, in _read
raise MissingSectionHeaderError(fpname, lineno, line)
configparser.MissingSectionHeaderError: File contains no section headers.
file: 'C:\Users\MyPC\AppData\Roaming\Mozilla\Firefox\profiles.ini', line: 1
'ÿþ[\x00I\x00n\x00s\x00t\x00a\x00l\x00l\x003\x000\x008\x000\x004\x006\x00B\x000\x00A\x00F\x004\x00A\x003\x009\x00C\x00B\x00]\x00\n'
program terminates with error
2016-08-29 13:53:05,943 - ERROR - Problems opening 'nss3.dll' required for password decryption
2016-08-29 13:53:05,943 - ERROR - Error was [WinError 126] The specified module could not be found
seems to be a version issue as the nss3 is in FF and other dirs on the path
Help us reproduce your problem
I have installed Firefox 63 and Firefox ESR 52 in parallel on Ubuntu-64 18.04 de_DE.
I have installed Thunderbird 60.
Describe the bug
I can export passwords without problem from old backup profile (~1 year) which was used with old TB version 52 and also from both FF profiles version 52-ESR and 63.
I fail to export passwords from current profile of current TB version 60.
Maybe because I have installed Firefox ESR 52 in parallel, the wrong libnss3 is fetched.
To Reproduce
Steps to reproduce the behavior:
firefox_decrypt
with the following command-line arguments ...I ended up here searching a way to import passwords from an Opera exported CSV. I was able to find a lot of projects decrypting the firefox database, but any that can encrypt again it.
This feature would be very useful because you would be able to add new contents automatically (and not one by one using firefox lockwise) and the re-encrypt database.
I think it should not be so complex, just reversing the procedure used to decrypt, but I am not very expert in cryptography.
I have a large number of passwords. Program gets part way through the passwords and then stops with:
2018-08-26 13:42:19,614 - ERROR - Password decryption failed. Passwords protected by a Master Password!
Note it works for a while, then the error.
Python 3.7.0 64-bit
While trying to export my passwords I get an error: Error - Passwords protected by a Master Password!
I'm sure I enter correct master password. What is the culprit?
Full output:
Select the Firefox profile you wish to decrypt
1 -> bgpdiy8n.default-1373553171844
Choice: 1
Master Password for profile /home/yz/.mozilla/firefox/bgpdiy8n.default-1373553171844:
Info - Using /home/yz/.mozilla/firefox/bgpdiy8n.default-1373553171844/logins.json for credentials.
Error - Passwords protected by a Master Password!
$ git describe --tags
0.5.4-3-gf6d16af
$ ./firefox_decrypt -vvvvvvvvv # verbose overflow :D
2017-02-03 15:05:28,862 - DEBUG - Parsed commandline arguments: Namespace(choice=None, export_pass=False, list=False, no_interactive=False, profile='~/.mozilla/firefox', verbose=9)
2017-02-03 15:05:28,862 - DEBUG - Skipping password store test, not exporting
2017-02-03 15:05:28,862 - DEBUG - Loading NSS library from libnss3.so
2017-02-03 15:05:28,864 - DEBUG - Reading profiles from /home/christoph/.mozilla/firefox/profiles.ini
2017-02-03 15:05:28,865 - DEBUG - Read profiles ['General', 'Profile0', 'Profile1', 'Profile2', 'Profile3', 'Profile4']
Select the Firefox profile you wish to decrypt
1 -> 91u1xh15.[Profile 1]
2 -> vu3dnx5b.[Profile 2]
3 -> 1d8vcooi.[Profile 3]
4 -> emof2pes.[Profile 4]
5 -> 8a52xmxd.Fresh
Choice: 5
2017-02-03 15:05:47,516 - DEBUG - Profile selection matched 8a52xmxd.Fresh
Master Password for profile /home/christoph/.mozilla/firefox/8a52xmxd.Fresh:
2017-02-03 15:05:53,011 - DEBUG - Initializing NSS with profile path '/home/christoph/.mozilla/firefox/8a52xmxd.Fresh'
2017-02-03 15:05:53,016 - DEBUG - Initializing NSS returned 0
2017-02-03 15:05:53,016 - DEBUG - Retrieving internal key slot
2017-02-03 15:05:53,016 - DEBUG - Internal key slot -1009786480
2017-02-03 15:05:53,017 - DEBUG - Authenticating with password '[Password]'
Segmentation fault
Removed Profile 1-4 Names & the Password from Log.
On openSUSE Leap 15.0 (kernel 4.12.14, python 2.7.14) I see during command
python bin/firefox_decrypt -c 1 --export-pass
a lot of Website, Username, and Password entries but then it fails suddenly with
Traceback (most recent call last):
File "/suse/werner/bin/firefox_decrypt", line 965, in <module>
main()
File "/suse/werner/bin/firefox_decrypt", line 946, in main
csv_quotechar=args.quotechar,
File "/suse/werner/bin/firefox_decrypt", line 536, in decrypt_passwords
user, passw = self.decode_entry(user, passw)
File "/suse/werner/bin/firefox_decrypt", line 503, in decode_entry
passw = self.NSS.decode(passw64)
File "/suse/werner/bin/firefox_decrypt", line 400, in decode
data = b64decode(data64)
File "/usr/lib64/python2.7/base64.py", line 78, in b64decode
raise TypeError(msg)
TypeError: Incorrect padding
I guess that as my password are autogenerated not only with characters and numbers but also with special signs, that the script is running onto CVS quote/delimeter character
I have used it in the past with success.
Now, I am using Quantum Nightly, and I get this error message on run:
2018-01-05 17:12:08,531 - ERROR - Couldn't initialize NSS, maybe '/home/mautematico/.mozilla/firefox/mauricio' is not a valid profile?
libnss3
is already installed on my Debian box
This is not a bug-report, this is a simple note to say thank-you for writing this utility and for making it available.
Having moved to a new computer using this tool allowed me to easily export the few passwords which I'd not previously migrated to the pass application.
Very handy, very useful, and worked without a problem for me.
The trigger was from this thread: #25 (comment)
I get a segfault in line 119. Do you know whats wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.