Unix Socket Exploitation
Last updated
Last updated
A Unix socket is another component in *nix systems that you can leverage to escalate your privileges.To safely use a Unix socket, the appropriate security measures/permissions must be implemented beforehand. As you can imagine, this is not always the case.
Suppose you landed on a machine and the current user is an unprivileged user, that happens to have access to the docker command (he is part of docker group). Also, suppose that the docker Unix socket is not protected by implementing the appropriate permissions.
Letβs see how we could escalate our privileges in that machine. Specifically, let try to access /etc/shadow.
Two more interesting examples on leveraging Unix sockets for privilege escalation are the following: https://www.exploit-db.com/exploits/40962/ https://github.com/rapid7/metasploit-framework/pull/9408/files\