The "Lookup" room on TryHackMe immediately caught my attention with its catchy name, and I couldn’t resist the urge to lookup. This is a basic CTF-style room that involves scanning, enumeration, and a bit of creativity. Let’s go through how I exploited this room step by step.
Step 1: Initial Target Ping
The first thing I did was check if the target VPN was active. Using a simple ping, I verified that it was online and ready for scanning.
![Ping Target IP](https://static.wixstatic.com/media/0c3e24_3f2ce436161e49cfa6dd92eb2a62e94c~mv2.jpg/v1/fill/w_509,h_132,al_c,q_80,enc_auto/0c3e24_3f2ce436161e49cfa6dd92eb2a62e94c~mv2.jpg)
Step 2: Nmap Scan
After confirming the target was active, I ran a basic Nmap scan to discover open ports. The scan revealed just two open ports:
Port 22 (SSH)
Port 80 (HTTP)
NMap scan output
This was a pretty basic CTF setup, with just two services running. Since I didn’t have any credentials yet, I decided to investigate port 80 and see if there was anything useful.
Step 3: Adding the Domain to /etc/hosts
When I tried accessing the web page in my browser, I saw a login portal, but the domain was not resolving. I added lookup.thm to my /etc/hosts file to ensure the domain resolved properly.
![oops! a login portal](https://static.wixstatic.com/media/0c3e24_5c3d3914e3d54eff88e8e84fa6abe2ec~mv2.png/v1/fill/w_980,h_413,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/0c3e24_5c3d3914e3d54eff88e8e84fa6abe2ec~mv2.png)
Step 4: Investigating the Login Portal
Upon accessing the page, I found a login portal. I first tried the usual suspects for usernames and passwords like admin and root, but nothing worked. Next, I checked the page source, but there were no useful hints.
![nothing to see here, keep searching](https://static.wixstatic.com/media/0c3e24_a3f08046f55744ca9d25c2c4d54912f9~mv2.png/v1/fill/w_615,h_471,al_c,q_85,enc_auto/0c3e24_a3f08046f55744ca9d25c2c4d54912f9~mv2.png)
![dirsearch found just the login page](https://static.wixstatic.com/media/0c3e24_3e58410f89ec45dd96f5f0c1f4af19e0~mv2.png/v1/fill/w_765,h_296,al_c,q_85,enc_auto/0c3e24_3e58410f89ec45dd96f5f0c1f4af19e0~mv2.png)
Step 5: Attempting SQL Injection
I then tried SQL injection on the login form, but I wasn’t successful in gaining access.
![SQL was unsuccessful](https://static.wixstatic.com/media/0c3e24_a860804e9ef940e48e719fcb540aa8c5~mv2.png/v1/fill/w_795,h_359,al_c,q_85,enc_auto/0c3e24_a860804e9ef940e48e719fcb540aa8c5~mv2.png)
Step 6: Crafting a Username Enumeration Script
Not giving up, I turned to GPT for help to craft a username enumeration script using the SecLists username wordlist. The script was successful, and I discovered two usernames: admin and jose.
![thank you chatGPT](https://static.wixstatic.com/media/0c3e24_72b3c29e46764add84af9236fba733bc~mv2.png/v1/fill/w_378,h_86,al_c,q_85,enc_auto/0c3e24_72b3c29e46764add84af9236fba733bc~mv2.png)
Step 7: Brute-Forcing Passwords
With the usernames in hand, I proceeded to brute-force the passwords. Using Hydra and the popular rockyou.txt wordlist, I managed to crack a weak password for the admin account: password123.
![Hydra in action](https://static.wixstatic.com/media/0c3e24_416b7cd0596b45bab4fae120324e9f0d~mv2.png/v1/fill/w_980,h_35,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/0c3e24_416b7cd0596b45bab4fae120324e9f0d~mv2.png)
![thank you Hydra](https://static.wixstatic.com/media/0c3e24_51f142c9bc7842e4ac702d3df507f03f~mv2.png/v1/fill/w_864,h_68,al_c,q_85,enc_auto/0c3e24_51f142c9bc7842e4ac702d3df507f03f~mv2.png)
Step 8: Discovering a Subdomain
While navigating to the jose account, I stumbled upon a subdomain: files.lookup.thm. I added this to my /etc/hosts file for easy access.
![/etc/hosts](https://static.wixstatic.com/media/0c3e24_2fbc03a7dda2454eb6471859d48c2543~mv2.jpg/v1/fill/w_485,h_42,al_c,q_80,enc_auto/0c3e24_2fbc03a7dda2454eb6471859d48c2543~mv2.jpg)
Step 9: Accessing the jose Account
Using the credentials for the jose account, I logged in and found a ton of files that appeared to be related to passwords. After investigating further, I found some interesting information.
![i wish hacking was this easy](https://static.wixstatic.com/media/0c3e24_47196a7f6ca9414c97f09fd1836cf06e~mv2.png/v1/fill/w_980,h_183,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/0c3e24_47196a7f6ca9414c97f09fd1836cf06e~mv2.png)
Step 10: Investigating the Software Version
One thing that caught my eye was the "About This Software" section on the dashboard. Here, I found the version number of the software, which I quickly used to search for possible exploits in Metasploit.
Metasploit had about 5 modules for this version, so I decided to try my luck.
![elfinder v2.1.47](https://static.wixstatic.com/media/0c3e24_e24856ddcf5849909420bc9528c1bfc5~mv2.png/v1/fill/w_523,h_212,al_c,q_85,enc_auto/0c3e24_e24856ddcf5849909420bc9528c1bfc5~mv2.png)
![info 4](https://static.wixstatic.com/media/0c3e24_938eef6d84bf4da48777bd730ab1974c~mv2.png/v1/fill/w_980,h_149,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/0c3e24_938eef6d84bf4da48777bd730ab1974c~mv2.png)
![matches our version number](https://static.wixstatic.com/media/0c3e24_8d68b68b582241648fbb6cbe280444e5~mv2.png/v1/fill/w_602,h_212,al_c,q_85,enc_auto/0c3e24_8d68b68b582241648fbb6cbe280444e5~mv2.png)
![setting the required options](https://static.wixstatic.com/media/0c3e24_66a485e0b7e0414d844eebfb04e60a6d~mv2.png/v1/fill/w_824,h_106,al_c,q_85,enc_auto/0c3e24_66a485e0b7e0414d844eebfb04e60a6d~mv2.png)
Step 11: Getting a Meterpreter Shell
I successfully used a Metasploit module to gain a Meterpreter shell on the system. After doing a small victory dance, I started enumerating the system further and found another user: think. What a name!
![think? really??](https://static.wixstatic.com/media/0c3e24_17221a85a9e84329acaad946fcd3e932~mv2.png/v1/fill/w_814,h_305,al_c,q_85,enc_auto/0c3e24_17221a85a9e84329acaad946fcd3e932~mv2.png)
Step 12: Investigating the think User
While exploring the files in the jose account’s directory on Elfinder, I came across a file named credential.txt. This file contained the username think, but when I tried logging in with this password on SSH, I was denied access.
![i didn't add that i bruteforced the think user with all the words in these files too but was unsuccessful](https://static.wixstatic.com/media/0c3e24_1b2ce3dbd40d488ea3b17049c5f754d6~mv2.png/v1/fill/w_980,h_142,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/0c3e24_1b2ce3dbd40d488ea3b17049c5f754d6~mv2.png)
Step 13: Privilege Escalation Attempts
I wasn’t about to give up just yet. I started looking for privilege escalation vectors and stumbled upon a strange path: /usr/sbin/pwm. I remembered from TCM’s privilege escalation videos that there’s a technique called PATH hijacking. I decided to give it a try.
![/usr/sbin/pwn](https://static.wixstatic.com/media/0c3e24_31f5a9b48ef741ac8827bd5732527f5f~mv2.png/v1/fill/w_980,h_424,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/0c3e24_31f5a9b48ef741ac8827bd5732527f5f~mv2.png)
Step 14: Successful Path Hijacking
Using the PATH hijacking method, I was able to run the file and find potential passwords. I saved these to a file and used Hydra again to brute-force SSH login for the think user. Success! I now had the password and was able to log into the think account.
![$PATH](https://static.wixstatic.com/media/0c3e24_9bb03282ae1a40beb5289ac9b37fbfc2~mv2.png/v1/fill/w_980,h_115,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/0c3e24_9bb03282ae1a40beb5289ac9b37fbfc2~mv2.png)
![potential password](https://static.wixstatic.com/media/0c3e24_b4cebe80c3b04876828f72981e9e936a~mv2.png/v1/fill/w_504,h_639,al_c,q_85,enc_auto/0c3e24_b4cebe80c3b04876828f72981e9e936a~mv2.png)
![I can't thank you enough Hydra](https://static.wixstatic.com/media/0c3e24_0e903f3eb134478e910010c066cc6f96~mv2.png/v1/fill/w_953,h_256,al_c,q_85,enc_auto/0c3e24_0e903f3eb134478e910010c066cc6f96~mv2.png)
Step 15: Accessing the User Flag
Once logged in as think, I found and retrieved the user flag. But I wasn’t done yet; it was time to escalate further.
![user.txt](https://static.wixstatic.com/media/0c3e24_d4811b0b82d44fe3a46978a41816799c~mv2.png/v1/fill/w_445,h_150,al_c,q_85,enc_auto/0c3e24_d4811b0b82d44fe3a46978a41816799c~mv2.png)
Step 16: Abusing Sudo Permissions
I checked for any binaries that could be abused with sudo -l and found a binary named look. I quickly searched gtfobins.io to see if there were any exploits for it, and sure enough, I found one.
![sudo -l](https://static.wixstatic.com/media/0c3e24_3fad8e7985814379b8f1fbd365fb751c~mv2.png/v1/fill/w_950,h_116,al_c,q_85,enc_auto/0c3e24_3fad8e7985814379b8f1fbd365fb751c~mv2.png)
![gtfobins to the rescue](https://static.wixstatic.com/media/0c3e24_e3d0cf1a7fe4483cb0f6fd1f9370db56~mv2.png/v1/fill/w_829,h_170,al_c,q_85,enc_auto/0c3e24_e3d0cf1a7fe4483cb0f6fd1f9370db56~mv2.png)
Step 17: Rooting the System
I used the exploit to gain access to the id_rsa file for the root user. After changing the necessary permissions, I gained root access to the system.
![extracted the id_rsa file for r00t](https://static.wixstatic.com/media/0c3e24_59947db37f7e4e2bae1dd986212be56e~mv2.png/v1/fill/w_573,h_115,al_c,q_85,enc_auto/0c3e24_59947db37f7e4e2bae1dd986212be56e~mv2.png)
![root.txt](https://static.wixstatic.com/media/0c3e24_7a3031cf78be426c8b835106579360e7~mv2.png/v1/fill/w_604,h_372,al_c,q_85,enc_auto/0c3e24_7a3031cf78be426c8b835106579360e7~mv2.png)
Conclusion
The Lookup room was a great learning experience, combining scanning, enumeration, basic brute-forcing, and privilege escalation techniques. The challenge was a reminder of how useful persistence and creative problem-solving can be in penetration testing.
Final Thoughts
This room was a solid exercise in exploiting vulnerabilities and escalating privileges. The tools and techniques I used (such as Hydra, Metasploit, gtfobins, and PATH hijacking) are essential skills for penetration testers. If you haven’t tried this room yet, I highly recommend giving it a shot!
Key Takeaways:
Persistence pays off when brute-forcing passwords.
Using tools like Metasploit and gtfobins can help you find specific vulnerabilities and exploits.
Enumeration is key to finding hidden clues, like usernames and software versions.
Feel free to ask any questions if you’re stuck on a particular step or need more details. Happy hacking! 007
Commentaires