> 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/ippsec-unofficial-cpts-prep/htb-delivery.md).

# HTB - Delivery

```bash
PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
80/tcp   open  http    nginx 1.14.2
8065/tcp open  http    Golang net/http server
```

### HTTP - 80

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FvvKVCygTOdoh8YqVKeDF%2Fimage.png?alt=media&amp;token=0951d547-92cf-48f5-807e-39de9f656dfe" alt=""><figcaption></figcaption></figure>

clicking on the contact us lead to the below page.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2F5NQPZSZf4DRvScOJjCeC%2Fimage.png?alt=media&amp;token=3d375e95-3a65-4241-8bf8-0293b0f87336" alt=""><figcaption></figcaption></figure>

Now the page highlights, that all unregistered users can get in touch with helpdesk and registered users with @delivery.htb email can be able to access matter most server.

Now clicking on help desk leads to new host `helpdesk.delivery.htb`  and clicking on matter most lead to port 8065

### HTTP - 8065

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FmRQ7eF2RRs7OLcDwdZr7%2Fimage.png?alt=media&amp;token=dd458f5f-67b3-466d-ad57-f9768db9a8a9" alt=""><figcaption></figcaption></figure>

we can create an account as we do not have any account yet.

now back on help desk.

## Helpdesk.delivery.htb

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2F7ggcTKdYHGoLQcFtL3Fl%2Fimage.png?alt=media&amp;token=bc4f6668-8550-43ba-975c-0f98987ef1a3" alt=""><figcaption></figcaption></figure>

i can create a new ticket.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2F9jFS0RObd6Cxxi9Jolti%2Fimage.png?alt=media&amp;token=91ef2500-4405-41c2-9a6c-c8624e3aa78b" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2Fu8EHurwg0ET9kX1CNAjG%2Fimage.png?alt=media&amp;token=6884bba3-018e-4c3a-a66c-cdef13fa2ec2" alt=""><figcaption></figcaption></figure>

viewing the status of the ticket allows us to edit the ticket.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FBQmJY89nciCpYgXW2mML%2Fimage.png?alt=media&amp;token=b184a042-35fb-48a8-a7cc-f618d2a90e9c" alt=""><figcaption></figcaption></figure>

creating an account and signing needs account confirmation.

### mattermost instance

there is a registration link on port 8065 to.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FtgLseohqn7yrO2qwdxNl%2Fimage.png?alt=media&amp;token=a960ba4b-060d-43ef-83b6-83d7e7b99397" alt=""><figcaption></figcaption></figure>

creating acocunt also leads to confirmation.&#x20;

i have created a account as `ajay@ajay.com` but the contact form mentioned users with @delivery.htb have access to matter most.

lets try creating user in that way using the mail  `5919608@delivery.htb`

when created asked to send confirmation mail.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FjKEYgfA19D3CPUQpzX9y%2Fimage.png?alt=media&amp;token=e8d45493-dea8-412e-b1f0-2a81ca34ac52" alt=""><figcaption></figcaption></figure>

but back on the ticketing system received a registration successful link.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FtLfWhABUxdwCjsn1FbZd%2Fimage.png?alt=media&amp;token=ac1e894e-4c7c-4297-8503-c042ef1bed0e" alt=""><figcaption></figcaption></figure>

once verified i got access to the instance.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2F3GPFxxXl2uhHGRPXh172%2Fimage.png?alt=media&amp;token=adac6cc5-d280-4f70-b098-85ff0b46da3f" alt=""><figcaption></figcaption></figure>

we can join to the internal channel.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2F1fiulLWJC1lLrHogM4j9%2Fimage.png?alt=media&amp;token=24b36113-f922-4dc8-b841-158832d6ba6c" alt=""><figcaption></figcaption></figure>

the internal channel leaked credentials for maildeliverer.

`maildeliverer:Youve_G0t_Mail!`

## Shell as maildeliverer

I can use the creds to get a shell using SSH

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FeCjXIRZkmSJHyK5P5qqZ%2Fimage.png?alt=media&amp;token=2eab307a-585e-49c9-88a2-43e62df4ebbf" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FIdhb3NAuGYWxAaRX9ZcG%2Fimage.png?alt=media&amp;token=807b9781-3e49-46fa-9dd3-c399faeea265" alt=""><figcaption></figcaption></figure>

checking the config page at `/opt/mattermost/config/config.json`

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FltHZrn31Mj2OQj6fmS5h%2Fimage.png?alt=media&amp;token=0df42545-818b-4d1e-9532-da0bfeff4a25" alt=""><figcaption></figcaption></figure>

reveals the password for mysql instance running locally. we can connect to it using the creds through the shell.

### Mysql Access

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FiSYzPhuraK48qGMn8Z0e%2Fimage.png?alt=media&amp;token=5a3b8df4-502d-4e13-b0a4-ae41a2390796" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2F1xqDFjrtiaiCtHAp5TxS%2Fimage.png?alt=media&amp;token=62c5e0c3-06d9-4af3-9ec9-47329b30325c" alt=""><figcaption></figcaption></figure>

The tables showed there is a table name called Users;

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FmsTSQ0htgMncEYvIJyNv%2Fimage.png?alt=media&amp;token=77c7f47e-0606-4485-8d73-52e046570a6c" alt=""><figcaption></figcaption></figure>

i need only the username and password.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2F6ZzK3mtbyT3QbagW8ewT%2Fimage.png?alt=media&amp;token=9c3fc9c0-0f3b-43e1-ac4f-077d21f5fe74" alt=""><figcaption></figcaption></figure>

Got the hash for root.

We can crack the hash but the mattermost channel hgave a indirect hint on how to crack the hash.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FDfMlSyC7mL8W6AiaQKow%2Fimage.png?alt=media&amp;token=c114b3e1-a125-4904-b87b-2c0c81c7fe6f" alt=""><figcaption></figcaption></figure>

They talk about variants of `PleaseSubscribe!`

#### Creating variants using hashcat rules

```bash
┌──(ajay㉿kali)-[~]
└─$ echo 'PleaseSubscribe!' > base.txt
hashcat --stdout -r /usr/share/hashcat/rules/best66.rule base.txt
PleaseSubscribe!
!ebircsbuSesaelP
PLEASESUBSCRIBE!
pleaseSubscribe!
PleaseSubscribe!0
PleaseSubscribe!1
PleaseSubscribe!2
PleaseSubscribe!3
PleaseSubscribe!4
PleaseSubscribe!5
PleaseSubscribe!6
<SNIP>
```

Copy the variants to file called `passwords.txt` and crack the hash using john or hashcat.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FwmvPUDOGhM0nFWRFwbXW%2Fimage.png?alt=media&amp;token=a39bcc89-1ac8-4fa2-80ed-5e2b36c05472" alt=""><figcaption></figcaption></figure>

`root : PleaseSubscribe!21`

## Shell as Root

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2Fv0VLkeiWUrajIFONjl7N%2Fimage.png?alt=media&amp;token=34b4f1a6-66eb-4547-87e8-9e1559fbec2e" 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 following URL with the `ask` and `goal` query parameters:

```
GET https://ajaykumar-kanthi.gitbook.io/write-ups/ippsec-unofficial-cpts-prep/htb-delivery.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 `build a script that syncs our docs to a CMS` 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.
