Sudo OpenVPN Privilege Escalation
Sudo openvpn may be vulnerable to privilege escalation.
Last updated
Sudo openvpn may be vulnerable to privilege escalation.
Last updated
If we can execute openvpn
command as root and we have a permission of editing the .ovpn
file, we can escalate to privilege.
First create a shell script to reverse shell. For example, create /tmp/shell.sh
.
Replace <local-ip>
with your local ip address.
Then change the file permission so that root can execute this script.
Next edit the .ovpn
file.
We need to add "script-security 2" and "up /tmp/shell.sh
" into the header.
In local machine, start a listener.
Now execute openvpn
command as root.
This command executes our shell.sh
, so we should get a root shell.