··· PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 2048 20:d1:ed:84:cc:68:a5:a7:86:f0:da:b8:92:3f:d9:67 (RSA) | 256 78:89:b3:a2:75:12:76:92:2a:f9:8d:27:c1:08:a7:b9 (ECDSA) |_ 256 b8:f4:d6:61:cf:16:90:c5:07:18:99:b0:7c:70:fd:c0 (ED25519) 80/tcp open http Apache httpd 2.4.29 ((Ubuntu)) |_http-server-header: Apache/2.4.29 (Ubuntu) |_http-title: Apache2 Ubuntu Default Page: It works MAC Address: 08:00:27:40:48:1A (Oracle VirtualBox virtual NIC) Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel ···
🚪🚶 get shell
the apache was 2.4.49,but after trying payload,it seems dont have path traversa and we find four path in robots.txt,finally election work,other was 404. and we could brute the phpmyadmin path by dirb
and get the exploit to the target machine(by wget).
rabbit hole
when i run script linpeas.sh, it show /var/spool/cron/ was important, and i found there was /crontabs/root file,and www-data was the owner,have the rw right,so i spend lots of time to try it.but it all fail, cause this directory’s cron must belong to this user,such as /crontabs/root must belong to user:root, and the directory have the drwx-wx–T right, so only root could delete or change the file, even the file’s owner! so the /crontabs/root was fail to excute. cause /crontabs/root‘s owner was www-data not root, and the www-data cant change the owner of /crontabs/root.