eveses / field notes검색
TryHackMe/WALKTHROUGH

Pickle Rick

Linux

웹 페이지 단서로 인증 정보를 찾고 명령 실행과 reverse shell을 거쳐 root 권한을 확보합니다.

thmlinuxeasy
목차 6 SECTIONS +

Info

  • Platform: Tryhackme
  • Machine Name: Pickle Rick
  • Target IP/Host: 10.10.22.197
  • OS / Version: Linux
  • Difficulty / Category: Easy
Lab snapshot원본 이미지 보기 +

head

Overview

As a beginner for pentest, I decided to try solving some popular and easy machines on tryhackme. Today I chose ‘Pickle Rick’.

This is a simple and straightforward machine where the main concept appears to be reverse shell exploitation.

Recon & Enumeration

nmap

I scanned machine and found two open ports: 22(SSH), 80(HTTP), I decided to check out the webpage first.

web

Looking at the website, it seems I need to logon Rick’s computer and find three ingredients (flag).

I inspected the page source code and found what appears to be Rick’s username.

web

And I checked robots.txt and found an interesting string.

txt

Since I couldn’t found any other useful information on this website, I started directory brute forcing and discovered login page.

dir

login

I entered the username from the page source code and the password form robots.txt, and successfully logged in.

There was a command panel where I could execute system command.

web

However, I was unable to view any files using this command panel.

web

Initial Access

I tried to use reverse shell script written in sh (opened listening port on my system first), but it doesn’t work.

sh

Since sh wasn’t working, I checked if python3 was available by running ‘which python’ and found python3.

rev

I found python reverse shell script online and successfully executed it.

rev

To get more stable shell environment, I upgrade it to a fully interactive TTY.

And I found the first flag in the /var/www/html directory.

flag

Checked Rick’s home directory and discovered second flag.

flag

Privilege Escalation

I suspected that the last flag would be in the root directory, so I checked sudo permissions using ‘sudo -l’.

priv

I found ‘NOPASSWD: ALL’ in the sudo configuration, which allowed me to easily escalate privileges and obtained last flag from the root directory.

flag

Conclusion

I learned that there are various types of reverse shells available, and when one doesn’t work, it’s important to try different scripts rather than giving up after the first attempt.

← All notesBack to top ↑