TheCodCaper is a linux box created by user Paradox. Initial Scan was finding an administrator.php page and exploiting SQLi on the login page to dump the credentials. Using that we can get the redirected to an command page, using which we can get a shell as www-data. Enumerating the box we find the password for the user in /var/hidden/pass using that we can ssh to box as pingu. Enumerating again we can see that we can execute a binary in /opt/secert/root which also have SUID set. also on THM page we get the code so we can BOF and get to the hidden function shell and we can read the /etc/shadow. we can crack the hash and get the root password.
nmap -sC -sV -oN nmap/thecodcaper $IP Starting Nmap 7.80 ( https://nmap.org ) at 2020-05-20 01:29 IST Stats: 0:00:13 elapsed; 0 hosts completed (1 up), 1 undergoing Connect Scan Connect Scan Timing: About 76.90% done; ETC: 01:30 (0:00:04 remaining) Nmap scan report for 10.10.38.250 Host is up (0.16s latency). Not shown: 998 closed ports PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.8 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 2048 6d:2c:40:1b:6c:15:7c:fc:bf:9b:55:22:61:2a:56:fc (RSA) | 256 ff:89:32:98:f4:77:9c:09:39:f5:af:4a:4f:08:d6:f5 (ECDSA) |_ 256 89:92:63:e7:1d:2b:3a:af:6c:f9:39:56:5b:55:7e:f9 (ED25519) 80/tcp open http Apache httpd 2.4.18 ((Ubuntu)) |_http-server-header: Apache/2.4.18 (Ubuntu) |_http-title: Apache2 Ubuntu Default Page: It works Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 35.66 seconds