Security Analysis of a Scan-to-PC Solution
Office productivity solutions have evolved greatly over the last 10 years. However, along with this evolution comes an increasingly more complex web of connections and processes that hide the technical details from the users. One technology that has greatly helped offices go paper free are "scan to desktop" solutions that can create a digital duplicate of a hardcopy and transfer it directly to the users desktop, specified email account, or file server. While these solutions are an excellent way to help an office go green, the software that drives the file transfer process should raise some red flags with regards to how the data is moved from the scanner to desktop and how it is saved there. In this article we are going to provide a look at one solution provided by Kyocera Mita that not only gives someone a chance to upload spoofed documents to the designated scan folder, but also gives a remote attacker direct write access to the system's file system.
Kyocera Mita is an international manufacture of digital imaging devices based out of Japan. In addition to its line of printers, facsimiles, copiers and multifunction devices, Kyocera Mita also produces a collection of software programs that are meant to be used along side the printing/copying/scanning devices to "optimize your Kyocera products' performance and capabilities to achieve maximum return on your company's investment."
Included with these software solutions are programs that enhance color, manage forms, capture documents for workflow purposes, scan to LDAP controlled email accounts as well as to PC, MAC and FTP, and a host of programs for encrypted, authenticated printing and secure document management.
Finally, Kyocera Mita has designed their product offering to be as modular as possible. Since the same general firmware and interface options are available on the entire product line, it is easy to move from one device to another with little in the way of a learning curve. As a result, it is just as likely that a small business using an entry level KM-1650 could have the same software installed as an enterprise using the much faster and powerful KM-7530.
In this article we are going to focus on the scan to PC/desktop component and examine several security issues that we discovered in this solution that you might want to leave disabled. Use this article as guide when evaluating any scan to PC solution to ensure your documents and client PCs are secure.
Scan to PC
In the multifunction machines offered by Kyocera, the user is given software to allow them to scan a document at the copier/scanner and have it automatically be sent to their desktop PC. There are numerous benefits to such a solution, such as reducing the amount of wasted paper and having an instant digital copy for storage.
In order to facilitate the file transfer process, the end user is required to install a listener on their computer that accepts and manages the incoming documents. This program, known as the "Scanner File Utility," can either run on the desktop or sit in the background as a service. Regardless, the program has a simple interface through which the user can configure the options and manage the download process. Figure 1 shows the main screen.
Figure 1: Kyocera File Utility Program
From this screen, the user can directly open the file or the folder location where documents are received. Files that have not been opened are displayed in red font, which will turn to black once viewed through the utility.
The Setup options are basic. First a user must know their ID number, which is established by the administrator and programmed into the copier. Second, they need to determine where on the local PC they want the documents to be downloaded. Third and last, the user can specify a password that is used by the copier during the scanning process.(figure 2).
Figure 2: Configuration options
This feature, while very useful, brings with it a number of security issues that need to be addressed. For example, how can a user prevent someone from uploading random scan to their PC? Does the document transfer process provide an audit trail? Is there an authentication mechanism built into the client to prevent a spoofed transfer process? Can the client be tricked into receiving a file other than a PDF? These question, and more, need to be asked for any scan to desktop solution.
Attacking the Scan to PC
The following will take a look at the bugs and flaws found in the Kyocera Mita scan to PC solution. We will first describe the problem and then illustrate how the Kyocera solution fails to address the issue and then we will finally demonstrate how the flaw can be exploited.
Spoof User Identification
In today’s business world, having inappropriate, insulting or derogatory content on a computer can quickly lead to a harassment issues, or worse. It only takes one marginally questionable image or file for HR to get involved, which typically also affects an employee’s reputation and value to the company. As a result, any solution that grants remote file upload abilities to a user's PC needs to have some sort of reliable auditing capabilities built into the file transfer process.
Figure 3: Registration screen on copier
Kyocera has a rudimentary identification system in their file transfer process that is built into how the copier communicates with the desktop PC. Specifically, the copier requires an account to be created locally via a web interface, which is incorporated into the scan to PC option (figure 3). Since there could be numerous users, Kyocera also allows the administrator to assign each account a password to prevent someone from sending a document in another user’s name. While all this is appears to solve the problem, it actually leaves a loophole in the process because the client is forced to assume the identification data coming from the copier is trustworthy. However, what if the incoming data wasn’t from a copier?
The following provides the details of the first few packets transferred during the file upload process.
00000000 4f 4b 00 05 OK..
00000000 00 06 34 00 00 02 00 00 ..4.....
From Client — tells copier what type of format to use
00000004 00 6a 34 10 00 01 00 10 00 1b 00 25 00 00 00 00 .j4..... ...%.... 00000014 00 00 54 49 46 46 2d 47 34 4d 4d 52 00 50 44 46 ..TIFF-G 4MMR.PDF 00000024 2d 47 34 4d 4d 52 00 54 49 46 46 2d 47 33 4d 48 -G4MMR.T IFF-G3MH 00000034 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........ 00000044 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........ 00000054 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........ 00000064 00 00 00 00 00 00 00 00 00 00 00 00 ........ ....
From copier — tells client name of user
00000008 02 1c 34 02 00 01 00 08 00 0d 41 41 41 41 00 4e ..4..... ..AAAA.N 00000018 53 4e 5f 53 4b 41 4e 3a 53 45 54 48 00 00 00 00 SN_SKAN: SETH.... 00000028 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........ 00000038 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........ 00000048 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........ 00000058 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
If you note, in the last packet listed you can see that there is a clear plaintext value associated with the communication session. The value "SETH" is what the user has assigned as the sender from the copiers interface. However, what if this value is altered by a proxy program or via a spoofed injection process? Figure 4 provides an illustration of how easy it is to change the value.
Figure 4: Spoofing the identification
The end result is that the identification component of this solution is spoofable and can not be trusted. In addition to identification purposes, it is generally a standard operating procedure to have strong audit controls in any enterprise. The reasoning is built around having deniability and a record of activity that can be referred to if something is found to be awry. Since the identification can be altered without detection, any auditing value of the utilities sender list is questionable.
One additional aspect of the Kyocera solution that appears to provide identification is the user number, which is highlighted in figure 3. This number is shared between the copier and the File Utility, which means the incoming request to the listener must contain a locally valid identification number before it will accept the file.
While this value is passed as plain text, and as such could be sniffed, it is actually possible to deduce the correct identification number remotely via enumeration. Specifically, a program can send in a request that contains the ID of 1, if it fails then the client will respond with a fail code. An attacker can continue guessing 2-3-4-5, etc. up to 100, which is as high as it goes. Eventually, they will get a success message and know a valid account number. The following represent a pass/fail response.
00 0a 34 11 00 00 3e 40 ff ff ff ff - no account 00 0a 34 11 00 01 00 00 ff ff ff ff - valid account
Bypass Authentication Restriction
As previously mentioned, Kyocera does provide some authentication mechanisms in their solution. First, the administrator can lock the account on the copier to keep users from borrowing another user’s account to send the file. Second, the File Utility can be configured to request an additional password for permission to upload a file. While this process would prevent someone from using a copier to upload a document, the access code is not verified by the File Utility — only the copier. The following summarizes the file upload process:
Copier to PC – OK to send? PC to Copier – Yes. Please send file types of PDF and TIFF. Copier to PC – OK. This is the users name and ID for auditing purposes. PC to Copier – OK. This is the password required for that ID. (Copier now prompts user for correct password.) Copier to PC – OK. This is the file name. Copier to PC – Here is the file. Copier to PC – All done! PC to Copier – OK! Copier to PC – OK!
The problem with this is that the File Utility makes the assumption that the only way a file can be transferred to the listener is through the copier. Unfortunately, this is not true, and as a result the loophole will allow unauthenticated uploads.
Unauthorized Access to Authentication Information
In addition to bypassing the password, the previously described authentication procedure contains a logic error that can be exploited to steal the password directly from the File Utility. Specifically, there is no preliminary authentication information given to the client before it sends the password to the copier. Combine this with the fact that the file initialization process can be spoofed, and it is trivial for someone to ask the File Utility for its password. Figure 5 illustrates both the ID enumeration and password extraction in action via a Metasploit module we prepared for testing.
Figure 5: Metasploit Kyocera Auxiliary Module
So, at this point, an attacker can enumerate the ID, gain access to the password data, and bypass authentication requirements incorporated into the scan to PC solution. Next week we will continue our security review of this program and illustrate how the flaws discussed in this week’s section can be used to upload fake documents and more.