Giter VIP home page Giter VIP logo

ffpass's Introduction

PyPI version Downloads

ffpass - Import and Export passwords for Firefox Quantum

The latest version of Firefox doesn't allow to import or export the stored logins and passwords as a file.

This tools interacts with the encrypted password database of Firefox to provide these features.

Installation

ffpass requires Python 3.6+ and will work with Firefox 58+

pip install ffpass

Features

  • Supports master passwords
  • Automatic profile selection for Linux, macOS and Windows
  • Export to CSV
  • Import from CSV compatible with Google Chrome

Note: Firefox must be closed during the whole process, as these actions change its database.

Note: If you have Sync enabled, you'll have to disconnect and reconnect your Firefox account after importing the passwords.

Export to CSV

ffpass export > passwords.csv
ffpass export -f passwords.csv
ffpass export --file passwords.csv

Usage

usage: ffpass export [-h] [-t TO_FILE] [-d DIRECTORY] [-v]

outputs a CSV with header `url,username,password`

optional arguments:
  -h, --help            show this help message and exit
  -f FILE, --file FILE  file to export password (defaults to stdout)
  -d DIRECTORY, --directory DIRECTORY, --dir DIRECTORY
                        Firefox profile directory
  -v, --verbose

Import from CSV

ffpass import < passwords.csv
ffpass import -f passwords.csv
ffpass import --file passwords.csv

By default, it works with the passwords exported from Google Chrome.

Usage

usage: ffpass import [-h] [-f FROM_FILE] [-d DIRECTORY] [-v]

imports a CSV with columns `url,username,password` (order insensitive)

