Info Sharing Blog

Saturday, October 3, 2020

Hacking Printers [PRET - Printer Exploitation Toolkit].

October 03, 2020 Posted by jaacostan

I have recently tried the PRET toolkit to hack the printers connected or accessible in your network. PRET stands for Printer Exploitation Toolkit. PRET can access the printer in your network or USB and exploits the features of the printer language. A hacker can perform activities such as capturing or manipulating print jobs, accessing the printer's file system, cached documents, access memory and even do permanent damages as well. PRET utilizes TCP port 9100 when connecting the printer over the network.

There are three main languages that printers speak and you should know the exact one to successfully exploit the machine. You can do basic enumeration, try one by one.
1. ps (Postscript)
2. pjl (Printer Job Language)
3. pcl (Printer Command Language)

You can see network printers everywhere. But how often organizations update the firmware of their printers? This could be a soft target for hackers.

 Usage: Access and clone the toolkit from Github : https://github.com/RUB-NDS/PRET

 # pip install colorama pysnmp //Install the dependencies.

You can simply run the pret.py. This will search for the locally connected printers in your network by using SNMP. 

To access a network printer, provide the IP and the printer language. Here i tried pcl 


Try different printer languages.Example:
python pret.py {IP} pjl
python pret.py laserjet.lan ps
python pret.py /dev/usb/lp0 pcl
// works if your printer is connected to your system.

Once you successfully connected the printer, you can use the basic UNIX commands to browse through the printer and access the documents and configurations.

Access the toolkit Github page to see the complete supported commands. [https://github.com/RUB-NDS/PRET]

When new vulnerabilities in a printer firmware are discovered, respective exploits are also been created by the developers/hackers. You can see network printers everywhere. But how often organizations update the firmware of their printers? This could be a soft target for hackers and it is very important to perform firmware updates for the network connected devices such as printers, scanners, IoT devices etc.