VM - boot2root

https://tryhackme.com/room/yctfweek2Mv

i had first blood for this machine (🩸)

Port scan

  • i used rustscan to see what ports are open (21 and 22)

  • nmap scan results :

  • only 2 ports were open,

FTP

  • anonymous login was allowed

Contents of welcome.txt

  • Username : melodi

SSH

  • since no http port was open, my next thought was to bruteforce the password

hydra bruteforce

Password found : princess1

User flag

Flag : YCTF{15_1t_e45y??}

Root flag

  • I used pspy64 script to see what all proccess were running on the machine

  • every minute root compiles the script under /tmp/hello.rs and (runs it?)

  • Let's add ourself in sudoers list (NOTE: this isn't the way i solved this machine)

  • before :

  • script :

  • After a minute our script will be run by the root user

  • woo hooooo, we can run sudo now, without any password

  • btw i used another script during CTF, a script that had rev shell payload for my local machine, i listen on my local machine with netcat and got root shell.

Flag: YCTF{1t5_v3ry_ru5ty_h3r3!!}

Pwned

__________heapbytes's still pwning

Last updated