logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

setuids.bt - Trace setuid family of syscalls. Uses bpftrace/eBPF.

Author

       Brendan Gregg

Description

       This  tool  traces  privilege  escalation  via  setuid syscalls, and can be used for debugging, whitelist
       creation, and intrusion detection.

       It works by tracing the setuid(2), setfsuid(2), and retresuid(2) syscalls using the syscall tracepoints.

       Since this uses BPF, only the root user can use this tool.

Examples

       Trace setuid syscalls:
              # setuids.bt

Fields

       PID    The calling process ID.

       COMM   The calling process (thread) name.

       UID    The UID of the caller.

       SYSCALL
              The syscall name.

       ARGS   The arguments to the syscall

       (RET)  The return value for the syscall: 0 == success, other numbers indicate an error code.

Name

       setuids.bt - Trace setuid family of syscalls. Uses bpftrace/eBPF.

Os

       Linux

Overhead

       setuid calls are expected to be low frequency (<< 100/s), so the overhead of this tool is expected to  be
       negligible.

Requirements

       CONFIG_BPF and bpftrace.

See Also

capable.bt(8)

USER COMMANDS                                      2019-07-05                                      setuids.bt(8)

Source

       This tool originated from the book "BPF Performance Tools", published by Addison Wesley (2019):

              http://www.brendangregg.com/bpf-performance-tools-book.html

       See the book for more documentation on this tool.

       This version is in the bpftrace repository:

              https://github.com/bpftrace/bpftrace

       Also  look  in  the  bpftrace  distribution  for a companion _examples.txt file containing example usage,
       output, and commentary for this tool.

Stability

       Unstable - in development.

Synopsis

setuids.bt

See Also