How rub-nds/pret works
PRET is a printer-security testing toolkit: a user selects a target and printer language, then runs shell commands that are translated into printer-language traffic and returned as readable output. Its language drivers expose distinct PostScript, PJL, and PCL capabilities, including filesystem access, memory/configuration operations, job manipulation, and fuzzing. Discovery and optional language-support checks are separate entry paths; LPD printing and protocol tests are standalone tools. The README documents broader attack capabilities, while sampled source confirms only selected driver and transport details.
Main entry points: printer.py Command shell · helper.py Device transport · postscript.py PostScript driver · pjl.py PJL driver
Components 19
Interactive session
- Command shell
printer.py - Device transport
helper.py - Output and logging
helper.py
Printer languages
- PostScript driver
postscript.py - PJL driver
pjl.py - PCL driver
pcl.py - Remote filesystem
printer.py - Job and device operations
postscript.py - Fuzz testing
fuzzer.py - Print command
printer.py
Discovery and checks
- Printer discovery
discovery.py - Language support check
capabilities.py
LPD utilities
- LPD print client
lpd/lpdprint.py - LPD security tests
lpd/lpdtest.py
Other components
- Operator
- Network printer
- SNMP printer services
- IPP and web services
- LPD printer service
Connections 27
- Operator → Command shell: runs commands
- Command shell → PostScript driver: selects PS
- Command shell → PJL driver: selects PJL
- Command shell → PCL driver: selects PCL
- Command shell → Device transport: opens device
- Device transport → Network printer: sends traffic
- Network printer → Device transport: returns traffic
- PostScript driver → Device transport: sends commands
- PJL driver → Device transport: sends commands
- PCL driver → Device transport: sends commands
- Command shell → Remote filesystem: dispatches commands
- Command shell → Job and device operations: dispatches commands
- Command shell → Fuzz testing: dispatches tests
- Command shell → Print command: dispatches print
- PostScript driver → Output and logging: formats results
- PJL driver → Output and logging: formats results
- PCL driver → Output and logging: formats results
- Operator → Printer discovery: requests discovery
- Printer discovery → SNMP printer services: broadcast queries
- SNMP printer services → Printer discovery: returns device data
- Operator → Language support check: requests safe check
- Language support check → IPP and web services: checks support
- Language support check → SNMP printer services: checks support
- Operator → LPD print client: submits print job
- LPD print client → LPD printer service: sends job
- Operator → LPD security tests: runs protocol test
- LPD security tests → LPD printer service: tests protocol