security enabled community medium v1.0.0

capsh

Linux capability shell wrapper that can spawn a privileged shell by dropping or manipulating capabilities.

📋 Live Preview
capsh {0}
📎 0
capsh {0}

Sandbox: execFile · Timeout: 30s

Capabilities

security.privilege-escalation.shell
security.capabilities.manage

Contract

Outputs

process.output

Shell output

Side effects: process_spawn

Workflow Edges

Produces

process.output

Resource Profile

ResourceValue
CPUlow
Memory4 MB
Networklow
Disk I/Olow

Examples

Spawn a shell with current capabilities

capsh --

Spawn a root shell with SUID (set gid and uid to 0)

capsh --gid=0 --uid=0 --

Documentation

capsh — Capability Shell

capsh is a wrapper for manipulating Linux capabilities and spawning shells. When installed with SUID, it can spawn a root shell by setting gid and uid to 0.

Related Tools

setcapgetcap

References