📦 CUPS

What is it?

  • Concept: The Common UNIX Printing System — the standard printing stack on Linux/Unix. The scheduler cupsd typically runs as root, listening on 631/tcp (IPP) and the local domain socket /run/cups/cups.sock; the default bind is 127.0.0.1:631.
  • Impact: Because cupsd is root and accepts printer/queue definitions, bugs tend to yield local privilege escalation (arbitrary root file write/overwrite) and, historically, remote RCE via cups-browsed.

How it works

  1. Clients speak IPP to cupsd (HTTP-like, over TCP 631 or the unix socket).
  2. Admin operations (create printer, set device URI) need authorization; requests over the local socket / loopback can obtain an Authorization: Local token.
  3. A printer has a device URI (ipp://, socket://, file://, …). Printing sends the job to that backend — a file:// backend writes the job data to a path as root.

Security Quirks & Niche Facts

  • Fingerprint the version (the vuln is version-specific and the banner won’t tell you):
    dpkg -l | grep cups                      # Debian/Ubuntu package version
    ls /etc/ld.so.conf.d/ | grep -i cups     # e.g. cups2416.conf hints at the build
    ss -tulnp | grep 631                     # confirm cupsd is listening (often localhost-only)
  • FileDevice No is the default in cupsd.conf and normally blocks file:// device URIs — exploits work by bypassing this policy.

Notes

  • A root daemon bound to 127.0.0.1:631 is a classic “local service analysis” privesc surface. Whenever you land an unprivileged shell with no sudo/SUID path, enumerate localhost services (ss -tulnp) and version-check CUPS.
  • External nmap won’t see a localhost-only cupsd — you only find it from inside the box.

Mitigation

  • Fix: Patch CUPS; keep FileDevice No; disable/firewall cups-browsed and port 631 where printing isn’t needed; tighten the CUPS admin policy.
FileCreated
HTB Machine - LayoverOctober 04, 2026

References: