root@kali:~# nmap -sV -v -p- --min-rate=10000 10.10.10.206 PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4 (Ubuntu Linux; protocol 2.0) 80/tcp open http Apache httpd 2.4.18 ((Ubuntu))
from the page we know about NMS (News Management System) Cutenews.
1
Powered by CuteNews
After some googling, I found that we can visit the NMS panel after placing CuteNews on the web page.
1
http://10.10.10.206/CuteNews/
first regist then sign in,but nothing interesting,then got the version of CuteNews in the same page.
SSH is not allowed to log in with Password. So I tried to SU into Paul.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
username : paul password : atlanta1
www-data@passage:/var/www/html/CuteNews/cdata/users$ su paul su paul Password: atlanta1
paul@passage:/var/www/html/CuteNews/cdata/users$ cd ~ cd ~ paul@passage:~$ ls ls Desktop Downloads Music Public user.txt Documents examples.desktop Pictures Templates Videos paul@passage:~$ cat user.txt cat user.txt 7b75a13dc30044026e830c894aaf83c0
and we got user.txt
got root
We Can Cat SSH Keys Of Nadav, because Nadav uses the same SSH key for Paul.
root@kali:~/hackthebox/machine/passage# ssh -i nadav-key nadav@10.10.10.206 load pubkey "nadav-key": invalid format The authenticity of host '10.10.10.206 (10.10.10.206)' can't be established. ECDSA key fingerprint is SHA256:oRyj2rNWOCrVh9SCgFGamjppmxqJUlGgvI4JSVG75xg. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '10.10.10.206' (ECDSA) to the list of known hosts. Last login: Mon Aug 31 15:07:54 2020 from 127.0.0.1 nadav@passage:~$ id uid=1000(nadav) gid=1000(nadav) groups=1000(nadav),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),113(lpadmin),128(sambashare) nadav@passage:~$ whoami nadav
Dbus – USB Controller Privilege Escalation – Root
Listing all the process gave me a hint for Root.
1 2
nadav@passage:~$ ps -aux | grep usb nadav 3430 0.0 0.0 21264 1028 pts/19 S+ 00:14 0:00 grep --color=auto usb
reference to USBCreator D-Bus Privilege Escalation in Ubuntu Desktop
Pre Requirements:
The user must be in the Sudoers group. Here in our case, Nadav is in the Sudoers group.
The user must have executable privileges to the dbus tool.
then We have everything we need. it’s time to launch our attack. As we already know the dbus system block as com.ubuntu.USBCreator by default, we can send a system call to Dbus message.