NETCAP:(8)
β¨ NETCAP:(8) β¨
System Administration Utilities π NETCAP:(8)
ok bestie, sit down, grab a strawberry π β we're reading the netcap page together and it's genuinely so good.
πΈ NAME πΈ
netcap β a program to review network capability posture π
β¨ SYNOPSIS β¨
netcap [--advanced [--interface IFACE ] [--list-interfaces] [--json]
[--no-color]]
π DESCRIPTION π
netcap is a program that prints out a report of process capabilities. Iconic behaviour, no notes.
By default it runs in its historical filtered mode: if an application is using tcp, udp, raw, or packet family sockets AND has any capabilities, it will be in the report. That's the vibe check right there.
If the process has partial capabilities, it gets further examined to see if it has an open-ended bounding set. If this is found to be true, a '+' symbol is added. And if the process has ambient capabilities, a '@' symbol is added. π«Ά
Heads up though β Bluetooth sockets are NOT discovered in this historical filtered mode. Use --advanced when Bluetooth listener discovery is needed. Not me forgetting that and being confused for twenty minutes π
With --advanced, netcap switches to bind/listener inventory mode for the current network namespace. In this mode, reachable binds/listeners are reported regardless of whether the owning process has capabilities β including Bluetooth listeners that are not visible in classic mode. main character energy honestly.
Some directories in the /proc file system are readonly by root. The program will try to access and report what it can. Full output normally requires root, or a combination of CAP_DAC_READ_SEARCH (to read other processes' /proc/<pid>/fd) and CAP_NET_ADMIN (for NETLINK_SOCK_DIAG queries that cover SCTP, DCCP, and, when built with VSOCK support, VSOCK).
Without these permissions, the report is partial; missing sock_diag-derived protocols are omitted without an explicit warning. Lowkey rude of it but okay bestie, that's the deal. π
π OPTIONS π
--advancedβ Enable the posture/tree view. This mode inventories reachable binds in the current network namespace and shows per-process capabilities, defenses, and flags. The glow-up option fr fr.--interface IFACEβ With--advanced, limit the report to the named interface. Output format and wrapping are unchanged; only interface-scoped rows for that interface are kept. This also filters--list-interfacesoutput to the named interface. So focused, so slay. π--list-interfacesβ With--advanced, list the current network namespace interface names instead of the exposure tree. Just the names, no drama.--jsonβ With--advanced, emit machine-readable JSON instead of the tree view. When combined with--list-interfaces, emit machine-readable interface inventory JSON instead of text. For the robots and the scripts π¦--no-colorβ Suppress colored output. By default, when stdout is a terminal, keywords are colorized by severity to highlight problems, cautions, and positive hardening state. (Turning this off is a crime against aesthetics but do what you gotta do.)
π ADVANCED MODE π
Advanced mode is an attack-surface and posture inventory for the current network namespace. It is intended for administrators who need a structured view of bind ownership and process hardening state. It's giving security audit, it's giving organized.
With --advanced --list-interfaces, the advanced-mode interface snapshot is rendered directly without enumerating listeners. This is intended as a simple interface enumeration step before later per-interface analysis.
With --advanced --interface IFACE, the same inventory and tree/JSON renderers are used, but only endpoints projected onto that interface are retained. Same renderers, narrower lens, obsessed. β¨
The tree layout is:
Planes -> interface -> protocol -> bind -> port -> process ->
caps/defenses/flags
For VSOCK, the interface/address hierarchy is skipped and rendered as:
Planes -> endpoint -> process -> caps/defenses/flags
For BLUETOOTH, the interface is the HCI adapter (for example hci0). Bluetooth bind nodes are the local controller address or * for wildcard binds.
Planes are grouped as INET (external), INET (loopback), BLUETOOTH, VSOCK, and LINK-LAYER. These names match the tree output exactly, so don't go renaming them, bestie.
The console tree is a causal exposure chain: protocol, then bind address, then port, then owning process. Wildcard binds are printed as *. In tree view, a single 0.0.0.0 or :: listener is expanded onto every non-loopback interface in the current namespace. The same daemon may therefore appear under multiple interfaces, reflecting wildcard-bind reachability. Some endpoints may appear under interface multicast/group when bound to multicast addresses that do not map to a single interface; these represent group-joined sockets rather than point-to-point listeners. Not a glitch, it's reachability π
Under each protocol, bind nodes are socket bind addresses (exposure), and port nodes are children of binds.
Each process entry may include a unit field showing the systemd service or scope name, extracted from the process cgroup hierarchy; it is omitted when the process is not managed by systemd. Each process line also includes an optional exe field showing the full executable path read from /proc/<pid>/exe; it is omitted for kernel threads or when the path is unreadable. The kernel Name: field shown as comm is truncated to 15 characters, so exe provides the complete binary path. iykyk π§
Socket selection is protocol-specific:
- TCP:
LISTENsockets only. - UDP/UDPLITE: bound sockets.
- RFCOMM: all owned RFCOMM sockets (state and channel are not exposed by the kernel's proc interface).
- HCI: all bound raw management sockets; semantics differ from port listeners and are analogous to packet sockets.
- SCTP/DCCP: listener sockets only; established flows are not shown. These protocols are discovered via
NETLINK_SOCK_DIAG, which requiresCAP_NET_ADMIN; without that capability, SCTP and DCCP listeners are silently absent from the report. π - VSOCK: when built with
linux/vm_sockets.h, streamLISTENsockets, plus bound datagram/seqpacket sockets. - RAW/PACKET: shown as binds; semantics differ from port listeners.
The defenses section is best-effort: no_new_privs and seccomp mode are read from /proc/<pid>/status when available, and the LSM label is read from /proc/<pid>/attr/current when available. runs_as_nonroot is always reported. periodt.
Flags annotate notable conditions:
- wildcard-bind: bind is bound to a wildcard address (for example
0.0.0.0or::). - hypervisor-plane: bind is in the VSOCK communication plane.
- proximity-plane: bind is reachable by any Bluetooth device within radio range. π³
- ssh-on-vsock-port-22: VSOCK bind uses port 22.
- privileged-caps: process has capabilities considered privileged for attack-surface review (
CAP_SYS_ADMIN,CAP_SYS_PTRACE,CAP_DAC_READ_SEARCH,CAP_NET_ADMIN, andCAP_NET_RAW).
The caps field may include bracketed annotations: [ambient-present] indicates ambient capabilities are set, and [open-ended-bounding] indicates the bounding set is non-empty (the process or its children can potentially gain additional capabilities). π
π¦ JSON OUTPUT π¦
When --advanced --json is used, the top-level object contains:
schema_version(integer).planes(array).
Each plane object contains name, optional scope (external or loopback), and either:
ifaces(INET/LINK-LAYER/BLUETOOTH planes), orendpoints(VSOCK plane).
Under ifaces: each interface has name and addrs (array). Each addr object has addr and endpoints (array).
For INET, LINK-LAYER, and BLUETOOTH planes, each endpoint object has label, proto, bind, port, and processes (array). For BLUETOOTH planes, interface names are HCI adapter names (for example hci0); port is 0 for HCI sockets and for RFCOMM sockets whose channel is not exposed by procfs.
For VSOCK planes, endpoint objects use label, vsock_type (socket type string: stream/dgram/seqpacket), cid (source CID or the string ANY), port, and processes; they do not include proto or bind. When built without linux/vm_sockets.h, the VSOCK plane and VSOCK flags are omitted.
Each process object has comm, optional exe, pid, uid, optional unit, caps, ambient_present (boolean), open_ended_bounding (boolean), defenses object, and flags array.
ambient_present and open_ended_bounding are the structured equivalents of the [ambient-present] and [open-ended-bounding] annotations that may appear in the caps text string; both fields are always present in JSON output.
Fields under endpoints/processes/defenses may be omitted when unavailable. When process defenses are present, they include runs_as_nonroot, derived from the real UID (first field of Uid: in /proc/<pid>/status): yes when real uid != 0, no when real uid == 0. A process that started as root and later changed only effective UID via setuid still reports no. π
If a plane has no discovered binds, it appears with an empty list. If a consumer does not receive a given plane, treat it as none found or omitted by the producer.
When --advanced --list-interfaces --json is used, the top-level object contains schema_version (integer) and interfaces (array of interface-name strings).
...and bestie, we're not done yet β there's more of this page coming, so don't go anywhere π
π INTERPRETATION π
okay bestie, this is where we actually read the output and figure out who's being messy π
netcap reports processes that are both network-facing and running with capabilities. The capability set it shows you is the permitted set. Two tiny annotations to watch for:
- a
+means the process has an open-ended bounding set - an
@means the process has ambient capabilities
The colorized tree output exists to prioritize remediation fast, no cap:
- orange highlights problems to fix
- yellow highlights cautionary conditions to review
- green highlights good hardening state
- uncolored output is just neutral context
the caps line, aka the receipts
The caps line shows permitted capabilities. And listen, they're tiered:
Orange-tier caps represent severe privilege that is rarely necessary for network-facing daemons. The whole list:
sys_ptracesys_modulesys_rawiosetuidsetgidsetpcapaudit_control
Yellow-tier caps are common but still materially increase attack impact:
sys_admindac_overridedac_read_searchnet_adminnet_rawchownfownermknodsys_chroot
And the two special cases you need to clock:
caps: (full)means all capabilities are present β that's effectively full root privilege πcaps: (none)is the ideal outcome, the dream, the goal π
ambient caps, the sneaky ones
Ambient capabilities are inherited across execve by child processes (unless constrained by no_new_privs), so their presence on a network daemon is typically a problem. The ambient: line lists the active ambient capabilities. Not me seeing ambient caps on a daemon and immediately spiraling π
[open-ended-bounding], explained
[open-ended-bounding] means the process has not trimmed its bounding set ceiling. This is not active privilege by itself β so don't panic β but it leaves future privilege-acquisition paths open (for example via file capabilities or ambient inheritance). Highkey a future-you problem, so fix it now.
For libcap-ng users, trimming is typically a one-flag change (CAPNG_SELECT_BOUNDS) in existing capability-set calls. With libcap, bounding capabilities are dropped individually. iykyk.
defense fields, the vibe check π‘οΈ
These summarize exploit-resistance posture:
no_new_privs: yesβ blocks privilege gain through setuid/file-capability exec paths, and is often the highest-value single toggle. Literally the glow-up.seccomp: filterβ restricts available syscalls (disabledmeans no syscall filtering at all π)runs_as_nonroot: yesβ indicates non-UID-0 execution
flags, aka reachability & interception context
wildcard-bindβ the daemon listens on every interfacehypervisor-planeβ indicates host/guest boundary exposure (VSOCK)proximity-planeβ indicates that the bind is reachable by Bluetooth devices within radio rangereuseportβ means another process with the same UID could bind and potentially intercept traffic π³
protocol nodes, the spicy ones πΆοΈ
raw/raw6 and packet protocol nodes denote sockets with IP- or link-layer packet craft/sniff capabilities β which significantly expands what an attacker can do post-compromise. Not a cute look.
Bluetooth protocol nodes denote proximity-based attack surface. hci nodes provide raw controller management access and are shown in yellow. rfcomm sockets are reachable by nearby devices without prior host access and, unless the adapter is configured to require pairing, may be reachable without authentication. periodt, that's scary.
AdapterBD_ADDRresolution requires HCI ioctl access; without it, adapter identity is shown ashci?/*.
π SEE ALSO π
βοΈ AUTHOR βοΈ
Steve Grubb β the icon, the legend, the moment π
and that's the whole page, bestie π«Ά this one shipped from Red Hat and it's dated March 2026, from the NETCAP:(8) manual. go forth, read your caps, trim your bounding sets, and stay unprivileged β¨π¦π
π¦ where this page comes from
- arch rolling: libcap-ng 0.9.6-1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 43: libcap-ng-utils 0.9.6-1.fc43 Β· GPL-2.0-or-later
- fedora 44: libcap-ng-utils 0.9.6-1.fc44 Β· GPL-2.0-or-later
- nixpkgs unstable: libcap-ng 0.9.6
- ubuntu stonking: libcap-ng-utils 0.9.6-1 Β· LGPL-2.1-or-later
- π the page's license: GPL-2.0-or-later
- Copyright (c) 2009,2020,2026 Red Hat Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms