, ,

[English Version] Remotely reboot of HP and other printers!

(I apologize for my bad English – La versione Italia è qui.)

Premise

My HP LaserJet Pro presents punctually two problems after several days without activity, the most obvious problem is the on the scanner function that will create a scansion with vertical bars of different colors over the page. The second issue involves printing, is very slow in receiving data. Both problems seem to be related to an incorrect management of RAM which leaving the printer unused for several days you go to saturate.

The customer assistance recommend to perform reset of NVRAM, but this procedure loss all configurations. It’s been over a year since my report and other users of this problem, but nothing changed. No firmware update was unfortunately released, last in February 2015, bringing even behind the failure to resolve several vulnerabilities (such as OpenSSL).

To quickly solve the problems described above, just do a manual reboot of the printer, but are always in a hurry when I happen to do a scan and detect the problem which forces me to wait further.

In the past I have checked if it was possible to perform a reboot by software, as well as to automate the process, but unfortunately the Web interface or Telnet does not have a restart function. Absurd! I found then a first procedure via FTP but did not work, the printer prints a blank page and a second procedure again via FTP by sending a custom text string. This second procedure did not generate some effect.

During the feast of Santo Stefano (26 December) my wife has different printed material for his blog and printed was evidently slow in receiving the data (going from memory I had used the printer the last time 7 days before), the first printing of 11 sheets it took about 13 minutes and after a restart printing the same material took less than two minutes.

I tried again a solution to automatically reboot and found an article in a German blog (I did not understand who the author) illustrating a procedure to be performed by running Microsoft PowerShell that uses the protocol SNMP .

$PrinterIP = "192.168.1.87"
$SNMP = New-Object -ComObject olePrn.OleSNMP
$SNMP.Open($PrinterIP, "public")
$SNMP.Set(".1.3.6.1.2.1.43.5.1.1.3.1",4)
$SNMP.Close()

For Linux/Unix you must install the SNMP package using aptitude:

sudo apt-get install snmp

and you can run the HP Printer Reboot through the terminal with the simple command:

snmpset -v 1 -c public 192.168.1.87 ".1.3.6.1.2.1.43.5.1.1.3.1" i 4

you have replace 192.168.1.87 with the IP address of your printer.

I then decided to include an automatic cron, on my home server, which at 2 am, and every 2 days I run a reboot:

0 2 */2 * * /usr/bin/snmpset -v 1 -c public 192.168.2.41 ".1.3.6.1.2.1.43.5.1.1.3.1" i 4

IT Security: Remotely Reboot Without Password

With the steps I finally solved the problem, but I found that there is no authentication request in the command that impute.

The SNMP protocol is used by multiple printers to communicate to the user/client the state in which the printer is located (in use, the document added to the queue, finished cartridge, etc.) and uses UDP port 161 for questions and answers, and UDP port 162 as the destination of the messages.

I then exposed port 161 of my printer on the Internet and its related web interface. By a external connection I run the command described above with the public IP of my VDSL connection being able to remotely reboot the printer. Yes, I restarted my printer without any authentication.

The printer displays a “Restarting …” message as it has received the restart command.

By Shodan I discover the presence of nearly 3 million devices connected to the internet with port 161 open, but they are not just printers. A more precise search locates 30248 HP device with port 161 open but also other brands like 494 device Epson, 4235 devices Exor and 541 devices Lexmark.

I did a test on a Lexmark printer connected remotely, it is also possible to restart it. I do not however carried out tests on the Epson device, Exor or other brands because I do not have. If someone has a printer of another brand and wanted to prove I can update this article with your test.

A printer Should not be exposed on the Internet, on this point I think we all agree. But producers should pay attention in the implementation of the functionality and safety of the devices they sell. An attacker could restart continuously printers on a hospital infrastructure or a large company by blocking the printing of reports or important documents.

Or just wake up in the night your friends because of the noise of the rollers of its laser printer! 😀