optional arguments:
  -h, --help            show this help message and exit
  -f FILE, --file FILE  file to import from (defaults to stdin)
  -d DIRECTORY, --directory DIRECTORY, --dir DIRECTORY
                        [Firefox profile directory](https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data#w_how-do-i-find-my-profile)
  -v, --verbose

Formatting

For CSV files not exported from Google Chrome, take these formatting rules into consideration:

1. The CSV must have the headers "url", "username", and "password". Any other columns will be safely ignored.
2. The url must be formatted to include all prefixes ("http://", "https://", etc), or ffpass will not be able to read them correctly.
3. ffpass does not care if the CSV has quotes around fields, even if some fields have them and others don't.

Transfer from Google Chrome to Firefox

Now, Firefox can more accurately import logins saved in Chrome/Chromium on Windows and macOS (including timestamps, deduping, http auth. logins, etc.) so you don't need to use this tool on those operating systems. See File > Import from Another Browser… in Firefox to import.

Export from Google Chrome

  1. Open Chrome and enter the following in the address bar: chrome://flags/#PasswordExport
  2. Click Default next to “Password export” and choose Enabled.
  3. Click Relaunch Now. Chrome will restart.
  4. Click the Chrome menu in the toolbar and choose Settings.
  5. Scroll to the bottom and click Advanced.
  6. Scroll to the “Passwords and forms” section and click “Manage passwords”.
  7. Click next to Saved Passwords and choose Export.
  8. Click Export Passwords, enter the password you use to log in to your computer, and save the file to passwords.csv (or any other available name).

(instructions from https://support.1password.com/import-chrome/)

Import in Firefox

  1. Stop Firefox
  2. Import into Firefox:
ffpass import --file passwords.csv

Restart Firefox, making sure it didn't leave any process still open.

Transfer from Firefox to Google Chrome

Export from Firefox

  1. Stop Firefox
  2. Export from Firefox:
ffpass export --file passwords.csv

Import in Google Chrome

  1. Open Chrome and enter the following in the address bar: chrome://flags/#PasswordImport
  2. Click Default next to “Password import” and choose Enabled.
  3. Click Relaunch Now. Chrome will restart.
  4. Click the Chrome menu in the toolbar and choose Settings.
  5. Scroll to the bottom and click Advanced.
  6. Scroll to the “Passwords and forms” section and click “Manage passwords”.
  7. Click next to Saved Passwords and choose Import.
  8. Select the file passwords.csv and click Import.

Troubleshoot

  • ffpass export: error: the following arguments are required: -d/--directory/--dir

    It means one of the following (launch with option --verbose to know):

    • Automatic profile selection is not supported for your platform.
    • There is more than one user profile for Firefox.

    You have to provide the --dir option with your Firefox Profile Folder. To find it, follow these instructions on the website of Firefox.

  • Firefox password database is empty. Please create it from Firefox.

    It means that Firefox currently doens't store any password. ffpass cannot create the password database for security reasons. Just add one password manually to Firefox to create the database.

  • TypeError: 'PosixPath' object is not iterable

    See #17.

  • Empty url field ("example.com") in Firefox after importing: the urls of the source csv file must begin with a scheme (http://, https://, ftp://, etc…)

  • Passwords do not sync to other devices, including Lockwise app.

    Importing passwords break the sync. You'll have to disconnect the Firefox account in the Sync options and the re-add it.

Credits

Thanks a lot to @lclevy for the retro-engineering! I was inspired by his repository https://github.com/lclevy/firepwd.

ffpass's People

Contributors

apahomov avatar fregante avatar kittlish avatar lc43 avatar louisabraham avatar mnoorenberghe avatar prekageo avatar psarka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ffpass's Issues

Export the same fields as Password Exporter to be compatible with it

It would be great if ffpass could read and import (and export) the same csv files created by the old Password Exporter.
Format was like this:

# Generated by Password Exporter; Export format 1.1; Encrypted: false
"hostname","username","password","formSubmitURL","httpRealm","usernameField","passwordField"

In fact, ffpass does not work 100% for me because in some sites the httprealm field is relevant.

Getting An Error on a CSV exported from 1Password

HI all, I am a bit of newbie, so the answer may be super obvious, but I exported a CSV from 1password to import into firefox. I reformatted it with just the url, username and password with those three titles as header information. When I attempt an import, I get the error below... any thoughts? Thanks!

MacBook-Pro-5:desktop kel$ ffpass import --from passwords.csv
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/bin/ffpass", line 10, in
sys.exit(main())
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ffpass/init.py", line 339, in main
args.func(args)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ffpass/init.py", line 282, in main_import
logins = readCSV(args.from_file)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ffpass/init.py", line 181, in readCSV
for row in reader:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/csv.py", line 111, in next
self.fieldnames
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/csv.py", line 98, in fieldnames
self._fieldnames = next(self.reader)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 3846-3847: invalid continuation byte

"Firefox password database is empty." but one password already saved in Firefox.

Hi, I've ran into an. issue trying to import a csv into Firefox. This is what the terminal gives me...

Rileys-MacBook-Air:~ rileydumont$ ffpass import -f /Users/rileydumont/Desktop/Passwords.csv -d /Users/rileydumont/Library/Application/Support/Firefox/Profiles/prmmo8pp.default
Firefox password database is empty. Please create it from Firefox.
Rileys-MacBook-Air:~ rileydumont$

Which the guide on here says

Firefox password database is empty. Please create it from Firefox.

It means that Firefox currently doens't store any password. ffpass cannot create the password database for security reasons. Just add one password manually to Firefox to create the database.

And doesn't say anything else. However as you can see here...

Screen Shot 2019-05-30 at 5 06 49 PM

I do have one entry in Firefox. Perhaps there's some incompatibility somewhere I don't know about, or I'm looking at the wrong password keychain? Not really sure what exactly the issue is or where to look anymore. Any guidance?

Running MacOS 10.14.5 and Firefox 67.0

I don't know how to use ffpass

Hello! I have tried to figure out how to use this for 5 hours now, and I'm so lost. I have a MacBook Pro, running MacOS Mojave. I have managed to create a .CSV file with all the passwords, exported from chrome with all the passwords. But I don't know how to get them in to Firefox. I don't even know if I should use Terminal or Xcode or whatever. I have installed Python3, and have an app called IDLE and Python Launcher, is that one of the apps I should use?

Not working inside virtual environment

I've tried to use it installing it through pip3 in a virtual environment in mac and I'm getting error:

File "/usr/local/bin/ffpass", line 7, in <module>
    from ffpass import main
  File "/usr/local/lib/python3.6/site-packages/ffpass/__init__.py", line 41, in <module>
    from Crypto.Cipher import DES3
ModuleNotFoundError: No module named 'Crypto'

But if I do a pip3 install Crypto says requirement already satisfied

CSV format problem

So my csv file contains url,username,password columns but I'm getting this error

raceback (most recent call last):
  File "/usr/bin/ffpass", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python3.7/site-packages/ffpass/__init__.py", line 339, in main
    args.func(args)
  File "/usr/lib/python3.7/site-packages/ffpass/__init__.py", line 282, in main_import
    logins = readCSV(args.from_file)
  File "/usr/lib/python3.7/site-packages/ffpass/__init__.py", line 182, in readCSV
    logins.append((rawURL(row["url"]), row["username"], row["password"]))
KeyError: 'url'

The url column has https or http everywhere.

Error with exporting on Ubuntu

Hello. When I try to use this app, I receive the error:
$ ffpass export -v Traceback (most recent call last): File "/home/user552/.local/bin/ffpass", line 7, in <module> from ffpass import main File "/home/user552/.local/lib/python3.5/site-packages/ffpass/__init__.py", line 62 dbfile: Path = directory / "key4.db" ^ SyntaxError: invalid syntax
Could you help me?
Thanks

CSV format compatibility problem

Not working with the chrome exported csv which with the following foramt:

name,url,username,password

the import action prints fails with message below:

$ ffpass import --from my_chrome_pswds.csv
Traceback (most recent call last):
  File "/usr/local/bin/ffpass", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/ffpass/__init__.py", line 292, in main
    args.func(args)
  File "/usr/local/lib/python3.7/site-packages/ffpass/__init__.py", line 251, in main_import
    logins = readCSV(args.from_file)
  File "/usr/local/lib/python3.7/site-packages/ffpass/__init__.py", line 161, in readCSV
    logins.append((rawURL(row['url']),
KeyError: 'url'

However, I managed to import by modifying the format:

  • remove the header line
  • remove the name column for each entry

Imported passwords does not sync with other devices

Feel free to merge with issue #11.

I successfully imported passwords from a csv I exported from Chrome into Firefox on my MacOS device. Unfortunately the logins does not sync with my iPhone. The only login credentials that I have access to via sync are those saved using Firefox.

Reconnecting my Firefox account on my iPhone does not help. This issue seems to be affecting lockwise as well as noted in #25.

RuntimeError: generator raised StopIteration

When trying to import
sudo ffpass import -f /Users/crkd/Downloads/passwords.csv -d /Users/crkd/Library/Application\ Support/Firefox/Profiles/xxxxxxxx.default-release -v

It's returning the error

There is more than one profile
key=d86f5b93dc06a7e48c74c1b2eb46ceb8a54d5a5e94639236 iv=a53fd0c56705470f
password checked
key=95282f6971b4b7a18f71aa833c5524fd9eeeb83e45f15088 iv=648e12dace0e658d
3deskey a80e02e0a210899d5e2ceff4387fa4efa702baecaddce6c20808080808080808
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/ffpass/__init__.py", line 180, in lower_header
    yield next(it).lower()
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/ffpass", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/ffpass/__init__.py", line 354, in main
    args.func(args)
  File "/usr/local/lib/python3.7/site-packages/ffpass/__init__.py", line 289, in main_import
    logins = readCSV(args.from_file)
  File "/usr/local/lib/python3.7/site-packages/ffpass/__init__.py", line 187, in readCSV
    for row in reader:
  File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/csv.py", line 111, in __next__
    self.fieldnames
  File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/csv.py", line 98, in fieldnames
    self._fieldnames = next(self.reader)
RuntimeError: generator raised StopIteration

Some cursory googling suggests this is due to python 3.7? I'm currently trying on macOS Mojave 10.14. However, I just ran this perfectly fine on macOS Catalina 10.15 the other day with no errors.

Unable to install

I keep getting this message

ERROR: Could not find a version that satisfies the requirement ffpass (from versions: none)
ERROR: No matching distribution found for ffpass

My system info:
Firefox 67.0.4
MacOS Mojave

ffpass on Windows

Hi,
i tried to import an csv-file with passwords to Firefox.

So I installed on my windows-system Python 3.8 and downloaded ffpass.

But now i really don´t know what I have to do with the .py-file.

I hope somene can help me by this way?

Best regards
Scofield

Can't import passwords from Chromium

When i trying to import passwords with that command
~/.local/bin/ffpass import --from passes.csv
it says

usage: ffpass import [-h] [-f FROM_FILE] -d DIRECTORY [-v]
ffpass import: error: the following arguments are required: -d/--directory/--dir

I tried to start it with -d argument, but see next error:
~/.local/bin/ffpass import --from passes.csv -d ~/.mozilla/firefox/81dhfo76.default-release/

Traceback (most recent call last):
  File "/home/bartlebi/.local/bin/ffpass", line 8, in <module>
    sys.exit(main())
  File "/home/bartlebi/.local/lib/python3.8/site-packages/ffpass/__init__.py", line 354, in main
    args.func(args)
  File "/home/bartlebi/.local/lib/python3.8/site-packages/ffpass/__init__.py", line 287, in main_import
    key = askpass(args.directory)
  File "/home/bartlebi/.local/lib/python3.8/site-packages/ffpass/__init__.py", line 254, in askpass
    key = getKey(directory, password)
  File "/home/bartlebi/.local/lib/python3.8/site-packages/ffpass/__init__.py", line 93, in getKey
    entrySalt = decodedA11[0][1][0].asOctets()
AttributeError: 'Sequence' object has no attribute 'asOctets'

Whats wrong?
I tried to use antoher one likely profile directory in this locations
~/.local/bin/ffpass import --from passes.csv -d ~/.mozilla/firefox/718lhm58.default/
but ffpass says

Firefox password database is empty. Please create it from Firefox.

UnicodeDecodeError in decodeLoginData

ffpass 0.4.8, python 3.7.3 on Linux/openSUSE/Tumbleweed. Locale cs_CZ.UTF-8

~@stitny$ ffpass export --to passwords.csv
Traceback (most recent call last):
  File "/home/matej/.local/bin/ffpass", line 8, in <module>
    sys.exit(main())
  File "/home/matej/.local/lib/python3.7/site-packages/ffpass/__init__.py", line 354, in main
    args.func(args)
  File "/home/matej/.local/lib/python3.7/site-packages/ffpass/__init__.py", line 269, in main_export
    logins = exportLogins(key, jsonLogins)
  File "/home/matej/.local/lib/python3.7/site-packages/ffpass/__init__.py", line 171, in exportLogins
    decodeLoginData(key, encUsername),
  File "/home/matej/.local/lib/python3.7/site-packages/ffpass/__init__.py", line 133, in decodeLoginData
    return PKCS7unpad(des.decrypt(ciphertext)).decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 0: invalid start byte
~@stitny$

Key Error 'url'

Hey,

I've encountered an error during the import of a CSV file.

That's the output of my command : ffpass import --from example.csv --verbose

Traceback (most recent call last):
  File "/usr/local/bin/ffpass", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/ffpass/__init__.py", line 346, in main
    args.func(args)
  File "/usr/local/lib/python3.7/site-packages/ffpass/__init__.py", line 289, in main_import
    logins = readCSV(args.from_file)
  File "/usr/local/lib/python3.7/site-packages/ffpass/__init__.py", line 188, in readCSV
    logins.append((rawURL(row["url"]), row["username"], row["password"]))
KeyError: 'url'

Even though I've the latest Python version and solved the trouble I've had with the Firefox profiles. Do you have any idea ?

Thanks !

Bug in Python 3.6.0 and 3.7.0

I ran into this bug while using ffpass:
configparser.ConfigParser.read() does not accept Pathlib path as a single argument.

Fix this error by upgrading your Python version. I'm leaving this issue here so that others can find it and solve the problem.

Specifically, with Python 3.6.0 (and from the link above it looks like it also affects some versions of 3.7+) I ran into the following error:

ffpass import -f cpwds.csv
Traceback (most recent call last):
  File "/Users/ajc/miniconda3/bin/ffpass", line 11, in <module>
    sys.exit(main())
  File "/Users/ajc/miniconda3/lib/python3.6/site-packages/ffpass/__init__.py", line 329, in main
    guessed_dir = guessDir()
  File "/Users/ajc/miniconda3/lib/python3.6/site-packages/ffpass/__init__.py", line 223, in guessDir
    config.read(path / "profiles.ini")
  File "/Users/ajc/miniconda3/lib/python3.6/configparser.py", line 693, in read
    for filename in filenames:
TypeError: 'PosixPath' object is not iterable

In my case upgrading from 3.6.0 to 3.6.8 fixed the issue.

KeyError: "url" ? Cannot import my csv file to Firefox

Hey,
I've been trying for so long migrating from Safari to Firefox, that's how I found you, and this is amazing.

I've a CSV file which I successfully got from the mrc converter suite (script that opened and copied all my logins/passwords blablablabla)

Now that I've installed Python and ffpass, I'm getting this error when I try to import the file to Firefox

mbp-de-tom:~ autodrive$ ffpass import -f /Users/autodrive/Documents/pw/passwords\ copie\ 2.csv 
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/bin/ffpass", line 10, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ffpass/__init__.py", line 346, in main
    args.func(args)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ffpass/__init__.py", line 289, in main_import
    logins = readCSV(args.from_file)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ffpass/__init__.py", line 188, in readCSV
    logins.append((rawURL(row["url"]), row["username"], row["password"]))
KeyError: 'url'
mbp-de-tom:~ autodrive$ 

I actually don't know what it means and how I could resolve this, so you can you help ? Thank you so much in advance! :)

here how my file looks in textedit
screen2

and in preview
screen

AttributeError: Sequence object has no attribute asOctets

Hi, when I try to import password CSV from Chromium I get the following error:

$ ffpass import --from pw.csv
Traceback (most recent call last):
  File "/usr/bin/ffpass", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.8/site-packages/ffpass/__init__.py", line 354, in main
    args.func(args)
  File "/usr/lib/python3.8/site-packages/ffpass/__init__.py", line 287, in main_import
    key = askpass(args.directory)
  File "/usr/lib/python3.8/site-packages/ffpass/__init__.py", line 254, in askpass
    key = getKey(directory, password)
  File "/usr/lib/python3.8/site-packages/ffpass/__init__.py", line 93, in getKey
    entrySalt = decodedA11[0][1][0].asOctets()
AttributeError: 'Sequence' object has no attribute 'asOctets'

I am using Arch Linux with Python 3.8.1, pyasn1 0.4.8, and ffpass 0.4.8.

not support utf8?

C:\Users\chenx\Desktop>ffpass import -f Vivaldi.csv -d C:\Users\chenx\AppData\Roaming\Mozilla\Firefox\Profiles\xxxxxxxx.default-xxxxxxxxx
Traceback (most recent call last):
  File "c:\program files\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\program files\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\Python37\Scripts\ffpass.exe\__main__.py", line 9, in <module>
  File "c:\program files\python37\lib\site-packages\ffpass\__init__.py", line 346, in main
    args.func(args)
  File "c:\program files\python37\lib\site-packages\ffpass\__init__.py", line 289, in main_import
    logins = readCSV(args.from_file)
  File "c:\program files\python37\lib\site-packages\ffpass\__init__.py", line 187, in readCSV
    for row in reader:
  File "c:\program files\python37\lib\csv.py", line 112, in __next__
    row = next(self.reader)
  File "c:\program files\python37\lib\site-packages\ffpass\__init__.py", line 181, in lower_header
    yield from it
UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 2593: illegal multibyte sequence

Failing with Firefox password database empty when it's not

Hello. I have the same issue than the one described here #20
I had run it previously successfully for export/import maybe one month ago.
I reinstalled Ubuntu 18.04 and Firefox and

ffpass without -d option is failing with "ffpass import: error: the following arguments are required: -d/--directory/--dir"

ffpass with -d being the directory of the password file (this way it has worked before) is failing with "Firefox password database is empty. Please create it from Firefox."

I tried to find the directory of Firefox where profiles are stored and didn't find it, yet I have some passwords stored.

'ffpass' is a package and cannot be directly executed

Hi, I installed Python using this guide. Version 3.9.0.

The ffpass command didn't work right away so after searching around I came across a suggestion to use

python3 -m ffpass

However, when running this I get the following message:
/Users/mandi/.pyenv/versions/3.9.0/bin/python3: No module named ffpass.__main__; 'ffpass' is a package and cannot be directly executed

Any suggestions much appreciated.

If it helps:
mandi@Hodor ~ % which python3
returns
/Users/mandi/.pyenv/shims/python3

Also:
mandi@Hodor ~ % pip3 install ffpass Requirement already satisfied: ffpass in ./.local/lib/python3.9/site-packages (0.5.0) Requirement already satisfied: pyasn1 in ./.local/lib/python3.9/site-packages (from ffpass) (0.4.8) Requirement already satisfied: pycryptodome in ./.local/lib/python3.9/site-packages (from ffpass) (3.10.1) WARNING: You are using pip version 20.2.3; however, version 21.0.1 is available. You should consider upgrading via the '/Users/mandi/.pyenv/versions/3.9.0/bin/python3.9 -m pip install --upgrade pip' command.

Firefox password database is empty. Please create it from Firefox.

Hi Louis.
Thanks for your cool trick to transfer passwords from Chrome to Firefox.
I have this problem and i checked all of this topics but it does not work at all for me.
This is the code i use in ffpass : ffpass import --from /Users/pedi/Desktop/Chrome\ Paaasads/Chrome\ Passwords.csv -d /Users/pedi/Library/Application/Support/Firefox/Profiles/tkjea2ij.default

I am a bit amateur. Can you please help me about it?

How to export from Firefox (and maybe import to keychain)

Hi, I'd like to thank @louisabraham for the tool, it's really helpful. I have one issue though, I'm new to this kind of stuff and what I was trying to do is to follow the steps explained in this article https://medium.com/@suparn/import-lastpass-1password-etc-passwords-into-icloud-keychain-6cb965da4298 , unfortunately, it isn't clear to me how I can export passwords from firefox using ffpass. I managed to to import them with ffpass but not to do the rest. Thanks in advance.

SubstrateUnderrunError: 94-octet short

I'm trying to use this tool to export my Firefox-65.0 passwords on a Linux (Fedora) system, and it is crashing:

$ ffpass export > passwords.csv
Traceback (most recent call last):
  File "/usr/local/bin/ffpass", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/ffpass/__init__.py", line 337, in main
    args.func(args)
  File "/usr/local/lib/python3.6/site-packages/ffpass/__init__.py", line 260, in main_export
    logins = exportLogins(key, jsonLogins)
  File "/usr/local/lib/python3.6/site-packages/ffpass/__init__.py", line 169, in exportLogins
    decodeLoginData(key, encUsername),
  File "/usr/local/lib/python3.6/site-packages/ffpass/__init__.py", line 125, in decodeLoginData
    asn1data, _ = der_decode(b64decode(data))
  File "/usr/lib/python3.6/site-packages/pyasn1/codec/ber/decoder.py", line 1049, in __call__
    raise error.SubstrateUnderrunError('%d-octet short' % (length - len(substrate)))
pyasn1.error.SubstrateUnderrunError: 94-octet short

Add support to import/export to Bitwarden

It's good for people trying to move in or move out from Bitwarden into firefox, since Bitwarden is able to export and import CSV files, implementing this should be as easy as adding a flag.

"url" column in Bitwarden's CSV is "login_uri", "username" is "login_username" and "password" is "login_password".

Be aware that Bitwarden exports more than just passwords, it also exports notes and probably some other things. All you have to do is only import to firefox the lines that have the column "type" == login.

Cheers!

Error on running

Using OSX 10.14.6 and getting this error.

I have tried installing as both user and sudo. Any ideas?

~/Downloads [ ] $ffpass -h
Traceback (most recent call last):
  File "/usr/local/bin/ffpass", line 9, in <module>
    load_entry_point('ffpass==0.4.8', 'console_scripts', 'ffpass')()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 565, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2697, in load_entry_point
    return ep.load()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2370, in load
    return self.resolve()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2376, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/Library/Python/2.7/site-packages/ffpass/__init__.py", line 61
    def getKey(directory: Path, masterPassword=""):
                        ^
SyntaxError: invalid syntax
~/Downloads [ ] $

AssertionError: The key is encoded with an unknown format (1, 2, 840, 113549, 1, 5, 13)

I'm trying to import my passwords from chromium, but get hit by the following error:

$ ffpass import --file '/tmp/Chrome Passwords.csv' -d ~/.mozilla/firefox/<profile>.default
Traceback (most recent call last):
  File "/path/to/virtualenvs/ffpass-_a4N4bz3/bin/ffpass", line 8, in <module>
    sys.exit(main())
  File "/path/to/virtualenvs/ffpass-_a4N4bz3/lib/python3.9/site-packages/ffpass/__init__.py", line 419, in main
    args.func(args)
  File "/path/to/virtualenvs/ffpass-_a4N4bz3/lib/python3.9/site-packages/ffpass/__init__.py", line 338, in main_import
    key = askpass(args.directory)
  File "/path/to/virtualenvs/ffpass-_a4N4bz3/lib/python3.9/site-packages/ffpass/__init__.py", line 307, in askpass
    key = getKey(directory, password)
  File "/path/to/virtualenvs/ffpass-_a4N4bz3/lib/python3.9/site-packages/ffpass/__init__.py", line 122, in getKey
    assert oid == MAGIC3, f"The key is encoded with an unknown format {oid}"
AssertionError: The key is encoded with an unknown format (1, 2, 840, 113549, 1, 5, 13)

System info

Firefox

$ firefox --version
Mozilla Firefox 86.0

ffpass

ffpass 0.5.0

can't import CSV from Chrome to Firefox

Python 3.7, Firefox 58:

ffpass import --from "Chrome Passwords.csv"

ERROR:

Traceback (most recent call last):
  File "/usr/local/bin/ffpass", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/ffpass/__init__.py", line 335, in main
    args.func(args)
  File "/usr/local/lib/python3.7/site-packages/ffpass/__init__.py", line 276, in main_import
    key = askpass(args.directory)
  File "/usr/local/lib/python3.7/site-packages/ffpass/__init__.py", line 243, in askpass
    key = getKey(directory, password)
  File "/usr/local/lib/python3.7/site-packages/ffpass/__init__.py", line 85, in getKey
    row = next(c)
StopIteration

Doesn't work with Firefox Lockwise (password syncing)

Hello, thanks for this useful tool.

I've noticed that the passwords that I've imported from Chrome into Firefox will not sync over when using Firefox's password syncing tool, Firefox Lockwise (https://lockwise.firefox.com/). All the other passwords I had from before using ffpass sync'ed over, but none of the passwords that came from the import sync'ed.

Maybe there is some flag Firefox has attached to Firefox-created passwords that ffpass cannot handle? Any suggestions on a fix/workaround are appreciated, thanks.

Issue when ffpass import --from passwords.csv

Traceback (most recent call last):
File "/usr/local/bin/ffpass", line 11, in
load_entry_point('ffpass==0.4.8', 'console_scripts', 'ffpass')()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 480, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2693, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2324, in load
return self.resolve()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2330, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/local/lib/python2.7/dist-packages/ffpass-0.4.8-py2.7.egg/ffpass/init.py", line 61
def getKey(directory: Path, masterPassword=""):
^
SyntaxError: invalid syntax

its not working

ffpass export --to passwords.csv -d C:\Users\username\Desktop\

Traceback (most recent call last):
File "c:\users\stachu\appdata\local\programs\python\python37-32\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "c:\users\stachu\appdata\local\programs\python\python37-32\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\Stachu\AppData\Local\Programs\Python\Python37-32\Scripts\ffpass.exe_main
.py", line 9, in
File "c:\users\stachu\appdata\local\programs\python\python37-32\lib\site-packages\ffpass_init
.py", line 292, in main
args.func(args)
File "c:\users\stachu\appdata\local\programs\python\python37-32\lib\site-packages\ffpass_init_.py", line 232, in main_export
key = askpass(args.directory)
File "c:\users\stachu\appdata\local\programs\python\python37-32\lib\site-packages\ffpass_init_.py", line 223, in askpass
key = getKey(directory, password)
File "c:\users\stachu\appdata\local\programs\python\python37-32\lib\site-packages\ffpass_init_.py", line 57, in getKey
c.execute("SELECT item1,item2 FROM metadata WHERE id = 'password';")
sqlite3.OperationalError: no such table: metadata

No way to import passwords from chrome (FF 84)

all I am getting is this
(no master pass on FF and database has a "test" entry, so no empty)

Traceback (most recent call last): File "/home/chris/.local/bin/ffpass", line 8, in <module> sys.exit(main()) File "/home/chris/.local/lib/python3.9/site-packages/ffpass/__init__.py", line 354, in main args.func(args) File "/home/chris/.local/lib/python3.9/site-packages/ffpass/__init__.py", line 287, in main_import key = askpass(args.directory) File "/home/chris/.local/lib/python3.9/site-packages/ffpass/__init__.py", line 254, in askpass key = getKey(directory, password) File "/home/chris/.local/lib/python3.9/site-packages/ffpass/__init__.py", line 74, in getKey entrySalt = decodedItem2[0][1][0].asOctets() AttributeError: 'Sequence' object has no attribute 'asOctets'

Export from Google Chrome

Thank you very much for creating and publishing this project!
Thanks to you I was able to transport my passwords from chromium (79.0.3945.130) to firefox (68.4.1esr).

I could not find the chrome flag you mentioned, and since the export function is very well hidden, I would like to suggest you update the section in the readme as follows.

  1. Navigate to chrome://settings/passwords
  2. Click on the three dots next to the words Saved Passwords, right above the password listing
  3. Select Export passwords... and save the file to passwords.csv

Imported logins don’t sync

I have three Firefox devices: a Mac laptop, a Windows laptop and an iPhone.

I have syncing of logins working between l them: I’ve tested saving a login on the Mac and seen it appear in the list of logins on the iPhone after syncing. (I’ve also seen that deletion of logins is synced).

I used ffpass to import a csv into Firefox on the Mac, and it appeared to work: the hundreds of imported logins now appear in the Saved Logins list, and they are autosuggested when I visit the sites.

But those imported logins are not synced to the other devices. New ones added interactively are synced, but the sync operation seems to totally ignore the logins that I imported with ffpass.

I noticed that all the entries for the imported logins in logins.json had the same time stamp, so I tried changing it to the value for current epoch time, restarted Firefox and requested resync on all devices, but that didn’t work.

Error trying to import

(passw) sergio@alaister:~/virtual/passw$ ffpass import --from ~/secret/Password\ Chrome.csv
Traceback (most recent call last):
File "/home/sergio/virtual/passw/bin/ffpass", line 8, in
sys.exit(main())
File "/home/sergio/virtual/passw/lib/python3.7/site-packages/ffpass/init.py", line 354, in main
args.func(args)
File "/home/sergio/virtual/passw/lib/python3.7/site-packages/ffpass/init.py", line 287, in main_import
key = askpass(args.directory)
File "/home/sergio/virtual/passw/lib/python3.7/site-packages/ffpass/init.py", line 254, in askpass
key = getKey(directory, password)
File "/home/sergio/virtual/passw/lib/python3.7/site-packages/ffpass/init.py", line 69, in getKey
c.execute("SELECT item1,item2 FROM metadata WHERE id = 'password';")
sqlite3.DatabaseError: file is not a database

Importing to firefox

i used phyton 3.5 while importing to ff with ffpas i get : File "/usr/local/bin/ffpass", line 5, in from pkg_resources import load_entry_point File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2749, in working_set = WorkingSet._build_master() File "/usr/lib/python3/dist-packages/pkg_resources.py", line 444, in _build_master ws.require(requires) File "/usr/lib/python3/dist-packages/pkg_resources.py", line 725, in require needed = self.resolve(parse_requirements(requirements)) File "/usr/lib/python3/dist-packages/pkg_resources.py", line 628, in resolve raise DistributionNotFound(req) pkg_resources.DistributionNotFound: ffpass==0.3.4

Invalid syntax at execution

Hey there,

i got a syntax error, even though i installed python 3.
Any ideas?
Marshall:~ kaiser$ ffpass Traceback (most recent call last): File "/usr/local/bin/ffpass", line 9, in <module> load_entry_point('ffpass==0.4.7', 'console_scripts', 'ffpass')() File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 565, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2697, in load_entry_point return ep.load() File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2370, in load return self.resolve() File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2376, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "/Library/Python/2.7/site-packages/ffpass/__init__.py", line 61 def getKey(directory: Path, masterPassword=""): ^ SyntaxError: invalid syntax

(null): can't open file 'ffpass': [Errno 2] No such file or directory

Hi,

I using MacOS High Sierra and installed python3 and then via python3 pip ffpass, but whenever I use

python3 ffpass import --from passwords.csv
I am getting this error

(null): can't open file 'ffpass': [Errno 2] No such file or directory

Any ideas how to make it work under MacOS?

safari to firefox on macOS

hey,

I'm getting a csv from this tool https://discussions.agilebits.com/discussion/30286/mrcs-convert-to-1password-utility/p1

with url; username;password

and I'm getting this error.

Traceback (most recent call last):
File "/usr/local/bin/ffpass", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/ffpass/init.py", line 335, in main
args.func(args)
File "/usr/local/lib/python3.7/site-packages/ffpass/init.py", line 278, in main_import
logins = readCSV(args.from_file)
File "/usr/local/lib/python3.7/site-packages/ffpass/init.py", line 178, in readCSV
logins.append((rawURL(row["url"]), row["username"], row["password"]))
KeyError: 'url'

;)

Can not import

This is what I get.
firefo

PS C:\Users\outasi\Documents> ffpass import -d C:\Users\outasi\Documents -f pass.csv Firefox password database is empty. Please create it from Firefox.

Import Not working on Firefox v82

System -Manjaro
Firefox v82.0.2 64 bit

ffpass import -d /home/d/.mozilla/firefox/je85vuh1.default --from bit.csv

This command returns Firefox password database is empty. Please create it from Firefox

I have read the readme.md and it states to manually add a login password in Firefox , I did so and closed firefox still the same error
Firefox password database is empty. Please create it from Firefox.

I think firefox has changed location of saved passwords file
Please update accordingly

Does not work when used inside firejail

For security reasons, many users would want to use this within a sandbox environment, such as firejail. However, I can't get it to work, even after whitelisting my Firefox profile directory:

firejail $HOME/.local/bin/ffpass import --from chrome-passwords.csv --directory .mozilla/firefox/6yc899yq.default

where my Firejail profile for ffpass includes:

whitelist ${HOME}/.local/lib/python3.7/site-packages/ffpass
whitelist ${HOME}/.local/lib/python3.7/site-packages/pyasn1
whitelist ${HOME}/.local/bin/ffpass
whitelist ${HOME} .mozilla/firefox/6yc899yq.default/key4.db
whitelist ${HOME} .mozilla/firefox/6yc899yq.default/logins.json
whitelist ${HOME}/chrome-passwords.csv

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.