> For the complete documentation index, see [llms.txt](https://faresbltagy.gitbook.io/footprintinglabs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://faresbltagy.gitbook.io/footprintinglabs/password-attacks/lab-easy.md).

# Lab - Easy

Hello, everyone. Today, we will be exploring the Medium-level Password Attacks Walkthrough lab from the HTB Academy Penetration Testing Course. Our goal is to obtain the contents of flag.txt in /root

## Recon

First, let's initiate an IP scan to identify open ports, thereby enabling us to assess available options.

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2F1KK7zg5tlZO16i9wfgk6%2FScreenshot(1).png?alt=media&amp;token=7009d067-3978-427b-9501-d465b790fbfe" alt=""><figcaption></figcaption></figure>

I discovered that ports 21 and 22 are open. Let's attempt a brute force attack; perhaps we can obtain valid credentials.

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FZEmlGItAnMm6Ez2UkjVd%2FScreenshot(2).png?alt=media&amp;token=51d22f43-f1a6-43d2-a474-9311235ca81e" alt=""><figcaption></figcaption></figure>

I discovered valid credentials while brute-forcing FTP. Let's attempt to log in using FTP and explore the available data.

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FMatj6xPQjsYVYFuFtm9n%2FScreenshot(3).png?alt=media&amp;token=626c8d8f-34ff-453a-915f-a96b5f1d18f1" alt=""><figcaption></figcaption></figure>

Upon logging in, I discovered a private key named id\_rsa. Let's proceed by transferring it to our machine and adjusting its permissions in an attempt to establish an SSH connection.

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FhgpgTgV5wz92aogXF2j5%2FScreenshot(4).png?alt=media&amp;token=a53751a4-2cb8-4dbb-af30-0b4ab9ce2fa4" alt=""><figcaption></figcaption></figure>

Upon logging in, I conducted enumeration and successfully discovered the root password. Thank you for your time in reviewing this writeup.

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2F4kvjbtQ6ORGMsl3cdByS%2FScreenshot(6).png?alt=media&amp;token=8b787550-0d08-4905-b29c-f8360643376a" 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://faresbltagy.gitbook.io/footprintinglabs/password-attacks/lab-easy.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.
