Hack The Box: Checker Machine Walkthrough β Hard Difficulty
Introduction to Checker:

In this write-up, we will explore the βCheckerβ machine from Hack The Box, categorised as a Hard difficulty challenge. This walkthrough will cover the reconnaissance, exploitation, and privilege escalation steps required to capture the flag.
Objective of Checker:
The goal of this walkthrough is to complete the βCheckerβ machine from Hack The Box by achieving the following objectives:
User Flag:
We exploited CVE-2023-1545 in the Teampass application to extract password hashes and cracked them to obtain credentials for the user βbob.β These credentials allowed access to both the BookStack web application and SSH. We then exploited CVE-2023-6199 in BookStack to read the OTP secret for the SSH user βreader,β enabling successful login and retrieval of the user flag.
Root Flag:
We discovered that the βreaderβ user had sudo privileges to run a script that interacted with shared memory. By analysing the script behaviour and injecting a command into the shared memory segment, we were able to set the SUID bit on /bin/bash. This grants root privileges, allowing us to read the root flag
Enumerating the Machine
Reconnaissance:
Nmap Scan:
Begin with a network scan to identify open ports and running services on the target machine.
nmap -sC -sV -oN nmap_initial.txt 10.10.11.56Nmap Output:
ββ[dark@parrot]β[~/Documents/htb/checker]
ββββΌ $nmap -sV -sC -oA initial 10.10.11.56
# Nmap 7.94SVN scan initiated Thu May 29 00:05:33 2025 as: nmap -sV -sC -oA initial 10.10.11.56
Nmap scan report for 10.10.11.56
Host is up (0.23s latency).
Not shown: 997 closed tcp ports (conn-refused)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.10 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 256 aa:54:07:41:98:b8:11:b0:78:45:f1:ca:8c:5a:94:2e (ECDSA)
|_ 256 8f:2b:f3:22:1e:74:3b:ee:8b:40:17:6c:6c:b1:93:9c (ED25519)
80/tcp open http Apache httpd
|_http-server-header: Apache
|_http-title: 403 Forbidden
8080/tcp open http Apache httpd
|_http-server-header: Apache
|_http-title: 403 Forbidden
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Thu May 29 00:06:28 2025 -- 1 IP address (1 host up) scanned in 55.98 seconds
Analysis:
- Port 22 (SSH): OpenSSH 8.9p1 is running, providing secure remote shell access. This is typical for administrative management over the network.
- Port 80 (HTTP): Apache web server is active but responds with a 403 Forbidden status, indicating that access to the root web directory is denied or restricted.
- Port 8080 (HTTP): Another instance of Apache is running on this alternative HTTP port, also returning a 403 Forbidden response, which could hint at restricted access to a secondary web application or interface.
Web Enumeration on Checker machine:
Perform web enumeration to discover potentially exploitable directories and files.
gobuster dir -u http://checker.htb:8080 -w /opt/raft-small-directories-lowerrcase.txtGobuster Output:

During the enumeration process, we observed that the server returns a 403 Forbidden status code along with a consistent response length (199 bytes) for URLs that do not exist. This uniform response can interfere with the accurate detection of valid endpoints, as it mimics the behaviour of non-existent pages. To proceed effectively, we should configure our tool to exclude responses with this status code or length to reduce false positives.

Analysis:
During the enumeration phase, more than 20 directories were discovered, although only a portion is listed here due to space limitations. Each of the directories responded with a 429 status code, indicating the server is applying rate-limiting measures, likely to deter aggressive or automated scanning. Some of the identified directories, such as /app, /report, /store, and /db could potentially relate to application logic, data storage, or admin interfaces. This behaviour suggests the underlying application might be sensitive to traffic volume, so further inspection should be paced to avoid triggering additional restrictions.

Accessing the website via 10.10.11.56 redirects us to the domain βchecker.htbβ.

We discovered that the application in use is BookStack. Unfortunately, we didnβt have any valid credentials to log in to BookStack at this stage.
What is BookStack?
BookStack is a free and open-source platform used to create and manage documentation or internal knowledge bases. Think of it like a digital bookshelf where each book contains pages of organised information. Teams or companies commonly use it to store guides, manuals, and notes in a user-friendly way, similar to how youβd organise content in a physical notebook, but online and searchable.

On port 8080, we were presented with the Teampass login page.
What is TeamPass?
Teampass is a web-based password management system designed for teams and organisations. It helps securely store and share login credentials, such as usernames and passwords, in a single, central location. Instead of keeping sensitive information in unprotected files or messages, Teampass allows team members to access and manage passwords through a secure, organised interface. This makes collaboration safer and more efficient, especially when multiple people need access to the same accounts or systems.

To gain a better understanding of the Teampass application, we analysed its source code available on GitHub.

