Press enter or click to view image in full size
Introduction
In this walkthrough, I tackle the Lian_Yu room, moving from initial enumeration to full root access by chaining web discovery, credential extraction, steganography, and privilege escalation.
Task 1. Find the Flags
Welcome to Lian_YU, this Arrowverse themed beginner CTF box! Capture the flags and have fun.
Question 1. Deploy the VM and Start the Enumeration.
No answer neededQuestion 2. What is the Web Directory you found?
2100Question 3. What is the file name you found?
green_arrow.ticketQuestion 4. What is the FTP Password?
!#th3h00dQuestion 5. what is the file name with SSH password?
shadoQuestion 6. User.txt
THM{P30P7E_K33P_53CRET5__C0MPUT3R5_D0N'T}Question 7. Root.txt
THM{MY_W0RD_I5_MY_B0ND_IF_I_ACC3PT_YOUR_CONTRACT_THEN_IT_WILL_BE_COMPL3TED_OR_I'LL_BE_D34D}Initial Reconnaissance
I started with an Nmap scan using default scripts and version detection to quickly map the exposed attack surface.
nmap -sV -sC 10.49.161.195The scan quickly revealed a small but interesting set of open services:
- FTP running on port 21
- SSH exposed on port 22
- A web server on port 80
- RPC service on port 111
The presence of FTP alongside a web service immediately stood out. In many cases, misconfigured FTP services become an easy entry point, so I kept that in mind as I moved forward.
Web Enumeration
With the web server exposed, I shifted focus to port 80 and opened the target in the browser.
Press enter or click to view image in full size
At first glance, nothing useful was visible on the surface. No obvious inputs, no leaks, nothing actionable. That usually means one thing. Time to dig deeper.
Directory Bruteforcing
I started enumerating hidden paths using dirsearch with a well-known wordlist.
dirsearch -u http://10.49.161.195 -w SecLists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
Target: http://10.49.161.195/
[20:13:50] Starting:
[20:14:30] 301 - 236B - /island -> http://10.49.161.195/island/
[20:18:22] 403 - 199B - /server-status
Task CompletedThe scan returned an interesting directory:
/islandThat gave me a new attack vector to explore.
Hidden Clues in Source Code
After navigating to /island, I checked the page source instead of just relying on what was rendered.
Press enter or click to view image in full size
Inside the source, I found a hidden keyword:
vigilanteAt this stage, it looked like a potential username. It could be tied to FTP or SSH, but without a password, it was not immediately usable. Still, it was a valuable piece of intel, so I noted it down and continued enumerating.
Deeper Enumeration
I pushed further into the /island directory with another round of directory brute forcing.
dirsearch -u http://10.49.161.195/island/ -w SecLists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
Target: http://10.49.161.195/
[20:25:42] Starting: island/
[20:26:01] 301 - 241B - /island/2100 -> http://10.49.161.195/island/2100/
Task CompletedThis revealed another hidden path:
/island/2100Opening it in the browser did not immediately reveal anything useful.
Press enter or click to view image in full size
While inspecting the source code, I noticed a reference pointing toward a file with a .ticket extension. That immediately suggested there might be something intentionally hidden. I followed the same enumeration approach and continued digging deeper to locate it.
dirsearch -u http://10.49.161.195/island/2100 -w SecLists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -e .ticket
Target: http://10.49.161.195/
[20:25:42] Starting: island/2100
[20:26:01] 301 - 241B - /green_arrow.ticket -> http://10.49.161.195/island/2100/green_arrow.ticket
Task CompletedThis time, I discovered a file:
/island/2100/green_arrow.ticketExtracting Credentials
Opening the file revealed an encoded string.
RTy8yhBQdscXThe format suggested it was not random. After analyzing the pattern, I identified it as Base58 encoding. I decoded it to retrieve the original value.
Press enter or click to view image in full size
The decoded output gave me a potential password:
!#th3h00dAt this point, I had a likely username and password combination gathered through enumeration. The next step was to validate where these credentials could be used.
Gaining Access to FTP
With a potential username and password in hand, I moved to validate them against the FTP service.
ftp 10.49.161.195
Name: vigilante
Password: !#th3h00dThe login was successful, confirming that the credentials were valid for FTP access.
Exploring FTP Storage
Once inside, I listed the available files on the server.
lsThe directory contained three image files:
Leave_me_alone.pngQueen's_Gambit.pngaa.jpg
Press enter or click to view image in full size
I downloaded all of them locally for further analysis.
get Leave_me_alone.png
get Queen's_Gambit.png
get aa.jpgEnumerating User Directories
Before moving ahead, I checked the /home directory to understand the system users.
cd /home
lsThis revealed two users:
sladevigilante
That aligned well with the username I had already discovered earlier.
Analyzing Downloaded Files
I started inspecting the downloaded images. One file immediately stood out.
Get Death Esther’s stories in your inbox
Join Medium for free to get updates from this writer.
The file Leave_me_alone.png refused to open, and even metadata analysis showed an issue.
Press enter or click to view image in full size
The error suggested that the file format was corrupted or manipulated. To verify this, I opened the file in a hex editor.
Press enter or click to view image in full size
At first, nothing obvious stood out. But after comparing the header with a valid PNG signature, it became clear that the file header was incorrect.
Press enter or click to view image in full size
I corrected the header manually.
Press enter or click to view image in full size
After fixing it, the image opened successfully.
Press enter or click to view image in full size
Inside the image, I found a password:
passwordExtracting Hidden Data
Next, I moved to the other image file to check for hidden content. I used steghide to extract any embedded data.
steghide extract -sf aa.jpgAfter providing the passphrase, it extracted a zip file:
ss.zipUnzipping it revealed two files.
cat passwd.txt
cat shadoThe contents were:
passwd.txt
This is your visa to Land on Lian_Yu # Just for Fun ***
a small Note about itHaving spent years on the island, Oliver learned how to be resourceful and
set booby traps all over the island in the common event he ran into dangerous
people. The island is also home to many animals, including pheasants,
wild pigs and wolves.
shado
M3tahumanThe second file looked like a password, and given the earlier user enumeration, it was likely tied to one of the system users.
User Access via SSH
Using the discovered credentials, I attempted SSH access.
ssh [email protected]Username: slade
Password: M3tahumanThe login was successful, confirming valid user access on the system.
User Flag
Once inside, I listed the directory contents. The user flag was present in the home directory.
Press enter or click to view image in full size
THM{P30P7E_K33P_53CRET5__C0MPUT3R5_D0N'T}That marked successful user-level access on the machine.
Privilege Escalation
With user access established, I shifted focus toward privilege escalation. The first step was to check which commands I could run with elevated privileges.
sudo -lPress enter or click to view image in full size
The output showed that /usr/bin/pkexec could be executed with root privileges. Whenever I find a binary listed under sudo, my next move is to verify if it can be abused for escalation.
For that, I referred to GTFOBins, a well-known resource that documents how common Linux binaries can be leveraged to bypass restrictions and escalate privileges in misconfigured environments.
I looked up pkexec on GTFOBins and found a working method to spawn a root shell.
Press enter or click to view image in full size
The technique was straightforward:
sudo pkexec /bin/shThis works because when executed via sudo, pkexec does not drop elevated privileges and can spawn a shell as root. ([GTFOBins][2])
Press enter or click to view image in full size
This gave me a root shell.
Root Flag
With root access confirmed, I navigated to retrieve the final flag.
THM{MY_W0RD_I5_MY_B0ND_IF_I_ACC3PT_YOUR_CONTRACT_THEN_IT_WILL_BE_COMPL3TED_OR_I'LL_BE_D34D}Press enter or click to view image in full size
Thanks for reading.
Press enter or click to view image in full size