Exploiting Printers
Exploiting Printers
Exploiting Printers
vorgelegt von
Müller, Jens
30.09.2016
Ich versichere, dass ich diese Arbeit selbständig verfasst und keine anderen als die
angegebenen Quellen benutzt habe. Die Stellen, die anderen Quellen dem Wortlaut
oder dem Sinn nach entnommen sind, habe ich unter Angabe der Quellen kenntlich
gemacht. Dies gilt sinngemäß auch für verwendete Zeichnungen, Skizzen, bildliche
Darstellungen und dergleichen.
Official Declaration
Hereby I declare, that I have not submitted this thesis in this or similar form to any
other examination at the Ruhr-Universität Bochum or any other Institution of High
School.
I officially ensure, that this paper has been written solely on my own. I herewith
officially ensure, that I have not used any other sources but those stated by me. Any
and every parts of the text which constitute quotes in original wording or in its essence
have been explicitly referred by me by using official marking and proper quotation.
This is also valid for used drafts, pictures and similar formats.
Not this English translation, but only the official version in German is legally binding.
Over the last decades printers have evolved from mechanic devices with microchips to
full blown computer systems. From a security point of view these machines remained
unstudied for a long time. This work is a survey of weaknesses in the standards and
various proprietary extensions of two popular printing languages: PostScript and PJL.
Based on tests with twenty laser printer models from various vendors practical attacks
were systematically performed and evaluated including denial of service, resetting the
device to factory defaults, bypassing accounting systems, obtaining and manipulating
print jobs, accessing the printers’ file system and memory as well as code execution
through malicious firmware updates and software packages. A generic way to capture
PostScript print jobs was discovered. Even weak attacker models like a web attacker
are capable of performing the attacks using advanced cross-site printing techniques.
1. Introduction 1
1.1. Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2. General Idea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3. Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4. Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Fundamentals 3
2.1. Network Printing Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2. Printer Control Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3. Page Description Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3. Related Work 9
3.1. Significant Prior Research . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4. Methodology 12
4.1. Research Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.2. Attacker Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5. Attacks 16
5.1. Denial of Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.2. Privilege Escalation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.3. Print Job Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.4. Information Disclosure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.5. Remote Code Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
6. Prototype Implementation 24
6.1. Program Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
6.2. Printer Discovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
6.3. Protocol Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.4. Featured Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
7. Evaluation 34
7.1. Attacker Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
7.2. Printer Exploitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
7.3. Printer Forensics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
7.4. Additional Findings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
8. Countermeasures 65
9. Conclusion 67
A. Appendix 73
List of Figures
IP Internet Protocol
1.1. Motivation
Remember the old hacker days when Angelina Jolie and Jonny Miller went dumpster
diving to get hard copies of sensitive documents? The world has changed since then.
Our devices have become ‘smart’. In the internet of things we can find televisions,
video game consoles, pacemakers and printers. There is no need to ransack the garbage
container anymore if you can obtain a digital version of the document in demand.
We must stop to view printers as ‘devices that print’. Printers nowadays are connected
to a network and combined with other functionalities such as fax or scanner. We must
realize that they became full blown computers running standard operating systems.
Millions of those devices are located in offices and homes with potentially insufficient
protection.1 It is therefore high time for an in-depth analysis of printer insecurity.
1
3. Printer malware distribution We discuss various techniques to deploy mali-
cious print jobs and demonstrate which attacker models are hereby able to abuse
the vulnerabilities found in 1. and 2.
1.2.1. Delimitations
In this work we focus on printer-specific vulnerabilities. Other weaknesses like XSS
or logic flaws in the FTP service of a printer therefore are not covered, even though
they should be part of a comprehensive penetration test. Because we are interested
in vulnerabilities in business devices, we delimit our analysis to models capable of
printing several thousand pages without needing to replace cartridges. This leaves out
inkjet printers, which even today often have no support for networking anyway.
1.2.2. Limitations
There are lots of printer models by various manufacturers and it is hardly possible to
cover them all. Due to a lack of funding, test printers have to be acquired as donations
from various university chairs and facilities. This limits the newness and diversity
of devices to be analyzed. Given enough donated devices however, our pool of test
printers should be a good sample of what is used in small and medium-sized offices.
1.3. Contributions
The goal of this thesis is to create a blueprint for network printer penetration testing and
discuss protection mechanisms. Although potential vulnerabilities have been known to
exist for decades, there has not been much academic research on this topic. Our work
is a contribution to close this knowledge gap. A prototype implementation to conduct
semi-automated security tests will furthermore be released as open-source software.
1.4. Outline
Chapter 1 contains an overview of our project, introducing the motivation behind it
and the general idea. In Chapter 2, we discuss the fundamentals of network printing
protocols, printer/job control and page description languages. A survey of significant
prior research and known vulnerabilities in printers since 1999 is given in Chapter 3.
Following on from this, Chapter 4 lays out the research approach and defines attacker
models. Known and new attacks against network printers covering denial of service,
privilege escalation, print job manipulation, information disclosure and remote code
execution are described in Chapter 5. A prototype implementation to automate printer
analysis and exploitation is proposed in Chapter 6. Presented attacks are evaluated
against the assembled pool of test printers in Chapter 7. Together with a discussion of
countermeasures in Chapter 8, this leads up to the conclusion in Chapter 9.
2
2. Fundamentals
Typical printers range from classical dot matrix to inkjet or laser printers used at home
or in small businesses. The printing hardware is not addressed in detail in this work,
as from a security perspective it seems less relevant.1 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 or telefax. In the following, we
give an introduction to fundamental printing technologies, including network printing
protocols, printer control and page description languages.
1
Even though some newspapers claimed hackers could set laser printers on fire by overheating them,
http://www.wired.com/2011/12/hp-printer-lawsuit/, May. 2016
3
2.1. Network Printing Protocols
Sending data to a printer device can be done by USB/parallel cable or over a network.
In this work we focus on network printing but most of the presented attacks can also
be performed against local printers. There are various exotic protocols for network
printing like Novell’s NCP or AppleTalk. In the Windows world, SMB/CIFS printer
shares have become popular. Furthermore, some devices support printing over generic
protocols such as FTP or HTTP file uploads. The most common network printing
protocols however are LPD, IPP and raw port 9100 printing as introduced below.
2.1.1. LPD
The Line Printer Daemon (LPD) protocol had originally been introduced in Berkeley
Unix in the 1980s. The existing implementation was later specified by [McL90]. The
daemon runs on port 515/tcp and can be accessed using the ‘lpr’ command. While the
LPD process was traditionally hosted on a computer system connected to the printing
device, today’s network printers run their own daemon directly accessible over the
network. To print, the client sends a control file defining job/username and a data file
containing the actual data to be printed. The input type of the data file can be set in
the control file by choosing among various file formats. However it is up to the LPD
implementation how to actually handle the print data. A popular LPD implementation
for Unix-like operating system is LPRng.2 LPD can be used as a carrier to deploy
malicious PostScript or PJL print jobs. The protocol itself is not further analyzed in this
work, with the exception of accounting bypasses in Section 5.2.2 and a fuzzer written
to discover buffer overflows in LPD implementations as described in Section 5.5.1.
2.1.2. IPP
Between 1999 and 2005 the IETF IPP working group published various draft standards
for an LPD successor capable of authentication and print job queue management. The
Internet Printing Protocol (IPP) is defined in [Her00, H+ 00]. Extensions have been
specified for mobile and cloud printing [PWG13] as well as for 3D printing [PWG16].
Because IPP is based on HTTP, it inherits all existing security features like basic/digest
authentication (see [FHBH99]) and SSL/TLS encryption. To submit a print job or to
retrieve status information from the printer, an HTTP POST request is sent to the IPP
server listening on port 631/tcp. A famous open-source IPP implementation is CUPS,3
which is the default printing system in many Linux distributions and OS X. Network
printers usually run their own IPP server as one method to accept print jobs. Similar
to LPD, IPP is a channel to deploy the actual data to be printed and can be abused as a
carrier for malicious PostScript or PJL files. In this work, IPP itself is no further used
except for accounting in Section 5.2.2 and printer language discovery in Section 6.2.
2
Powell, P., LPRng – An Enhanced Printer Spooler, http://www.lprng.com/, May. 2016
3
Sweet, M., Common Unix Printing System, http://www.cups.org/, May. 2016
4
2.1.3. Raw
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 architecture4 to communicate with network printers as it is
considered as ‘the simplest, fastest, and generally the most reliable network protocol
used for printers’.5 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 and IPP, interpreted printer control or 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 and PostScript commands, for example for file system access. Therefore
raw port 9100 printing – which is supported by almost any network printer – is used
as the primary channel in our security analysis and the prototype implementation.
2.2.1. PJL
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’
[HP 97] 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 printers 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
4
Microsoft Corporation, Windows Printer Driver Architecture, https://msdn.microsoft.com/
windows/hardware/drivers/print/printer-driver-architecture, May. 2016
5
Sweet, M., Network Protocols supported by CUPS – AppSocket Protocol,
https://www.cups.org/doc/network.html#PROTOCOLS, May. 2016
5
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 in Listing 2.1.
In this work PJL is used for various attacks such as denial of service (Section 5.1.3),
manipulating page counters (Section 5.2.2), gaining access to memory (Section 5.4.1)
and file system (Section 5.4.2) as well as malicious firmware updates (Section 5.5.2).
2.2.2. SNMP
SNMP is a port 161/udp protocol, designed to manage various network components
like routers. The architecture is defined in [HW00]. Information offered by a managed
system is not subject to the standard itself but defined in separate hierarchical database
files, so called MIBs. An MIB consists of various OID entries, each one identifying a
variable to be either monitored (SNMP GetRequest) or modified (SNMP SetRequest).
An example of retrieving the hrDeviceDescr value (OID 1.3.6.1.2.1.25.3.2.1.3)
from the ‘Host Resources MIB’ as defined in [GW93] is shown in Listing 2.2.
While SNMP is not printer-specific, many printer manufacturers have published MIBs
for their network printer models. A generic approach to create a vendor-independent
‘Printer MIB’ was taken in [BML04]. As a stand-alone language, we make use of
SNMP only in Section 6.2 to enumerate printing capabilities. However SNMP can be
embedded within PJL and therefore included into arbitrary print jobs as shown below.
2.2.3. PML
The Printer Management Language (PML) is a proprietary language to control HP
printers. It basically combines the features of SNMP with PJL. Publicly available
documentation has not been released, however parts of the standard were leaked by
the LPRng project. [HP 00] defines PML as ‘an object-oriented request-reply printer
management protocol’ and gives an introduction to the basics of the syntax. PML is
embedded within PJL and can be used to read and set SNMP values on a printer device.
This is especially interesting if a firewall blocks access to SNMP services (161/udp),
but an attacker is still able to print using one of the various techniques discussed in
Section 7.1. The use of PML within a print job is demonstrated in Listing 2.3. In this
work, PML is used to reset the printer to factory defaults as described in Section 5.2.1.
6
Listing 2.3: PML request to read the textual description of a device
get len. M IB OID
z }| {z}|{z}|{z }| {
1 > @PJL DMINFO ASCIIHEX="0000 06 03 0302010301"
2 < "8000000603030201030114106870204c617365724a65742034323530
| {z }"
hpLaserJet4250 (hexdecimal)
2.3.1. PostScript
The PostScript (PS) language was invented by Adobe Systems between 1982 and 1984.
It has been standardized as PostScript Level 1 [Ado85], PostScript Level 2 [Ado92],
PostScript 3 [Ado99] and in various language supplements. While PostScript has lost
popularity in desktop publishing and as a document exchange format to PDF, it is still
the preferred page description language for laser printers. The term ‘page description’
may be misleading though, as PostScript is capable of much more than just creating
vector graphics. PostScript is a stack-based, Turing-complete programming language
consisting of almost 400 operators for arithmetics, stack and graphic manipulation
and various data types such as arrays or dictionaries. Technically spoken, access to a
PostScript interpreter can already be classified as code execution because any algorith-
mic function can theoretically be implemented in PostScript. Certainly, without access
to the network stack or additional operating system libraries, possibilities are limited
to arbitrary mathematical calculations like mining bitcoins. However, PostScript is
capable of basic file system I/O to store frequently used code, graphics or font files.
Originally designed as a feature, the dangers of such functionality were limited before
printers got interconnected and risks were mainly discussed in the context of host-
based PostScript interpreters. In this regard, Encapsulated PostScript (EPS) is also
noteworthy as it can be included in other file formats to be interpreted on the host such
as LATEX documents. An example to echo Hello world to stdout is given in Listing 2.4.
7
Listing 2.4: Example PostScript document
1 %!
2 (Hello world) print
In this work, PostScript is used for a variety of attacks such as denial of service through
infinite loops (Section 5.1.3), manipulation and retention of print jobs (Section 5.3 and
Section 5.4.3) as well as gaining access to the printer’s file system (Section 5.4.2).
2.3.2. PDF
The PDF file format has initially been released by Adobe Systems in 1993 the and later
became an ISO standard [ISO08]. It was designed as a successor of PostScript and
has established itself as a widely accepted document exchange format. Some newer
printers support direct PDF printing in addition to PostScript. While PDF is partially
based on PostScript, it is neither a complete programming language, nor does it support
file system operations. Therefore PDF seems less applicable for printer exploitation
and is not further studied in this work.
2.3.3. PCL
The Printer Command Language (PCL) as specified in [HP 92] is a minimalist page
description language supported by a wide variety of vendors and devices. Along with
PostScript, PCL represents a de facto standard printer language. Similar to PostScript,
it’s origins date back to the early 80s with PCL 1 introduced by HP in 1984 for inkjet
printers. PCL 3 and PCL 4 added support for fonts and macros which both can be
permanently downloaded to the device – however only referenced to by a numeric id,
not by a file name, as direct access to the file system is not intended. PCL 1 to 5
consist of escape sequences followed by one or more ASCII characters representing
a command to be interpreted. PCL 6 Enhanced or ‘PCL XL’ uses a binary encoded,
object-oriented protocol [HP 02]. If not stated otherwise, traditional PCL 5e is used in
this work. An example PCL document to print ‘Hello world’ is given in Listing 2.5.
1 <Esc>EHello world
Due to its limited capabilities, PCL is hard to exploit from a security perspective. In
this work it is applied to create a virtual, macro-based file system within the printers
memory, which can be used for file-sharing purposes as described in Section 6.4.
8
3. Related Work
In the following, we give an introduction to related work on the topic of printer security
including significant prior research and a survey of known vulnerabilities since 1999.
1
FtR of Phenoelit, PFT and Hijetter, http://www.phenoelit.org/hp/, Jun. 2016
9
A systematic analysis of vulnerabilities in the embedded web server of printer devices
has been conducted by [HB11] and [Sut11]. [Wea07] discovered ‘cross-site printing’,
a technique to force web browsers into printing arbitrary payloads on a network printer.
A case-study of digital forensics on MFPs has been performed by [LLP+ 11]. Recently,
[Luk16] proposed a formal, policy-based security model for access control on MFPs.
Market Analysis The printer market is quite complex with over eighty different
manufacturers listed in the OpenPrinting2 project. Getting objective sales numbers for
the major players is hard and market share statistics differ based on printing technology
and geographic location of the market. According to the ‘Service Market Analysis
2012’ from Digital Peripherals Solutions Consulting as cited in the InfoTrends3 blog,
the top 10 players on the Western European laser printer market are: HP, Samsung,
Brother, Canon, Lexmark, Kyocera, Ricoh, Xerox, Dell as well as Konica Minolta.
The ‘Global Multi-Function Printer Market 2016-2020’4 report from Research and
Markets additionally names Epson, Panasonic, Oki, Kodak, Olivetti, Sharp, Toshiba,
Sindoh and UTAX as prominent vendors.
2
The Linux Foundation OpenPrinting workgroup, Printer Listings,
http://www.openprinting.org/printers, Jul. 2016
3
Hawkins, D., Placements of Western European Office Devices Continue to Suffer,
http://blog.infotrends.com/?p=10559, Jul. 2016
4
Research and Markets, Global Multi-Function Printer Market 2016-2020,
http://www.researchandmarkets.com/research/wbpkfb/global, Jul. 2016
5
MITRE Corporation, Common Vulnerabilities and Exposures (CVE),
https://cve.mitre.org/, Jul. 2016
6
ToolsWatch Org, vFeed correlated Vulnerability and Threat Database,
https://github.com/toolswatch/vFeed, Jul. 2016
7
National Vulnerability Database, Common Platform Enumeration (CPE),
https://nvd.nist.gov/cpe.cfm, Jul. 2016
10
Vendor Year(s) # CVEs
Xerox 1999–2010 52
HP 1999–2016 40
Canon 1999–2015 8
Lexmark 2004–2016 8
Brother 2002–2015 5
Kyocera 2006–2008 3
Oki 2008 2
Toshiba 2012–2014 2
Other 1999-2012 5
Total 1999-2016 125
It is worth emphasizing that not all vulnerabilities mentioned in prior research actually
got a CVE identifier assigned. 125 printer-related CVE identifiers have been assigned
since 1999. This number is relatively small compared to other networked devices like
routers which matched thousands of results using the search technique. HP and Xerox
each account for about one-third of the known vulnerabilities, however such statistics
need to be enjoyed with caution. Other vendors are not necessarily more secure, but
have potentially been less analyzed in the past. A complete list of CVEs in printer
devices can be found in Table A.1 in the appendix. We actually planned to map CVE
identifiers to the software weaknesses listed in the CWE8 catalog using vFeed. Too
many CWE identifier however match a single CVE identifier. To keep things clear,
we instead grouped vulnerabilities into nine categories of attack vectors as shown in
Table 3.2. It is remarkable that half of the identified security flaws are web-related
while only one twelfth are caused by actual printing languages like PostScript or PJL.
8
MITRE Corporation, Common Weakness Enumeration (CWE),
https://cwe.mitre.org/, Jul. 2016
11
4. Methodology
Acquiring the printers Test printer devices were collected as donations by various
university chairs and facilities. While our actual goal was to assemble a pool of printers
containing at least one model for each of the top 10 manufacturers, we practically took
what we could get. For this, we wrote a lot of emails and knocked on a lot of doors at
the University of Bochum. If available, the latest firmware was installed prior to any
tests to make sure any vulnerabilities discovered had not been fixed in the meantime.
Table 4.1.: Pool of test printers and MFPs, firmware version and supported languages
12
The assembled devices are not brand-new anymore, nor does the pool of test units
contain models for all of the top vendors. It should however represent a good mix of
devices used in a typical university or office environment. A list of all printers and
MFPs including their firmware version and supported languages is given in Table 4.1.
Note that printing functionality is mechanically broken for the Samsung CLX-3305W,
the Samsung MultiPress 6345N and the Dell 5130cdn. We nevertheless included these
devices because for most of the presented attacks it is sufficient that network services
are running. Additionally we were given permission by the university’s data center to
conduct non-destructive tests – limited to accessing the file system – against one of
their high volume MFPs: the Konica Minolta bizhub C454e as shown in Table 4.2.
PostScript and PJL We surveyed which security sensitive features exist in the
PostScript and PJL standards and their various proprietary extensions. Besides denial
of service attacks, privilege escalation and print job manipulation, we were especially
interested in job retention and access to the file system which is a legitimate feature of
both languages. For semi-automated tests, we implemented a Python 2.7 application.
If file operations were supported on a device, we examined the impact, for example, if
stored print jobs could be read or if access to configuration files lead to code execution.
Firmware and software We downloaded all printer firmware available for the top
10 vendors and studied the deployment process by either analyzing the file headers or
the channel (network traffic). To get information on protective measures like check-
sums or code signing we consulted the documentation and asked customer support.
If we came to the conclusion that no adequate security mechanisms exist to prevent
an attacker from deploying malicious firmware we documented this as potential future
work as we did not plan to modify firmware in this work. Furthermore we surveyed
which platforms are provided by the major vendors to develop custom software for
printers and built a proof-of-concept malware where access to an SDK was available.
13
4.2. Attacker Models
In the following we list attacker scenarios to be considered. Our default attacker is a
network attacker (AM2), meaning anyone who can access the targeted printer device
via TCP/IP. However, most attacks described in this work can also be carried out by a
local attacker (AM1) or even by a web attacker (AM3) as discussed in Section 7.1.
AM1 is a strong attacker model. However, it is not completely unrealistic for most
institutions and companies. Gaining physical access to printer devices 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 for AM1
include copy shops or – as a local example – the so called ‘VSPL terminals’ used to
print certificates of study at the University of Bochum.
14
4.2.2. Network Attacker (AM2)
An active network attacker can connect to the printer device over a TCP/IP network.
Specifically she is capable of:
• Accessing all network services offered by the device, including but not limited
to web, FTP, SMB, SNMP, LPD, IPP or raw port 9100/tcp printing
Note that in contrast to the term commonly used in literature, our network attacker is
an ordinary network participant, not capable of any kind of man-in-the-middle attacks.
AM2 is quite a strong attacker model as IP packets have to be routed from the attacker
to the printer device and backwards but printers usually are not directly connected
to the internet1 . As of July 2016, the Shodan search engine categorizes only 31.264
internet-accessible devices as printers as shown in the screenshot given in Figure 4.1.
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 AirPrint2 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.
Note that a wireless attacker falls into the AM2 category because like with a wired
network attacker, in the end TCP/IP is used to connect to the device.
It must be noted that AM1, AM2 and AM3 are not the only possible attacker models.
For example using social engineering, to make a victim print a malicious document, a
technique defined as ‘reflexive attack’ by [CS11], is not covered in this work – neither
are new printing methods like cloud-based printing because they would require access
to the providers’ portals. Such attack scenarios should be part of future work though.
1
It however must be noted that in many educational institutions – including the University of Bochum
– it is common even today to assign a public IP address to all networked devices including printers.
2
Apple Inc., About AirPrint, https://support.apple.com/en-us/HT201311, Jul. 2016
15
5. Attacks
In the following we collect the attacks from the literature and propose new approaches.
16
5.1.3. Document Processing
Page description languages allowing infinite loops or calculations that require a lot of
computing time can be abused to keep the printer’s RIP busy. Examples of this are
complex HP-GL calculations and PostScript programs. If the printer supports direct
XPS printing, a zip bomb can be placed. Even minimalist languages like PCL, can be
used to upload permanent marcos or fonts, until the available memory is consumed.
PJL on HP devices has undocumented features to completely disable further printing
functionality. In Section 7.2.1, we evaluate practical approaches of malicious print
jobs which lead to denial of service and have been implemented as the hang and
disable commands in our prototype implementation.
17
or page description languages. In the prototype implementation the reset command
implements such functionality for PML and PostScript as evaluated in Section 7.2.2.
18
dictionary, operators can be practically overwritten because the user-defined version
is the first one found on the dictionary stack. Using the exitserver operator,
such changes can be made permanent – at least until the printer is restarted (compare
[Ado99]). A scheme of the PostScript dictionary stack is given in Figure 5.1.
The potential impact of redefining operators is only limited by creativity. When further
legitimate documents are printed and call a redefined operator, the attackers version
will be executed. This can lead to a whole class of attacks and will confront us over
and over again in this work. Note however that this is not necessarily a security bug,
but a 32 years old language feature, available in almost any PostScript printer and RIP.
In the context of overlaying content, we can use this hack to add arbitrary graphics
or fonts to hard copies of a document. Pranks range from occasional coffee stains
on the sheets of a particular user to the simulation of a near empty toner cartridge.
It is also possible to completely alter the appearance of a document by overlaying a
blank page and then adding custom content. For a more advanced attack, imagine the
victim wants to sell a good to the attacker. Both parties agree on a price and receive
a digital copy of the sales agreement. As the attacker knows the exact location of
the price in the document, by manipulating the victim’s printer she can add a blank
rectangle here, including a lower price. If the printout is not re-checked before the
contract is signed, the victim might need a good lawyer. This attack works even if
the contract document was digitally signed and verified by a print server, because
the file itself remains untouched. The idea of manipulating purchase contracts with
PostScript is not new and has been mentioned in [Dü07] and [Cos12]. However, they
use conditional statements in a PostScript document to be viewed and interpreted on
the host, while we infect the printer itself and can launch the attack independently of
the document format as long as PostScript is used as a printer driver. In the prototype
implementation, the overlay and cross commands offer such functionality, which
is practically evaluated in Section 7.2.3.
19
5.3.2. Content Replacement
Even if an attacker can put an overlay above existing documents, she will not be able
to alter specific values in the original document unless its exact structure is known.
Sometimes we do not only want to add custom content, but to parse and replace parts
of the existing document. Especially replacing text seems to be an attractive function,
introducing new possibilities to the attacker as she can go for targeted manipulation or
randomly transpose digits and introduce misspellings. The replace command in the
prototype implementation offers such functionality which is evaluated in Section 7.2.3.
20
5.4.3. Print Job Disclosure
The most valuable data found on printers is print jobs themselves. Even in a digital
world, important documents are printed and kept as hard copies – if only because of for
legal reasons. In high security environments with encrypted hard disks and network
traffic, printers might be the weakest link in the security chain. However, even with
access to the file system of a printer device an attacker cannot retrieve print jobs unless
they have explicitly been stored. This is because print jobs are processed on-the-fly in
memory only and never touch the hard disk. In the following we will discuss legitimate
print job features retention and methods to actively capture documents to being printed.
Job Retention Some printers have stored print jobs accessible from the web server
(e.g., the HP DesignJet Z6100ps). This issue has been discussed by [Cre05]. Usually
however, job retention must be explicitly activated for a certain print job which can
be done using standard PJL commands or proprietary PostScript code. Jobs are then
kept in memory and can be reprinted from the control panel. Legitimate job retention
features are implemented in the hold command and practically tested in Section 7.2.4.
Job Capture It is possible but uncommon to activate job retention in the printing
dialog. With PostScript however, we have complete access over the current print job
as previously discussed and with the exitserver operator, we can break out of the
server loop and even access future jobs. Such functionality has the potential to capture
all documents if PostScript is used as a printer driver. In Section 7.2.4, we evaluate in
how far such an approach – implemented in the capture command – is feasible.
2
Heiland, D., Praeda – Automated Printer Data Harvesting Tool,
http://h.foofus.net/?page_id=218, Aug. 2016
21
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.
Besides information leaked from the embedded web server, printing languages offer
limited passwords protection mechanisms themselves. Breaking such mechanisms has
a priority in this work because – as stated – we focus 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 work. 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 [HP 97]. Brute-force attacks as proposed by
[FX 02] 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 [Ado99]. 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. An evaluation of brute-force attacks against PJL and
PostScript passwords is given in Section 7.2.5. In the prototype implementation, the
lock and unlock commands are used for setting and cracking passwords.
22
5.5.2. Firmware Updates
The dangers of malicious firmware updates are well-known and have been discussed
early by [ASK02] and [Tso06]. In contrast to other networked devices however, it is
assumed to be common for printers to deploy firmware updates as ordinary print jobs.
If this is confirmed it opens up a wide gateway for attackers because access to printing
functionality is usually a low hurdle. We can only speculate about the motivation for
such insecure design decisions but it seems logical that historic reasons play a role:
Printers used to be connected by parallel or USB cable. Without network connectivity,
security played a less important role and without a password-protected web server or
similar functionality the printing channel was the only way to send data to the device.
Firmware modification attacks against network printers have been demonstrated by
[CS11] for HP devices, by [Jor14] for the Canon PIXMA series and by [Hei11, WE16]
for various Xerox models as described in Chapter 3. As a countermeasure, vendors
started to digitally sign their firmware [HP 12]. The security of code signing is based
on keeping the private key a long-term trade secret. There are however potentially
still printers in the wild which are vulnerable to malicious firmware – either because
they have not yet been updated or because proprietary checksum algorithms are sold
as cryptographically secure digital signature schemes. It certainly must be pointed out
that analyzing firmware can be hard if vendors do not document their firmware formats
and update routines. Usually this requires some reverse engineering. As announced,
we will not conduct an in-depth analysis of printer firmware security in this work but
instead give a rough overview of firmware deployment procedures in Section 7.2.6.
3
Nuance Communications, Inc., NSi AutoStore, http://www.notablesolutions.com/
products/nsi-autostore/, Aug. 2016
23
6. Prototype Implementation
To automate most of the introduced attacks, we wrote a prototype software entitled
PRET ‘Printer Exploitation Toolkit’. Python1 was chosen as a programming language
because it allows rapid software development and easy access to TCP/IP sockets which
is required to communicate with targeted network printers. In this chapter, we will give
a survey of the program’s features and discuss implementation issues.
1
Python Software Foundation, Python, https://www.python.org/, Aug. 2016
24
The central printer class implements generic functions for device interaction and file
system access, independent from the concrete page description or job control language.
It inherits from the native Python module cmd.Cmd2 which ‘provides a simple frame-
work for writing line-oriented command interpreters’. A CLI was preferred over a
GUI or a web-based approach for reasons of simplicity and enhanced flexibility like
scripting as described in Section 6.1. The classes postscript, pjl and pcl which inherit
from the printer class implement language-specific functions like capturing PostScript
print jobs or disabling PJL disk locks. The output class handles console output while
the log and file classes implement helper functions to read from or write to local files.
The conn class adds functionality to connect to a printer device via TCP/IP sockets
or USB/parallel port. The fuzzer class contains hardcoded path traversal strategies
used for PostScript or PJL file system fuzzing. The capabilities class adds support for
printer language discovery via IPP, SNMP or HTTP as discussed in Section 6.2. The
codebook class contains a dictionary of PCL status codes while the const class holds
constants like UEL sequences (compare [HP 92]) to be used by printer and its sub-
classes. Last but not least, the pret class is responsible for calling the main program.
4 positional arguments:
5 target printer device or hostname
6 {ps,pjl,pcl} printing language to abuse
7
8 optional arguments:
9 -h, --help show this help message and exit
10 -s, --safe verify if language is supported
11 -q, --quiet suppress warnings and chit-chat
12 -d, --debug enter debug mode (show traffic)
13 -i file, --load file load and run commands from file
14 -o file, --log file log raw data sent to the target
2
Python Software Foundation, cmd — Support for line-oriented command interpreters,
https://docs.python.org/2/library/cmd.html, Aug. 2016
25
6.2. Printer Discovery
Before attacking a network printer, we need to make sure the unit in question actually
is a printing device and supports the chosen language. Otherwise, PostScript, PJL
or PCL commands sent to port 9100/tcp may be interpreted as plain text and simply
printed out. In the worst case, this means the whole attack process is logged on
hard copies which is neither in the interest of a malicious attacker whose goal is to
stay under the radar nor desired by a legitimate penetration tester who intends to
reduce garbage copies and disturbance of the targeted business. For this very reason,
vulnerability scanners like Nessus3 and OpenVAS4 tend to omit analyzing printers in
the default (non-destructive) configurations.5
In the prototype implementation, the --safe switch can be used to verify support for
the specified language prior to establishing a raw printing connection to port 9100/tcp.
Implementation details for printer discovery via IPP, SNMP and HTTP are documented
in the following sections. An overview of attributes used to identify the supported
languages and the printer model string is given in Table 6.1. Further protocols to
obtain the printer model string and capabilities include SLP [GP+ 99] and DNS-SD
[GVE00]. However, they have not been implemented for complexity reasons.
3
Tenable Network Security, Nessus Vulnerability Scanner,
http://tenable.com/products/nessus-vulnerability-scanner, Aug. 2016
4
Greenbone Networks GmbH, OpenVAS – Open Vulnerability Assessment System,
http://www.openvas.org/, Aug. 2016
5
OpenVAS ‘Do not scan printers’ NASL script enabled by default in ‘Full and fast’ scan configuration,
http://plugins.openvas.org/nasl.php?oid=11933, Aug. 2016
6
Kamppeter, T., Foomatic, http://openprinting.org/download/foomatic/, Aug. 2016
26
6.2.1. IPP
IPP can be used to request the printer-description attribute group as defined
in [H+ 00]. The IPP response contains an optional printer-info attribute, which
includes the printer model and supported languages. As we do not want to require any
third-party libraries for IPP communication, nor have ambitions to re-write a whole
implementation of the IPP protocol, a minimalist approach to quickly extract relevant
information was taken. With IPP based on HTTP, native Python modules could be
used to query IPP attributes via HTTP POST requests to http://printer:631/.
An example request for the printer-description attribute and the response
returned by an HP LaserJet 4250 printer is shown in Listing 6.2. The request was built
with the help of ipptool,7 an IPP test suite which is part of CUPS. Note that no IPP
queue name is used, which seems a reasonable default for most printers but might not
work for devices that require custom queue names.
Listing 6.2: IPP request and response for printer-description attribute group
6 > \x01\x01\x00\x0b\x00\x01\xab\x10\x01G\x00\x12attributes-charset
7 > \x00\x05utf-8H\x00\x1battributes-natural-language\x00\x02enE\x00
8 > \x0bprinter-uri\x00\x14ipp://localhost/ipp/D\x00\x14requested-at
9 > tributes\x00\x13printer-description\x03
10
16 < [...]CMD:PJL,MLC,PCLXL,PCL,PJL,POSTSCRIPT;
17 < [...]MDL:hp LaserJet 4250;CLS:PRINTER[...]
6.2.2. SNMP
SNMP is the default method implemented by CUPS to discover network printers.8
External access to SNMP services should be blocked by corporate firewalls, however,
if the SNMP service is accessible (e.g., internal penetration testing scenario) it can
be used to reliably enumerate device capabilities. To obtain a list of supported page
description languages, PRET requests the prtInterpreterDescription object
(OID 1.3.6.1.2.1.43.15.1.1.5) from the ‘Printer MIB’ [BML04]. If this MIB is not
supported by the device, the hrDeviceDescr object (OID 1.3.6.1.2.1.25.3.2.1.3)
from the ‘Host Resources MIB’ [GW93] is used to retrieve the printer model string
7
Sweet, M., ipptool manpage, http://www.cups.org/doc/man-ipptool.html, Aug. 2016
8
Sweet, M., Using Network Printers, http://www.cups.org/doc/network.html, Aug. 2016
27
which subsequently is looked up in the local language database. In our prototype
implementation, SNMP functionality requires the snimpy9 third-party Python module.
6.2.3. HTTP
Network printers usually bring their own embedded web server. The HTML title tag
often contains the product name which is extracted by PRET and simply matched
against the records in the in the database of supported languages. Note that while this
approach is less accurate than the ones mentioned before, chances for an attacker to be
able to access the HTTP(s) ports are potentially higher than for IPP/SNMP services.
6.3.1. PCL
Sending and receiving PCL data was implemented as follows. First we use the @PJL
ENTER LANGUAGE command to force the stream to follow being interpreted as PCL.
This is necessary in case automatic language switching is not available or has been
disabled. Finally, a random number is echoed as a delimiter to mark the end of the
response. As PCL allows only the echo of a single, signed 16bit integer, a random
number ranging from -256 to -32767 is used. The whole datastream is wrapped into
UEL sequences as shown in Listing 6.3. One major problem observed was heavy
packet fragmentation on some devices, which send back only two bytes per packet for
unknown reasons. This makes getting feedback from the printer a very slow process.
9
Bernat, V., snimpy Python module, https://pypi.python.org/pypi/snimpy, Aug. 2016
28
6.3.2. PJL
In PJL mode, commands are directly sent over the printing channel. Optionally, status
messages can be requested and parsed (see status command). A hardcoded string
concatenated with a random number ranging from 0 to 65535 is used as a delimiter.
One problem we decided to live with is that the delimiter – and the output of commands
in general – is sporadically returned in the wrong order by Brother devices. Prepending
the UEL at the beginning of each job causes some printers not to respond for unknown
reasons, therefore an UEL sequence is only appended at the end of each job. An
example PJL stream is shown in Listing 6.4. When connecting to a printer device for
the first time, the commands @PJL USTATUSOFF and @PJL SET TIMEOUT=255
are send to disable unsolicited status messages (compare [HP 97]) and make sure the
connection does not fail because of a low timeout value setting.
1 [...]
2 @PJL INFO ID (actual PJL commands)
3 [...]
4 @PJL INFO STATUS (optional status command)
5 @PJL ECHO DELIMITER7429 (echo random number)
6 \x1b%-12345X (UEL sequence)
6.3.3. PostScript
The @PJL ENTER LANGUAGE command is again used to force the datastream being
treated as PostScript. Optional I/O hack commands as explained below are followed
by the actual PostScript code. Equally to PJL, a hardcoded string concatenated with
a random number ranging from 0 to 65535 is used as delimiter. The whole print
job is wrapped into UEL sequences as shown in Listing 6.5. When connecting to a
printer device for the first time, the command << /DoPrintErrors false >>
setsystemparams is send to disable PostScript error messages to be printed.
29
While all tested devices responded directly to PCL and PJL commands, one challenge
was convincing as many printers as possible to respond to PostScript commands. There
are various language constructs to provoke feedback from a PostScript interpreter,
however not all did work out out on every printer. To test which technique works
on which model, we wrote a simple echo.ps PostScript file as show in Listing 6.6.
1 %!
2 ([1]) stack flush clear
3 (2) pstack flush clear
4 ([3]) = flush
5 (4) == flush
6 ([5]\n) print flush
7 (%stdout) (w) file ([6]\n) writestring flush
8 (%stderr) (w) file ([7]\n) writestring flush
Results are show in Table 6.2. Note that some devices did not give any feedback over
port 9100/tcp at all while the commands were actually interpreted and it was possible to
print their output on hard copies if printing functionality was not mechanically broken.
A list of covert channels – in case no feedback is available – is given in Section 7.2.4.
Table 6.2.: Results of the feedback test, based on the commands in Listing 6.6
30
This logically lead to using technique [6] for receiving command feedback. It turned
out however that some devices like the Kyocera FS-C5200DN had problems with this
method. The output was inconsistent, sometimes crippled and never exceeded a bunch
of lines. Therefore we finally came to the conclusion that the best way is to first check
if output via methods [4] and [5] work on the connected device, else redefine the
== and print operators with the ‘I/O hack’ as shown in Listing 6.5.
31
File system functions While an implementation for PJL file system access was
provided by [FX 02] we are not aware of any software to exploit comparable PostScript
functions on a printer. PCL has no functionality to access the file system. As a bonus
implementation however, we built a virtual file system which uses PCL macros to save
file content and metadata in the printer’s memory. With this proof-of-concept, we show
that even a device which supports only minimalist page description languages like
PCL can be used to store arbitrary files like copyright infringing material. Although
such a file sharing service is not a security vulnerability per se, it might apply as
‘misuse of service’ depending on the corporate policy. An overview of implemented
commands for file operations and supported printer languages is given in Table 6.3.
To ensure consistency, command names are identical, independent of the underlying
implementation for each language. The usage is similar to a command line FTP client
and should be familiar to everyone used to work in the console. Each command usually
launches the procedure shown in Listing 6.3, Listing 6.4 or Listing 6.5 with a different
payload and parses the response. Describing all supported commands in detail would
be very extensive and go beyond the scope of this work. Hence we focus on commands
relevant to the proposed attacks and for further information refer to the documentation
and source code which can by found at https://github.com/RUB-NDS/PRET.
32
The implementation of ls, get and put for PostScript and PJL is documented in
Section 7.2.4. To get file sizes and dates, the PostScript status operator is used.
To recursively download all files, functionality for listing directories and retrieving
files is combined in the mirror command. The append and delete commands
should be self-explanatory and can easily be mapped to corresponding functionality in
PostScript and PJL while rename is solely available in PostScript. The touch and
mkdir commands create empty files and directories while chvol sets the current
volume. For PJL this is 0: by default while we use %*% for PostScript, meaning any
available disk. Existing volumes and disks can be listed with df which is implemented
using the devstatus operator for PostScript and @PJL INFO FILESYS for PJL.
The cd and the traversal commands change the current working directory on the
printer device. In this context, fuzz is relevant which systematically tests for path
traversal strategies based on various hardcoded strings like file:///, $HOME or
../ to combine and test for. This way, we attempt to find flaws in PostScript and
PJL interpreters which sandbox file system access to a certain directory. Once a path
traversal strategy is found, it can set and automatically prepended to all file operations
using the traversal command. While not used in this work, it is noteworthy to
mention that disks can be re-initialized with PostScript (initializedisk) and PJL
(@PJL FSINIT) which is implemented for both languages as the format command.
33
7. Evaluation
AM1 and AM2 A local attacker has the capability to print documents from USB
stick or via USB/parallel cable. A network attacker can deploy print jobs over LPD,
IPP, port 9100/tcp, FTP, SMB and the embedded web server. Under the assumption
that no strong user authentication like smart card based access control or SSL client
34
certificates is enforced, both attacker models do obviously have a channel to print
which is the precondition for further attacks to be carried out. Both, AM1 and AM2,
are certainly quite strong because they require direct access – either physical or logical
– to the device. However, in penetration testing scenarios where sneaking into the
building is not an option and the printer is not directly reachable over the internet,
other deployment channels are required. In such cases, the victim’s web browser can
be used as a carrier for printer malware as discussed below.
AM3 Cross-site printing (XSP) attacks empower a web attacker to access the printer
device as demonstrated by [Wea07] who use a hidden Iframe to send HTTP POST
requests to port 9100/tcp of a printer within the victim’s internal network. The HTTP
header is either printed as plain text or discarded based on the printer’s settings. The
POST data however can contain arbitrary print jobs like PostScript or PJL commands
to be interpreted. In the following, we adapt and improve the idea of cross-site printing.
In such an enhanced variant of XSP – combined with CORS spoofing – a web attacker
has full access to the HTTP response which allows her to extract arbitrary information
like captured print jobs from the printer device. A schematic overview of the attack is
given in Figure 7.1. A proof-of-concept JavaScript snipplet is shown in Listing 7.1.
35
Listing 7.1: Advanced cross-site printing with CORS spoofing
1 job = "\x1B%-12345X\r\n"
2 + "%!\r\n"
3 + "(HTTP/1.0 200 OK\\n) print\r\n"
4 + "(Server: PostScript HTTPD\\n) print\r\n"
5 + "(Access-Control-Allow-Origin: *\\n) print\r\n"
6 + "(Connection: close\\n) print\r\n"
7 + "(Content-Length: ) print\r\n"
8 + "product dup length dup string cvs print\r\n"
9 + "(\\n\\n) print\r\n"
10 + "print\r\n"
11 + "(\\n) print flush\r\n"
12 + "\x1B%-12345X\r\n";
13
Note that PCL as page description language is not applicable for CORS spoofing
because it only allows one single number to be echoed. PJL likewise cannot be used
because unfortunately it prepends @PJL ECHO to all echoed strings, which makes
it impossible to simulate a valid HTTP header. This however does not mean that
enhanced XSP attacks are limited to PostScript jobs: PostScript can be used to respond
with a spoofed HTTP header and the UEL can further be invoked to switch the printer
language. This way a web attacker can also obtain the results for PJL commands.
Two implementation pitfalls exist which deserve to be mentioned: First, a correct
Content-Length for the data to be responded needs determined with PostScript.
If the attacker cannot predict the overall size of the response and chunked encoding
as well is not an option, she needs to set a very high value and use padding. Second,
adding the Connection: close header field as shown in Listing 7.1 is important,
otherwise HTTP/1.1 connections are kept alive until either the web client or the printer
device triggers a timeout, which means the printer will not be accessible for some time.
If the printer device supports plain text printing the HTTP request header of the XHR
is printed out as hard copy – including the Origin header field containing the URL
that invoked the malicious JavaScript, thus making it hard for an attacker to stay silent.
This is unavoidable, as we do not gain control over the printer – and under some
circumstances can disable printing functionality – until the HTTP body is processed
and the HTTP header has already been interpreted as plain text by the printer device.
If reducing noise is a priority, the attacker can however try to first disable printing
functionality with proprietary PJL commands as proposed in Section 5.1.3 using other
potential XSP channels like IPP, LPD, FTP or the printer’s embedded web server.
36
While all protocols could successfully be tested to deploy print jobs using variants of
cross-protocol scripting as described by [Top01, Alc07] they have some drawbacks
beyond not providing feedback using spoofed CORS headers:
• Cross-protocol access to LPD and FTP ports is blocked by various web browsers
• Parameters for direct printing over the embedded web server are model-specific
• The IPP standard requires the Content-type for HTTP POST requests being
set to application/ipp [Her00] which cannot be done with XHR objects –
it is however up to the implementation to actually care about incorrect types
One major problem of XSP is to find out the correct address or hostname of the printer.
Our approach is to abuse WebRTC [BBJ12] which is implemented in most modern
browsers and has the feature to enumerate IP addresses for local network interfaces.
Given the local IP address, XHR objects are further used to open connections to port
9100/tcp for all 253 remaining addresses to retrieve the printer product name using
PostScript and CORS spoofing which only takes seconds in our tests. If the printer
is on the same subnet as the victim’s host its address can be detected solely using
JavaScript. WebRTC is in development for Safari and supported by current versions of
Firefox, Chrome and Microsoft Edge. Internet Explorer has no WebRTC support, but
VBScript and Java can likewise be used to leak the local IP address. If the address of
the local interface cannot be retrieved, we apply an intelligent brute-force approach:
We try to connect to port 80 of the victim’s router using XHR objects. For this, a
list of 115 default router addresses from various internet-accessible resources was
compiled. If a router is accessible, we scan the subnet for printers as described before.
37
7.2. Printer Exploitation
In the following we evaluate attacks against network printer devices covering denial of
service, privilege escalation, print job manipulation, information disclosure and remote
code execution as discussed on a theoretical level in Chapter 5.
A more advanced version of this DoS attack which sets a higher timeout as proposed
by [The12] is shown in Listing 7.3. While the PJL reference specifies a maximum
timeout of 300 seconds [HP 97], in practice we have seen maximum PJL timeouts
ranging from 15 to 2147483 seconds. Hence, this value is first retrieved from the
printer and then set in all further connections. The advantage of this approach is that
the number of connections for an attacker to make is minimized while it is even harder
for legitimate users to gain a free time slot (race condition) to deploy a print job.
2
Hobbit, Netcat – TCP/IP Swiss Army Knife, http://nc110.sourceforge.net/, Aug. 2016
38
Note that even print jobs by other printing channels like IPP or LPD are not processed
anymore as long as the connection is kept open. For any of the test printers, this simple
DoS attack can be performed by a network attacker (AM2) and a web attacker (AM3)
as long as the website used to enforce XHR connections to port 9100/tcp is kept open.
Infinite loop One trivial and well-known (compare [Hol88]) example of an infinite
loop written in PostScript is shown in Listing 7.4. This minimalist document keeps a
PostScript interpreter busy forever. In our pool of test printers, only the HP LaserJet
M2727nf had a watchdog mechanism and restarted itself after about 10 minutes. The
other devices did not accept print jobs anymore until we ultimately interrupted the test
after half an hour. The malicious print job could in most cases manually be canceled
from the control panel while some devices required a manual restart. In contrast to
blocking the transmission channel as discussed earlier, the connection can be closed
immediately after the PostScript code has been sent. We tried to built a similar loop
using a PCL macro which calls itself, however the PCL standard [HP 92] allows only
two levels of nesting which was correctly followed by all tested devices.
1 %!
2 {} loop
PJL jobmedia Furthermore, proprietary PJL commands3 can be used to set the
printer device into service mode and completely disable all printing functionality as
shown in Listing 7.6. In our test printer pool however, only the HP LaserJet 4200N
and the HP LaserJet 4250N support those PJL commands and refuse to print.
3
Hewlett-Packard, The German Laserweb Vers. 4.0, http://www.icareasc.com/ICareKM/
University/TrainingMaterial/TheGermanLaserweb/, Aug. 2016
39
Listing 7.6: PJL service mode
Offline mode In addition, the PJL standard defines the OPMSG command which
‘prompts the printer to display a specified message and go offline’ [HP 97]. This can
be used to simulate a paper jam as shown in Listing 7.7 and is implemented in various
printer models by different manufacturers. All devices can however be easily brought
to accept jobs again by manually pressing the online button on the control panel.
A summary of devices in our test printer pool vulnerable to document processing based
DoS attacks is given in Table 7.3. Note that printing mechanics are physically broken
on some of the donated devices (marked with ‘n/a’) on which we obviously could not
perform any tests which require printing a document.
40
Physical damage For a practical test to destroy NVRAM write functionality as
described in Section 5.1.4 we continuously set the long-term value for the number of
copies by sending @PJL DEFAULT COPIES=X with different values for X in a loop.
Within 24 hours and millions of values set, eight devices indicated a corrupt NVRAM:
The Brother MFC-9120CN, the Brother DCP-9045CDN and the Konica bizhub 20p
showed error code E6 (EEPROM error), but everything worked fine after a reboot.
The Lexmark E360dn and the Lexmark C736dn became unresponsive and showed error
code 959.24 (EEPROM retention error). After a restart, both devices recovered but
only accepted between a dozen and several hundreds of long-term values to be set until
the same behaviour could be observed again. The Dell 5130cdn, the Dell 1720n and
the HP LaserJet M2727nfs completely refused to set any long-term values anymore.
The impact of such physical NVRAM destruction however is limited for two reasons:
First, contrary to our assumption in Section 5.1.4, NVRAM parameters are 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 @PJL SET... command. Only the functionality to change
long-term settings was broken. Note that the advanced age of some devices may have
influenced the experiment because the NVRAM was not completely new anymore.
Also note that this test was chronologically performed last, after all other attacks.
1 /counter 0 def
2 { << /Password counter 16 string cvs
3 /SystemParamsPassword counter 1 add 16 string cvs
4 >> setsystemparams /counter counter 1 add def
5 } loop
For PostScript, most system parameters were not persistent after a restart – apparently
they were not stored in NVRAM. However passwords as discussed in Section 5.4.4
survived a reboot and can even be incremented and set in a loop as shown in
Listing 7.8. It can be assumed that this is exactly what the original PostScript malware
from 1990 mentioned in [Har00] did. However, this attack to exhaust the NVRAM
was not successful on any of the tested devices. Either NVRAM settings were not
directly saved or the NVRAM could simply tolerate a large number of write cycles.
The proposed attacks can only be performed by a network attacker (AM2), who has
the capability to establish various connections over a longer period of time. In AM1
the attacker only has access to the device for a limited amount of time but sending a
continuous datastream of for about 24 hours hours is required.4 However, she can use
an axe or a hammer to cause physical damage. In AM3 the victim would have to keep
an attacker-controlled web site open for hours which is also considered unrealistic. 5
4
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.
5
Unless you find XSS on Facebook, in which case the impact of broken printers may be negligible.
41
7.2.2. Privilege Escalation
Factory defaults Resetting a printer device to factory defaults to bypass protection
mechanisms as proposed in Section 5.2.1 is trivial for a physical/local attacker (AM1).
All tested printers (see Table 4.1) have documented procedures to perform a cold
reset by pressing certain key combinations or setting a jumper. For network attackers
(AM2) and web attackers (AM3), things are more complicated as discussed below.
In many scenarios an attacker does not have the capabilities to perform SNMP requests
because of firewalls or unknown SNMP community strings. On HP devices however,
she can transform SNMP into its PML representation and embed the request within a
legitimate print job as demonstrated by [Cos10] to restart HP printers. The device can
even be reset to factory defaults as shown in Listing 7.10 which removes all protection
mechanisms like user-set passwords for the embedded web server, PJL and PostScript.
42
PML and PostScript based attacks can be performed in AM1, AM2 and AM3 because
they are deployed over the printing channel while SNMP is available solely in AM2.
LPRng and CUPS both offer SSL based channel encryption and secure authentication
schemes like Kerberos [SNS88], PGP [Zim95] signed print jobs or HTTP basic/digest
43
authentication [FHBH99]. 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 we have not seen them implemented in the
print servers used by various chairs and computer pools at the University of Bochum.
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: 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.
For correct accounting the number of printed pages must be determined by the printing
system which is not a trivial task as discussed in [Deu11]. 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’.6 Such hardware page counters
are supported by most printers in our test pool and read by LPRng using PJL after every
print job. HP has even documented a feature to write to the page counter variable
[HP 99]. 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 as shown in Listing 7.12. 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 (2342).
1 \x1b%-12345X@PJL JOB
2 This page was printed for free
3 \x1b%-12345X@PJL EOJ
4 \x1b%-12345X@PJL JOB
5 @PJL SET SERVICEMODE=HPBOISEID
6 @PJL SET PAGES=2342
7 \x1b%-12345X@PJL EOJ
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 as previously discussed 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.
6
Powell, P., Printer Accounting Reality Check http://web.mit.edu/ops/services/print/
Attic/src/doc/LPRng-HOWTO-15.html, Sep. 2016
44
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
in Listing 7.13. 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.
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.
45
PostScript files generated by GIMP7 which instead of strings creates raster graphics of
their representation. The same issue occurs for any document format – even PostScript
itself – when processed by CUPS. Theoretically such language constructs could also
be parsed, this would however go beyond the scope of this work. Content replacements
attacks can be carried out in AM1, AM2 and AM3. A an overview of tested printers is
given in Table 7.6. Devices with broken printing mechanics are listed as ‘n/a’.
46
DNS Backchannel If an attacker has code execution on the printer as discussed in
Section 5.5, she can make her own TCP/IP connections back to an attacker-controlled
C&C server. The communication can be hidden in arbitrary protocols like outbound
HTTP(s) requests. If the printer is restricted to the local network – either because it has
no route to the internet or outbound connections are blocked by a firewall – it might
still be able to perform outbound DNS lookups over a local nameserver as discussed in
[NNR09]. While such DNS backchannels are not printer-specific, they deserve to be
mentioned as one way to leak sensitive information if the attacker controls the device.
8
@0x00string, HP Laser Jet - JavaScript Persistent Cross-Site Scripting via PJL Directory Traversal,
https://www.exploit-db.com/exploits/32990/, Sep. 2016
9
Electronic Frontier Foundation, Is Your Printer Spying On You?,
https://w2.eff.org/Privacy/printers/, Sep. 2016
47
Memory access We were not able to reproduce memory dumping using PostScript
as touched upon in Section 5.4.1, because we are not in possession of Xerox devices.
But the Brother MFC-9120CN, the Brother DCP-9045CDN and the Konica bizhub 20p
are vulnerable to arbitrary NVRAM access using PJL as shown in Listing 7.14, where
X is an integer, incremented in our prototype implementation to dump the NVRAM.
This leads to disclosure of embedded web server passwords by a local attacker (AM1),
a network attacker (AM2) or a web attacker (AM3). Furthermore – if set – user PINs,
passwords for POP3/SMTP as well as for FTP and Active Directory profiles can be
obtained. For MFPs, the attacker can change the Scan-to-FTP settings so scanned
documents are delivered to an attacker-controlled FTP server or she can exchange fax
numbers in the address book whereby fax is sent to the attacker’s fax number instead.
File system access To evaluate PostScript and PJL implementations for access
to the file system as discussed in Section 5.4.2, we implemented the functionality in
PRET according to the standards [Ado99, HP 97] and tested it against the printer pool.
48
Listing 7.15: File system access with PostScript
PJL Of the tested devices only five allow file system access with PJL commands.
The HP LaserJet 4200N, the HP LaserJet 4250N and the Konica bizhub C454e are
prone to path traversal attacks which is well known for both HP LaserJets and has
been discussed in [CVE10]. The countermeasure proposed by HP is to enable disk
lock which can easily be broken as discussed in Section 7.2.5. An example for PJL file
system access on the HP LaserJet 4200N is given in Listing 7.15.
Listing 7.16: File system access with PJL
On the Konica bizhub C454e we were able to get a list the contents of the root direc-
tory – which is a typical Linux file system – but not to actually access any files. One
interesting file which can be read and written is /../sysdata/acc/job.csv,
which contains logged print job metadata, including document titles and usernames.
49
The ‘hidden’ directory on the OKI MC342dn does not appear in PJL directory
listings, however it can be accessed as in PostScript once the name is known. The HP
LaserJet 4250N contains a file named /webServer/config/soe.xml which
hold the password to a user-set email account for sending/receiving status information.
An overview of file system access in PostScript and PJL implementations within our
pool of test printers is given in Table 7.7. The sign indicates that access to the whole
file system is allowed while ( ) means that access is sandboxed to a certain directory.
Devices which did not return any PostScript feedback and where results could not
be printed because of mechanically broken printing functionality are listed as ‘n/a’.
Attacks can be performed in AM1, AM2 and AM3 and included in ordinary print jobs.
Job retention Legitimate job retention can be enabled for the current document
by setting the PJL HOLD variable (see [HP 97]). An example is given in Listing 7.17.
50
Listing 7.17: PCL command to hold the current print job
Hold jobs are kept in memory and can be reprinted from the printer’s control panel
which is accessible only by a local attacker (AM1). This feature is supported by the
HP LaserJet 4200N, the HP LaserJet 4250N and the Samsung MultiPress 6345N.
PostScript offers similar functionality which however is model- and vendor-specific.
For the HP LaserJet 4200N and the HP LaserJet 4250N, job retention can be enabled
by prepending the commands shown in Listing 7.18 to a PostScript document.
Job capture With the capability to hook into arbitrary PostScript operators as shown
in Section 7.2.3 it is possible to manipulate and access foreign print jobs. To parse
the actual datastream send to the printer, we apply an idea based on the debug.ps10
project: Every line to be processed by the PostScript interpreter can be accessed by
reading from the %lineedit special file [Ado99]. This can be done in a loop to line
by line retrieve the content of printed documents. Each line can further be executed
using the exec operator and appended to a file. This method however only worked
for few devices in our test printer pool and for unknown reasons lines started to get
crippled at random on larger print jobs. We therefore searched for a technique to
store print jobs independent of support for file operations and came to the conclusion
to use permanent dictionaries. This approach is very generic but also has some
drawbacks: All code – even from normal print jobs – runs outside of the PostScript
server loop which means all introduced language constructs and definitions are made
permanent. This behaviour is not desirable and may fill up the memory in the long run.
One practical problem was to decide which operator should be hooked as we do
not gain access to the datastream until this operator is processed by the PostScript
interpreter and our own code is executed. As we want to capture print jobs from the
very beginning our redefined operator must be the very first operator contained in the
PostScript document. Fortunately all documents printed with CUPS are pressed into
a fixed structure beginning with currentfile /ASCII85Decode filter.
10
Joshua Ryan, M., debug.ps – A portable source-level debugger for PostScript programs,
https://github.com/luser-dr00g/debug.ps, Sep. 2016
51
Based on the assumption of such a fixed structure we can overwrite currentfile to
invoke exitserver and filter to finally start the capture loop. For other printing
systems this attack should also be possible, but operators need to be adapted. Note that
the PostScript header which usually includes media size, user and job names cannot
be captured using this method because we first hook into at the beginning of the actual
document. A complete code listing to capture future print jobs is given in Listing A.1
in the appendix. This vulnerability has presumably been present in printing devices for
decades as solely language constructs defined by the PostScript standard are abused.
To evaluate this attack, we infected all devices in the test printer pool with the
PostScript malware and printed the first ten pages of [Ado99] which is available as PDF
document. All devices except Brother-based printers and the Kyocera FS-C5200DN
which throws a PostScript syntax error message are vulnerable as shown in Table 7.8.
The Dell 3110cn, the Samsung MultiPress 6345N and the Samsung CLX-3305W could
not be tested as they do not allow PostScript feedback. This attack can be carried out
in AM1, AM2 and AM3 because only the capability to print is required.
52
7.2.5. Credential disclosure
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 Listing 7.19 is the defense mechanism propagated by HP
against PJL file system access, including known path traversal vulnerabilities [HP 10].
PJL passwords however are vulnerable to brute-force attacks because of their limited
16 bit key size as demonstrated by [FX 02] 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 [HP 97], 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 Table 7.9.
The attack can be carried out in AM1, AM2 and AM3. 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. Note that while PJL
passwords could be set on various devices, actual disk lock and/or control panel lock
was only supported by the HP LaserJet 4200N, the HP LaserJet 4250N, the Brother
MFC-9120CN and the 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. Non-compliant with the PJL standard, the Brother MFC-9120CN, the
Brother DCP-9045CDN and the Konica bizhub 20p do not verify the password to lock
or unlock the control panel, rendering it practically useless.
53
Listing 7.20: PostScript password brute-force
Results are given in Table 7.9. 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 RIP is highly optimized for fast processing of
PostScript code. The Brother MFC-9120CN, the Brother DCP-9045CDN and the
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 Samsung CLX-3305W and the 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 Kyocera FS-C5200DN does not support permanent PostScript passwords.
54
7.2.6. Remote Code Execution
In the following we evaluate the risk of buffer overflows in network printers and docu-
ment firmware updates procedures as well as software platforms for the major vendors.
3 > 02 6c 70 0a .lp.
4 < 00 .
5 > 02 31 35 32 20 63 66 41 30 30 31 0a .152 cfA001.
6 < 00 .
7 > 4c 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 Lxxxxxxxxxxxxxxx
8 > 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx
9 > 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx
10 > 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx
11 > 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx
12 > 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx
13 > 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx
14 > 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx
15 > 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx
16 > 78 78 78 78 78 78 78 0a 00 xxxxxxx..
This vulnerability potentially leads to remote code execution, given correct shellcode
and return address. This is particularly dangerous on embedded devices, as they may
have no protection mechanisms against buffer overflows like ASLR or user separation,
so all executed code is run as superuser. However, writing custom shellcode would
exceed the scope of this work. Therefore we are not going deeper into this issue and
leave it as proof-of-concept for an effective denial of service attack. The attack can be
carried out by a network attacker (AM2). A web attacker (AM3) can only exploit this
flaw if cross-protocol scripting to port 515/tcp is allowed by the web browser. This
could be successfully tested with the Internet Explorer 10. Other popular browsers
however block access to the LPD port by default as shown in Table 7.2.
55
Firmware updates To give an overview of firmware deployment procedure as
announced in Section 5.5.2 we downloaded and systematically categorized 1,400
firmware files for the top 10 printer manufacturers. Furthermore, we contacted each
customer support and asked for information concerning protection mechanisms against
firmware modification attacks. The results are as follows. A summary of file headers
or types for all obtained firmware files is given in Table A.5 in the appendix.
11
Karwath, A., UNP executable file restore utility, http://unp.bencastricum.nl/, Sep. 2016
12
Heffner, C., Binwalk firmware analysis tool, http://binwalk.org/, Sep. 2016
56
Brother Firmware cannot be easily downloaded. Instead a Windows binary needs to
be run which checks for available printers and requests download links for the latest
firmware from a web service. By guessing correct parameters, we were able to get
the links for 98 files. Firmware files do not need to be unpacked as they already
come in raw format. 79 files have the extension .djf and contain @PJL EXECUTE
BRDOWNLOAD while nine .blf files contain @PJL ENTER LANGUAGE=PCL. We
were unable to find publicly available information on protection mechanisms and did
not get a valid response from customer support regarding this topic.
57
back to 2007, Ricoh claims that ‘only service technicians have a password and dedi-
cated account for making firmware updates’ [Cor07].
Konica Minolta Although not actively promoted, firmware can be downloaded from
http://download6.konicaminolta.eu. Newer internet-connected devices
have the capability to perform firmware updates themselves. Compressed files come
in different formats and can be unpacked using unp, unzip and tar which results in
38 proprietary .bin files, 20 PostScript based ‘softload printer modules’ for older
devices and 14 files of different extensions containing PJL commands like @PJL
ENTER LANGUAGE=FIRMUPDATE. The Konica Minolta security whitepaper claims
that firmware is verified using a ‘hash value’ [Kon14]. It may be doubted that such a
scheme is cryptographically secure, however we did not perform a further analysis.
Results Out of ten analyzed manufacturers, nine use PJL commands for all or at
least some of their firmware update procedures which is a strong indicator that up-
dates are deployed as ordinary print jobs. The remaining manufacturer – Kyocera –
applies the PRESCRIBE page description language. We can therefore claim that it
is common in the printing industry to install new firmware over the printing channel.
This corresponds with our observations made when updating the firmware in the test
printer pool: A network traffic analysis showed that all updates were performed over
port 9100/tcp which is a potential security risk and can be exploited in AM1, AM2
and AM3 if modified firmware was accepted by the printer device. We can therefore
name a major design flaw present in almost any printer device: data and code over the
same channel. It is however out of the scope of this work to make a reasoned state-
ment on the individual manufacturers’ protection mechanisms. An in-depth analysis
of firmware modification attacks should be part of future work.
13
Quinlan, D., cramfs, http://sourceforge.net/projects/cramfs/, Sep. 2016
14
Lougher, P. and Lougher, R., squashfs, http://squashfs.sourceforge.net/, Sep. 2016
58
Software packages In the following we give a rough outline on the software plat-
forms provided by major printer vendors to extend functionality of their devices as
announced in Section 5.5.3.
Xerox/Dell (EIP) The ‘Extensible Interface Platform’ (EIP) [Bis16] was announced
in 2006 by Xerox for various MFPs. The architecture – which is also supported by a
few rebadged Dell devices – is based on web services technology. The SDK is freely
available for registered developers, however not supported by any of our test printers.
Lexmark (eSF) The ‘Embedded Solution Framework’ (eSF) was launched in 2006
for Lexmark MFPs. The SDK to develop Java applications is reserved for ‘specially
59
qualified partners’. According to [Lex13] ‘these applications must be digitally signed
by Lexmark before being adopted’ using 2048-bit RSA signatures (compare [RSA78]).
Sharp (OSA) The ‘Open Systems Architecture’ (OSA) [Sha09] was announced by
Sharp in 2004. The SDK used to develop web services is fee-based and applications
need to be validated by Sharp before they can be installed on an MFP.
Oki (sXP) The ‘smart eXtendable Platform’ (sXP) [NI16] which is based on web
services was launched by Oki Data in 2013 for their MFP devices. We could not find
any information regarding an official developer program or publicly available SDK.
Results The only printers in our test pool that have support for custom software and
for which an SDK could be obtained are the HP LaserJet 4200N and the HP LaserJet
4250N. On both devices arbitrary Java bytecode can be executed in AM2 and with
drawbacks also in AM3 as previously described. Security is based on the password
of the embedded web server which can be easily readout with PostScript or bypassed
by restoring factory defaults. We cannot make a reasoned statement on the security of
other software platforms because of lacking access to the SDK and/or proper technical
documentation. A comparison of platforms, applied technologies and – where known
– software package deployment procedures is shown in Table 7.10.
60
Vendor Platform Embedded Java Web services Deployment
HP Chai/OXP web server
Xerox/Dell EIP ?
Canon MEAP ?
Brother BSI ?
Lexmark eSF ?
Samsung XOA web server
Ricoh ESA ?
Kyocera/Utax HyPAS USB drive
Konica Minolta bEST ?
Toshiba e-Bridge ?
Sharp OSA ?
Oki sXP ?
Firmware vs. Software From an attacker’s point of view software packages differ
from traditional firmware updates in many ways. A comparison is given in Table 7.11.
One advantage of software platforms is a well documented, high-level programming
language which can be used to write malicious code – provided the attacker gains
access to the SDK. On the downside, support for firmware updates is currently still
broader than it is for ‘printer apps’ which are often limited to high-end MFPs, which
means less potential targets. Furthermore, as shown in Table 7.10 software applications
are deployed over the embedded web server or USB instead of the printing channel
which narrows down the attack surface. Last but not least while firmware by definition
has full control over the device, software applications can be given limited rights like
access to pre-defined APIs only which lowers the potential impact of printer malware.
61
Attack Category Attack Violation of security goal AM#
Print spooler queue Availability (queue) 1/2/3
Transmission channel Availability (daemon) 2/3
Denial of service
Document processing Availability (RIP) 1/2/3
Physical damage Availability (nvram) 2
Privilege Factory defaults Authenticity (admin) 1/2/3
escalation Accounting bypass Accountability (users) 1/2/3
Content overlay Integrity (print jobs) 1/2/3
Job manipulation
Content replacement Integrity (print jobs) 1/2/3
Memory access Confidentiality (memory) 1/2/3
Information File system access Confidentiality (files) 1/2/3
disclosure Print job disclosure Confidentiality (print jobs) 1/2/3
Credential disclosure Confidentiality (credentials) 1/2/3
Buffer overflows Dependent on shellcode 2/3
Code execution Firmware updates Dependent on firmware 1/2/3
Software packages Dependent on software 2/3
62
Wastepaper might also be a vital source for forensics as it may contain hard copies
of the course of the attack – either for unsuccessful attacks where data is sent to the
printer device and printed as plain text instead of being interpreted or PostScript error
messages or printouts of HTTP headers which are traces of a web attacker and even
contain the URL of the website that launched the attack via the Origin header field.
Extracting the printer malware itself may be hard if it remains only in volatile memory
like PostScript dictionaries. As soon as the device is turned off, all traces are destroyed.
Hence, live acquisition of digital evidence is essential. The dictionary dumper as noted
in Section 6.4 can be used to detect PostScript malware. Note however that PostScript
malware can seal and hide itself if deployed first by redefining the functions which
try to list it. The concepts are quite similar to those of protecting from malicious
JavaScript as discussed in the JSAgents project [HNS15]. If the firmware itself is
infected, it is hard to get rid of because new firmware updates can simply be blocked by
the malicious firmware as discussed in [CS11]. In this case the only practical solution
would be to throw the printer away.
15
Adobe Systems, Distiller, http://www.adobe.com/support/distiller/, Sep. 2016
16
Artifex Software, Inc., Ghostscript, http://www.ghostscript.com/, Sep. 2016
17
Artifex Software, Inc., How to use Ghostscript, http://www.ghostscript.com/doc/
current/Use.htm#Safer, Sep. 2016
63
because clickable hyperlinks are not supported by PostScript. A proof-of-concept
file named leaks-url.ps is included in the prototype implementation. It was
tested with Evince18 and GSview19 which are the default applications to display
PostScript files on most Linux distributions and on Windows. Both applications
use Ghostscript to process the file. If a Linux host is attacked, the file extension
can be changed to .pdf as Evince is also invoked for handling PDF files which
might be considered as a less suspicious file type when received for example via email.
Another method to leak sensitive data is by hiding it as printer error messages or en-
coding it as hardly visible yellow dots as described in subparagraph 7.2.4. When the
document is printed out, the attacker can reconstruct the stenographic data if she gains
access to a hard copy – for example by being the first in the copy room and taking pho-
tographs or by ransacking garbage cans on the hunt for thrown away sheets containing
‘just some weird error messages’. Another scenario is combining the attack with print
job capturing as described in Section 5.4.3, which allows even a web attacker to com-
fortably obtain the printed document containing hidden, sensitive data. All she needs
to do is convince the victim to print a PostScript file. This attacks works on systems
where the document is interpreted on the host and then – including the encoded host
files – converted into to a language spoken by the printer – which in some cases can
be PostScript again. It was successfully tested on CUPS (Linux, OS X) and the Win-
dows printing architecture while it failed on LPRng (UNIX) which does not convert
the file if PostScript is spoken directly by the printer. A proof-of-concept file named
leaks-err.ps which uses ASCII codes to embedded error messages containing a
directory listing is included in the prototype implementation.
18
The GNOME Project, Evince, https://wiki.gnome.org/Apps/Evince, Sep. 2016
19
Lang, R., GSview, http://pages.cs.wisc.edu/~ghost/gsview/, Sep. 2016
64
8. Countermeasures
Most of the presented attacks 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 we cannot come up with a 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 as discussed in the following. A comparison of the
major actions to take for the detection and prevention of attacks is given in Table 8.1.
Employees should be trained to never leave the copy room unlocked and report
suspicious printouts like HTTP headers to the administrator. All other dispensable
hard copies should be shred, even if they apparently do not contain confidential data.
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 VLAN, only accessible by a hardened print
server as proposed by [Cos12]. 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 IDS/IPS. Note however that such signature-based approaches are
doomed to fail for PostScript which offers various code obfuscation techniques.
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, we have the impression that 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.
65
Category Attack Detection Prevention
Print spooler queue Print job counter Balanced spooling
Transmission channel IDS signatures Parallel processing
Denial of service
Document processing (IDS signatures) Watchdog timers
Physical damage (IDS signatures) NVRAM caching
Privilege Factory defaults IDS signatures SNMP passwords
escalation Accounting bypass (IDS signatures) PostScript filter
Content overlay Dictionary dump Startjob password
Job manipulation
Content replacement Dictionary dump Startjob password
Memory access IDS signatures Patch from vendor
Information File system access IDS signatures Patch from vendor
disclosure Print job disclosure Dictionary dump Startjob password
Credential disclosure (IDS signatures) Larger key sizes
Buffer overflows IDS signatures Patch from vendor
Code execution Firmware updates IDS signatures Digital signatures
Software packages IDS signatures Digital signatures
Code signing however also means technically restricting users to run vendor software1 .
Certainly there are legitimate reasons to execute custom code on a printer. An example
has been given by [Wae05] who extended HP LaserJets to support load-balancing. The
OpenWrt2 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.
66
9. Conclusion
In this work, we demonstrated how to practically exploit network printers and MFPs
from various manufacturers. It can be considered as basic research in printer security.
Denial of service attacks ranging from infinite loops in documents to permanent phys-
ical damage to the NVRAM could be successfully performed using legitimate PJL
commands. We showed that protection mechanisms like printer passwords can be
bypassed by resetting the device to factory defaults through print jobs themselves.
We discussed simple, yet effective methods to circumvent accounting systems with
PostScript conditional statements and analyzed the feasibility of brute-force attacks
against PJL and PostScript passwords. A PostScript malware which resides in the
printer’s memory and manipulates all further printouts by overlaying custom content or
replacing text has been created – with the impact that a user cannot be sure anymore if
the document viewed on screen is the same as the hard copy emerging from the printer.
Known methods to access the printer’s memory using proprietary PJL commands have
been evaluated, leading to the disclosure of sensitive information. We studied support
for PostScript/PJL file operations and discovered severe vulnerabilities in various de-
vices ranging from password disclosure to read/write access to the whole file system.
Furthermore, we showed that even primitive languages like PCL can be abused for
file-sharing purposes on a printer device. One major finding of this work is a generic
method to capture print jobs – using only legitimate PostScript language constructs
– to which presumably a good portion of the worlds printing devices are vulnerable.
In addition, we gave an overview of remote code execution attacks by traditional buffer
overflows, malicious firmware updates and customized third-party software packages.
It could be proven that it is common to deploy firmware updates over the printing
channel itself which is a major design flaw: data and code over the same channel.
We extended known cross-site printing techniques to ‘CORS spoofing’ attacks using
PostScript’s feedback functionality and thereby demonstrated that even web attacker
is capable of performing the presented attacks. A prototype software to systematically
perform penetration tests against network printers has been implemented and will be
released as free software. We are confident that PRET – especially its functionality to
access the printers file system using PostScript and PJL – will lead to the disclosure of
yet unknown vulnerabilities in various printer models. Because of limited resources
we were only able to analyze a tiny fraction of existing printer models in this work.
However, the case-study of twenty laser printers has proven that printers – which for
decades have been considered simply as devices that print and potentially overseen by
network administrators – can be a serious security threat.
67
Bibliography
[Ado85] Adobe Systems Inc. PostScript Language Reference Manual. 1985.
[Ado92] Adobe Systems Inc. PostScript Language Reference Manual, 2nd Edition.
1992.
[Ado99] Adobe Systems Inc. PostScript Language Reference Manual, 3rd Edition.
1999.
[Ale96] Aleph One. Smashing the Stack for Fun and Profit. Phrack magazine,
7(49):14–16, 1996.
[Bis09] B. Bissett. Taking MFP Applications in the Office to the Next Level:
Konica Minolta’s bizhub Extended Solution Technology (bEST) Software
Development Platform for MFPs, 2009.
[BML04] R. Bergman, I. McDonald, and H. Lewis. Printer MIB v2. RFC 3805,
RFC Editor, 2004.
68
[CM13] S. Christey and B. Martin. Buying Into the Bias: Why Vulnerability
Statistics Suck. Black Hat USA, 2013.
[Cor07] Ricoh Corp. Network Security White Paper for Digital Multifunction and
Printing Devices, 2007.
[Cos10] A. Costin. Hacking printers for fun and profit. Hack.lu, 2010.
[Cos11] A. Costin. Hacking Printers – 10 years down the road. Hash Days, 2011.
[CS11] A. Cui and J. Stolfo. Print Me If You Dare: Firmware Modification At-
tacks and the Rise of Printer Malware. 2011.
[Dü07] M. Dürmuth. Sind jetzt sogar schon unsere Textdokumente böse? CeBIT
Future Talks, 2007.
[FX 02] FX and FtR of Phenoelit. Attacking Networked Embedded Devices. Black
Hat USA, 2002.
[GP+ 99] E. Guttman, Perkins, et al. Service Location Protocol, Version 2. RFC
2608, RFC Editor, 1999.
[GW93] P. Grillo and S. Waldbusser. Host Resources MIB. RFC 1514, RFC Editor,
1993.
[H+ 00] T Hastings et al. Internet Printing Protocol/1.1: Model and Semantics.
RFC 2911, RFC Editor, 2000.
69
[Har00] D. Harley. Viruses and the Macintosh, 2000.
[HP 92] HP Inc. PCL5 Printer Language Technical Reference Manual. 1992.
[HP 97] HP Inc. Printer Job Language Technical Reference Manual. 1997.
[HP 99] HP Inc. HP LaserJet Family Quick Reference Service Guide. 1999.
[HP 00] HP Inc. PJL Passthrough to PML and SNMP User’s Guide. 2000.
[HP 02] HP Inc. PCL XL Feature Reference Protocol Class 3.0. 2002.
[Kon14] Konica Minolta, Inc. Konica Minolta Security White Paper, 2014.
70
[Kyo96] Kyocera Corp. PRESCRIBE Commands for Kyocera Mita Print System,
1996.
[LLP+ 11] K. Lee, C. Lee, N. Park, S. Kim, and D. Won. An Analysis of Multi-
Function Peripheral with a Digital Forensics Perspective. In Comput-
ers, Networks, Systems and Industrial Engineering (CNSI), 2011 First
ACIS/JNU International Conference on, pages 252–257. IEEE, 2011.
[Lon01] C. Lonvick. The BSD syslog Protocol. RFC 3164, RFC Editor, 2001.
[Ltd04] Brother Industries Ltd. Brother Laser Printer Technical Reference Guide,
Ver. H. Technical report, 2004.
[McL90] L. McLaughlin. Line Printer Daemon Protocol. RFC 1179, RFC Editor,
1990.
[NI16] Toshiyuki N. and T. Ito. Office Solution with Multifunction Printer, 2016.
[NL14] K. Nohl and J. Lell. BadUSB: On Accessories that Turn Evil. Black Hat
USA, 2014.
[NMR+ 97] C. Nevill-Manning, T. Reed, et al. Extracting Text from PostScript. 1997.
[PWG16] The Printer Working Group PWG. IPP 3D Printing Extensions – Working
Draft, 2016.
[RM+ 96] Y. Rekhter, B. Moskowitz, et al. Address Allocation for Private Internets.
RFC 1918, RFC Editor, 1996.
71
[Rud01] J. Ruderman. The Same Origin Policy, 2001.
[Sha09] Sharp K.K. Sharp OSA – Informationen für Sharp Fachhändler, 2009.
[Top01] J. Topf. The HTML Form Protocol Attack. BugTraq posting. Internet:
http://www.remote.org/jochen/sec/hfpa/hfpa.pdf, 2001.
[vK+ 10] A. van Kesteren et al. Cross-Origin Resource Sharing. W3C, Working
Draft WD-cors-20100727, 2010.
[Zim95] P. Zimmermann. The official PGP User’s Guide. MIT Press, 1995.
72
A. Appendix
73
CVE-1999-0564 Canon SMTP Unauthenticated printing
CVE-2004-2166 Canon SMTP Unauthenticated printing
CVE-2006-6435 Xerox SNMP Brute force attack
CVE-2002-1048 HP SNMP Credential Disclosure
CVE-2005-2988 HP SNMP Information disclosure
CVE-2011-1532 HP SNMP Configuration modification
CVE-2012-4964 Samsung SNMP Default community string
CVE-2006-6470 Xerox SNMP Unspecified
CVE-2005-2202 Xerox XSS Inject arbitrary web script
CVE-2005-2647 Xerox XSS Inject arbitrary web script
CVE-2006-6436 Xerox XSS Inject arbitrary web script
CVE-2006-0827 Xerox XSS Inject arbitrary web script
CVE-2008-2743 Xerox XSS Inject arbitrary web script
CVE-2008-2825 Xerox XSS Inject arbitrary web script
CVE-2008-6436 Xerox XSS Inject arbitrary web script
CVE-2009-1333 HP XSS Inject arbitrary web script
CVE-2009-2684 HP XSS Inject arbitrary web script
CVE-2011-1533 HP XSS Inject arbitrary web script
CVE-2012-3272 HP XSS Inject arbitrary web script
CVE-2013-2507 Brother XSS Inject arbitrary web script
CVE-2013-2670 Brother XSS Inject arbitrary web script
CVE-2013-2671 Brother XSS Inject arbitrary web script
CVE-2013-4845 HP XSS Inject arbitrary web script
CVE-2013-6033 Lexmark XSS Inject arbitrary web script
CVE-2015-1056 Brother XSS Inject arbitrary web script
CVE-2009-0940 HP CSRF Authentication hijacking
CVE-2014-1990 Toshiba CSRF Authentication hijacking
CVE-2015-5631 Canon CSR Authentication hijacking
CVE-1999-1343 Xerox HTTP Denial of service
CVE-2001-1134 Xerox HTTP Denial of service
CVE-2002-1055 Brother HTTP Denial of service
CVE-2004-0740 Lexmark HTTP Denial of service
CVE-2005-2201 Xerox HTTP Denial of service
CVE-2005-2646 Xerox HTTP Denial of service
CVE-2006-1138 Xerox HTTP Denial of service
CVE-2006-2108 Océ HTTP Denial of service
CVE-2010-0101 Lexmark HTTP Denial of service
CVE-2013-4615 Canon HTTP Denial of service
CVE-1999-1061 HP HTTP Missing password
74
CVE-2009-0941 HP HTTP Missing password
CVE-2013-4613 Canon HTTP Missing password
CVE-1999-1508 Tektronix HTTP Authentication bypass
CVE-2005-0703 Xerox HTTP Authentication bypass
CVE-2005-1936 Xerox HTTP Authentication bypass
CVE-2005-2200 Xerox HTTP Authentication bypass
CVE-2005-2645 Xerox HTTP Authentication bypass
CVE-2006-5290 Xerox HTTP Authentication bypass
CVE-2006-6428 Xerox HTTP Authentication bypass
CVE-2006-6434 Xerox HTTP Authentication bypass
CVE-2008-0375 OKI HTTP Authentication bypass
CVE-2010-0548 Xerox HTTP Authentication bypass
CVE-2012-1239 Toshiba HTTP Authentication bypass
CVE-2013-6032 Lexmark HTTP Authentication bypass
CVE-2005-1179 Xerox HTTP Configuration modification
CVE-2006-2113 Xerox HTTP Configuration modification
CVE-2006-6429 Xerox HTTP Configuration modification
CVE-2008-2824 Xerox HTTP Configuration modification
CVE-2006-6427 Xerox HTTP RCE (command injection)
CVE-2009-1656 Xerox HTTP RCE (command injection)
CVE-2006-4680 Canon HTTP Credential disclosure
CVE-2008-0374 OKI HTTP Credential disclosure
CVE-2013-4614 Canon HTTP Credential disclosure
CVE-2006-6432 Xerox HTTP File disclosure
CVE-2008-4040 Kyocera HTTP File disclosure
CVE-2008-4419 HP HTTP File disclosure
CVE-2011-4785 HP HTTP File disclosure
CVE-2011-1531 HP HTTP Scan job disclosure
CVE-2006-6468 Xerox HTTP Certificate spoofing
CVE-2006-6430 Xerox HTTP Missing encryption
CVE-2006-6440 Xerox HTTP Unspecified
CVE-2006-6472 Xerox HTTP Unspecified
CVE-2012-2017 HP Unspecified Denial of service
CVE-2013-6193 HP Unspecified Denial of service
CVE-2006-0825 Xerox Unspecified Authentication bypass
CVE-2012-5215 HP Unspecified Configuration modification
CVE-2013-4807 HP Unspecified Configuration modification
CVE-2014-7875 HP Unspecified Configuration modification
CVE-2006-6439 Xerox Unspecified Information disclosure
75
CVE-2009-3842 HP Unspecified Information disclosure
CVE-2012-3273 HP Unspecified Information disclosure
CVE-2013-4828 HP Unspecified Information disclosure
CVE-2016-2244 HP Unspecified Information disclosure
CVE-2006-6471 Xerox Unspecified File disclosure
CVE-2013-4829 HP Unspecified Scan job disclosure
CVE-2006-6431 Xerox Unspecified Configuration modification
CVE-2006-0828 Xerox Unspecified Unspecified
CVE-2006-6473 Xerox Unspecified Unspecified
CVE-2001-1040 HP Internal Authentication bypass
CVE-2016-1896 Lexmark Internal Authentication bypass
CVE-2006-6433 Xerox Internal Missing accurate timestamps
CVE-2006-6438 Xerox Physical Information disclosure
CVE-2006-6441 Xerox Physical Booting from alternate media
CVE-2006-1139 Xerox Physical File disclosure
CVE-2016-3145 Lexmark Physical File disclosure
Command Description
id Show device information.
status Enable status messages.
version Show firmware version or serial number.
pagecount Manipulate printer’s page counter: pagecount <number>
printenv Show printer environment variable: printenv <var>
env Show environment variables.
set Set printer environment variable: set <key=value>
info Show information on PJL settings: info <category>
display Set printer’s display message: display <message>
offline Take printer offline and display message: offline <message>
restart Restart printer.
reset Reset to factory defaults.
selftest Perform various printer self-tests.
disable Disable printing functionality.
destroy Cause physical damage to printer’s NVRAM.
lock Lock control panel settings and disk write access.
unlock Unlock control panel settings and disk write access.
hold Enable job retention.
nvram Read, write or dump: nvram <operation>
76
Command Description
id Show device information.
version Show PostScript interpreter version.
devices Show available I/O devices.
uptime Show system uptime (might be random).
date Show printer’s system date and time.
lock Set startjob and system parameters password.
unlock Unset startjob and system parameters password.
restart Restart PostScript interpreter.
reset Reset PostScript settings to factory defaults.
disable Disable printing functionality.
destroy Cause physical damage to printer’s NVRAM.
hang Execute PostScript infinite loop.
overlay Put overlay eps file on all hard copies: overlay <file.eps>
cross Put printer graffiti on all hard copies: cross <font> <text>
replace Replace string in documents to be printed: replace <old> <new>
capture Capture further jobs to be printed on this device.
hold Enable job retention.
set Set key to value in topmost dictionary: set <key=value>
known List supported PostScript operators: known <operator>
search Search all dictionaries by key: search <key>
dicts Return a list of dictionaries and their permissions.
dump Dump PostScript dictionary: dump <dict>
resource List or dump PostScript resource: resource <category> [dump]
config Change printer settings: config <setting>
Command Description
selftest Perform printer self-test.
info Show information on fonts or macros: info <category>
77
Listing A.1: PostScript code to capture all future documents instead of printing them
78
Vendor Extension Quantity File header or type
rfu 419 @PJL UPGRADE SIZE=...
HP
bdl 206 FutureSmart binary format
rcx 49 SEIKO EPSON EpsonNet Form
Epson prn 9 @PJL ENTER LANGUAGE=DOWNLOAD
brn 7 Unknown binary, includes config file
fls, fly 30 @PJL LPROGRAMRIP
prn 25 @PJL ENTER LANGUAGE=DOWNLOAD
hd 18 @PJL FIRMWARE=...
Dell
brn 3 Unknown binary, includes config file
ps 2 PostScript (title: Firmware Update)
pjl 1 @PJL ENTER LANGUAGE=FLASH
djf 79 @PJL EXECUTE BRDOWNLOAD
Brother
blf 9 @PJL ENTER LANGUAGE=PCL
fls 63 @PJL LPROGRAMRIP
Lexmark
bin, fls 6 Unknown binary format
hd 33 @PJL FIRMWARE=...
Samsung
fls, hd0 4 @PJL DEFAULT P1284VALUE=...
ps 36 PostScript (title: Firmware Update)
dlm 35 Xerox Dynamic Loadable Module
prn, bin 20 @PJL ENTER LANGUAGE=DOWNLOAD
hd 16 @PJL FIRMWARE=...
Xerox brn 10 Unknown binary, includes config file
bin 10 @PJL SET JOBATTR="@SWDL"
fls, hd, hde 8 @PJL DEFAULT P1284VALUE=...
fls, xfc 4 @PJL ENTER LANGUAGE=XFLASH
pjl 3 @PJL FSDOWNLOAD [name].rpm
brn 15 @PJL FWDOWNLOAD...
Ricoh bin 14 @PJL RSYSTEMUPDATE SIZE=...
fls 4 @PJL LPROGRAMRIP
cramfs, img 98 cramfs image
bin, squashfs 79 squashfs image
Kyocera
bin, kmmfp 41 u-boot legacy uImage
efi, kmpanel 13 proprietary image format
bin 38 unknown binary, additional checksum file
Konica ps 20 PostScript (title: Softload printer modules)
Minolta ftp, prn 11 @PJL ENTER LANGUAGE=FIRMUPDATE
upg 1 @PJL ENTER LANGUAGE=UPGRADE