One of the files caught my attention and warranted a deeper analysis.

This script is a setup routine for Teampass, designed to run when the application first starts. It checks if the Teampass code has already been initialised (by looking for a .git folder). If not, it pulls the necessary files from a remote repository, prepares directories needed for logs and encryption keys, and sets file permissions so the web server (nginx) can use them. Then, it checks if the main configuration file exists. If the file is missing, the script prompts the user to open Teampass in a web browser to complete the setup. Finally, it hands over control to start the application.

Another file that caught our attention is readme.md, which reveals the version of Teampass being usedβversion 3.

So, letβs investigate any exploits or vulnerabilities related to Teampass version 3.
Exploitation
Exploitation of CVE-2023-1545 in the Teampass Application

We can download the source code from GitHub onto our machine.
Additional reference: Snyk Security Advisory β SNYK-PHP-NILSTEAMPASSNETTEAMPASS-3367612, which provides detailed information regarding the identified vulnerability in the Teampass application.

I renamed the file to poc.py and executed it, which revealed usernames along with their hashes.

We need to specify the appropriate hash mode.


After some time, we successfully retrieved the passwords from the hashes, including one for the user βbobβ with the hash $2y$10$yMypIj1keU.VAqBI692f..XXn0vfyBL7C1EhOs35G59NxmtpJ/tiy, which corresponded to the password βcheerleader.β

Letβs use the credentials we discovered earlier to log in to Teampass.

There is access for the user βbob,β which allows login to both BookStack and SSH.

For BookStack, the login details are username bob@checker.htb with the password mYSeCr3T_w1kI_P4sSw0rD.

For SSH access, the username is reader and the password is hiccup-publicly-genesis.

We attempted to access the system as Bob via SSH, but the login failed with the error message: βOperation not permittedβ while writing the config.
BookStack Enumeration

Letβs log into the BookStack dashboard using the Bob credentials we obtained earlier.

The book contains three essays, including one titled βBasic Backup with cpβ that provides a file path. Since this machine is played with other players, I also noticed additional files like βExploit,β βaaa,β and βHTMLβ under the recently viewed section.



The other two articles do not contain any important information. This script seems significant because the destination path is unusual, and often the author hides clues in such details.
#!/bin/bash
SOURCE="/home"
DESTINATION="/backup/home_backup"
A version number is indicated in the URL:
http://checker.htb/dist/app.js?version=v23.10.2
Exploiting CVE-2023-6199 in BookStack v23.10.2: Leveraging Blind SSRF for Local File Read

We can obtain the source code from here.


Navigate to BookStack and create a new draft page as a Bob user.


Use Burp Suite to intercept the HTTP request when saving the draft page.

In Burp Suite, change the intercepted request body to x-www-form-urlencoded format instead of JSON



The intercepted request will appear in JSON format, similar to the screenshot above
Exploiting PHP Filter Chain Oracle to Read Arbitrary Files

We need to retrieve a copy of the script and save it to our local machine for further analysis.

We can execute the script shown earlier.

The screenshot above displays the result of the executed command.


The code shown above is the original version.

Include the following commands into the script:
import base64
encoded_data = base64.b64encode(filter_chain.encode('utf-8'))
encoded_string = encoded_data.decode('utf-8')
encoded_string = "<img src='data:image/png;base64,{}'>".format(encoded_string)
merged_data = { "name": "dark", "html": encoded_string }
It works because we successfully retrieved the contents of the /etc/passwd file.

We retrieved the TOTP authentication secret stored within the Google Authenticator.

We extracted the OTP from the script above, noting that it is time-sensitive and expires quickly.

However, it still did not succeed.

Letβs use ntpdate to synchronise the system time.


You can view the user flag by running the command cat user.txt.
Escalate to Root Privileges Access on the checker machine
Privilege Escalation:

Review and confirm the sudo permissions granted to the reader user.

This small script is like a set of instructions for the computer. It starts by loading some hidden settings needed to run properly. Then, it takes a username given by the user, cleans it up to make sure it only contains letters and numbers (to avoid any strange or harmful characters), and finally runs a program called βcheck_leakβ using that cleaned username. Essentially, itβs a way to safely check something related to that user on the system.

When we run /opt/hash-checker/check-leak.sh using sudo, it shows an error saying that the <USER> argument was not given.

Supplying βreaderβ as the user caused the script to return an error indicating the user is not found in the database.

When specifying βbobβ as the user, the script revealed that the password was exposed.

The /bin/bash binary does not have the SUID permission set.

The script sets the /bin/bash binary with the SUID permission.


You can view the root flag by running the command cat root.txt.
The post Hack The Box: Checker Machine Walkthrough β Hard Difficulty appeared first on Threatninja.net.