Skip to main content

Overview

Unix sockets are inter-process communication endpoints. If a socket is writable or a privileged service listens on one, you can communicate with it to escalate privileges.

Enumerate Unix Sockets

Find Writable Sockets

Check Socket Permissions


Docker Socket

Most common socket privesc. See Docker / LXD Escape.

Quick Check

If writable:
Without docker CLI:

Writable .socket Files (systemd)

Inject ExecStartPre

Create Missing Service

If .socket exists but corresponding .service is missing:
Create the missing service:

HTTP Sockets

Some services expose HTTP APIs over Unix sockets.

Connect

Socat

Netcat


MySQL Socket

Connect without password:

Containerd Socket

If accessible:

Socket Command Injection

If a service reads input from a socket and passes it to a shell:

Socket Permissions


Quick Reference