Fax?!
What The
To:
Date:
Subject:
Check Point Research
DEFCON 26
Aug-12 2018
Received OK?
WhoAreWe?
Yaniv Balmas
“This should theoretically work”
Security Researcher
Check Point Software Technologies
@ynvb
Eyal Itkin
“That’s cool.”
Security Researcher
Check Point Software Technologies
@eyalitkin
1860
Caselli
Invents
Machine
Similar to
Today’s FAX
1923
Enter the
RadioFAX.

Used by
Navies
1966
XEROX
Introduces
the First
Commercial
FAX Machine
1980
Group III 

ITU-T Fax
Standards

T.30, T.4, T.6
GammaFAX
Brings
Computers
Into FAX
Network
1985
1846
Alexaner
Bain Sends

An Image
Over a Wire
FAXHistory
Quality
Accessibility
Reliability
Authenticity ?
BackToTheFuture
BackToTheFuture
BackToTheFuture
BackToTheFuture
BackToTheFuture
BackToTheFuture
WTF?!
• Modern FAX is no longer a simple “FAX
Machines”

• The same old FAX technology is now
wrapped inside newer technologies

• ALL-IN-ONE printers are EVERYWHERE
FaxToday
The Security View
ALL-IN-ONE Printers
ALL-IN-ONE Printers
FAX Attack
ALL-IN-ONE Printers
FAX Attack
Challenge
Accepted
What is the
Target?
How to Obtain
the Code?
What is The
OS?
How Does FAX
Even Work?
How can we
Debug it?
Where to look for
vulns?
AndTheWinnerIs
BreakingHW
Flash ROM
SRAMs
(e.g Some More Memory)
BreakingHW
USB
WiFi
SRAM
Electricity
Main
CPU
FAX

Modem
Battery
ShowMeYourFirmware!
SERIAL

DEBUG
JTAG
TooEasy?
FirmwareUpgrade
How do you
upgrade a printer
firmware?!
You Print it!
How do you
upgrade a printer
firmware?!
You Print it!
PrintingTheFirmware
PrintingTheFirmware
NULL Decoder
TIFF Decoder
Delta Raw Decoder
WhenYou’reaHammer…
Sections
Loading Address Section Name Location in Binary
IDon’tUnderstand
…
WhatISThis?!
• Probably a compression algorithm

• A very bad one …

• Some mathematics
Let'sTakeALook
FF 20 72 66 63 75 72 73 69 EF 76 65 6C 79 AE E0
6E 6F 6E DF 70 6F 73 69 74 FE 30 20 73 F7 69 7A
65 0E 32 76 61 72 69 FF 61 62 6C 65 2D 6C 65 6E
F7 67 74 68 AD 33 00 00 56 4C FF 6A 70 65 67 2E
r e c u r s i v e l y
n o n p o s i t s i z
e v a r i a b l e - l e n
g t h V L j p e g .
FF 20 72 66 63 75 72 73 69 EF 76 65 6C 79 AE E0
6E 6F 6E DF 70 6F 73 69 74 FE 30 20 73 F7 69 7A
65 0E 32 76 61 72 69 FF 61 62 6C 65 2D 6C 65 6E
F7 67 74 68 AD 33 00 00 56 4C FF 6A 70 65 67 2E
r e c u r s i v e l y
n o n p o s i t s i z
e v a r i a b l e - l e n
g t h V L j p e g .
Let'sTakeALook
FF EF AE E0
DF FE 30 F7
0E 32 FF
F7 AD 33 FF
APattern?!
FF EF
DF F7
FF
F7 FF
8 Bytes 9 Bytes
9 Bytes
9 Bytes 8 Bytes
9 Bytes 8 Bytes
APattern?!
FF
EF
DF
F7
FF
F7
F
11111111
F
1 1 1 1 1 1 1
F E
1 1 1 1
11111111
F
1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
0
0
0
0
D
F7
FF
F7
DifferentAngle
F7 AD 33
Forward / Backward Pointer

Dictionary

Sliding Window
?
??
?
TheMissingLink
Softdisk
What the Fax!?
TheMissingLink
AD 33
1 0 1 0 1 1 0 1 0 0 1 1 0 0 1 1
A D 3 3
2771 3
Window
Location
Data

Length
A BCDABEF
Input Text
Sliding Window
G
Output Text
MysterySolved
A BCDABEF
Input Text
Sliding Window
A
G
Output Text
A
MysterySolved
A BCDABEF
Input Text
Sliding Window
A B
G
Output Text
A B
MysterySolved
A BCDABEF
Input Text
Sliding Window
A B C
G
Output Text
A B C
MysterySolved
A BCDABEF
Input Text
Sliding Window
A B C D
G
Output Text
A B C D
MysterySolved
A BCDABEF
Input Text
Sliding Window
A B C D
G
Output Text
A B C D
MysterySolved
A BCDABEF
Input Text
Sliding Window
A B C D
G
Output Text
A B C D
MysterySolved
A BCDABEF
Input Text
Sliding Window
A B C D
G
Output Text
A B C D 00 02
MysterySolved
A BCDABEF
Input Text
Sliding Window
A B C D E
G
Output Text
A B C D E00 02
MysterySolved
A BCDABEF
Input Text
Sliding Window
A B C D E F
G
Output Text
A B C D E F00 02
MysterySolved
A BCDABEF
Input Text
Sliding Window
A B C D E F
G
G
Output Text
A B C D E F G00 02
MysterySolved
A BCDABEF
Input Text
Output Text
Sliding Window
A
A
B
B
C
C
D
D
E
E
F
F
G
G
G
00 02
1 1 1 1 1 1 10
MysterySolved
A BCDABEF
Input Text
Output Text
Sliding Window
A
A
B
B
C
C
D
D
E
E
F
F
G
G
G
EF 00 02
MysterySolved
ThePrintingBeast
• 64,709 Functions

• Most of the code not parsed by IDA

• Indirect Calls, Dynamic Tables, BootLoader Functions
ThreadX
- ARM9/
Green
Hills
Treck (IP, TCP/UDP, DNS, HTTP, …)
libpng 1.2.29 (2008) tTB, tHTML, …
gSOAP 2.7
OpenSSL 1.0.1j (2014)
Spidermonkey
mDNSResponder
2 Staged Boot Loader
tModem
tFaxLog
tT30
tPrintFax
Common Libraries Tasks
System n’ Stuff
MakingSomeSense
ThreadX
- ARM9/
Green
Hills
Treck (IP, TCP/UDP, DNS, HTTP, …)
libpng 1.2.29 (2008) tTB, tHTML, …
gSOAP 2.7
OpenSSL 1.0.1j (2014)
mDNSResponder
2 Staged Boot Loader
tModem
tFaxLog
tT30
tPrintFax
Common Libraries Tasks
System n’ Stuff
Spidermonkey
MakingSomeSense
JSOnAPrinter?!
• JavaScript is used in a module called PAC.

• PAC - Proxy Auto Configuration

• Used by a URL linking to a JS file in DHCP settings 

• Top layer functionality was designed by HP
FakeURL
Yep…
T30
• aka “ITU-T Recommendation T.30” 

• Procedures for document facsimile transmission in the
general switched telephone network 

• Defined the “heavy lifting” procedures relevant for all fax
sending functionality

• Designed at 1985

• Last update at 2005
DynamicHell
TheUndebuggable
• How do we debug this hostile environment?

• There are no native debugging facilities

• We have no control over the execution flow

• Hardware watch-dog is a serious problem
LuckyBreak
• Luck is a fundamental part of every research project

• At July 19, SENRIO published an exploit dubbed “Devil’s
Ivy”

• CVE-2017-9765 - RCE in gSOAP 2.7 - 2.8.47

• And it seems our printer is vulnerable!
Devil’sIvy
DebuggingChallenges
• Need to read/write memory

• Need to Execute code

• Create a network tunnel between debugger/debuggee
DebuggingChallenges
• We have control over execution flow

• Need to load our own code

• Bypass memory protection

• Embed debugging stub into current firmware
Scout
• We created our own instruction based debugger

• Called - ‘Scout’

• Supports x86, x64, ARM (ARM and Thumb mode)

• Embedded mode for firmware

• Linux kernel mode
HowDoesAFAX?
PHASE 1
Network

Interaction
PHASE 2
Probing/

Ranging
Equalizer

and

Echo
Canceller
Training
PHASE 3
Training
Phase
PHASE 4
HowDoesAFAX?
CallerID
PHASE A
SenderCaps

(DIS)
ReceiverCaps

(DTC)
PHASE B
Tunnel
HDLC
Endofpage

(EOP)
MsgConfirm

(MCF)
PHASE D
DataTransfer
PHASE C
HowDoesAFAX?
PHASEA
PHASEB
PHASEC
PHASED
Tunnel
T.30
HDLC
HowDoesAFAX?
PHASEA
PHASEB
PHASEC
PHASED
Tunnel
FAX
T.30
HDLC
HowDoesAFAX?
PHASEA
PHASEB
PHASEC
PHASED
Tunnel
TIFF

Body
TIFF

Header
T.30
HDLC
G.3/G.4
HowDoesAFAX?
PHASEA
PHASEB
PHASEC
PHASED
Tunnel
FAX
T.30
Color Extension
HDLC
HowDoesAFAX?
PHASEA
PHASEB
PHASEC
PHASED
Tunnel JPEG
Header
and
Body
Color Extension
T.30
HDLC
HowDoesAFAX?
Vulnerability
• All the layers we showed can contain possible
vulnerabilities.

• The most convenient layer is the application one.

• We started by inspecting the JPEG parsing capabilities.
JPEG
FF D8 FF E0 00 10 4A 46 49 46 00 01 02 00 00 64
00 64 00 00 FF C4 0A 02 34 D3 2A 78 80 42 6D 2B
FF DA 12 28 2A 6F 2B 81 6A 16 0F C8 9A 13 FF D9
. . . . . . . J F I F . . . . d
. d . . . . . . 4 . * x . Bm+
. . . ( * 0 + . j . . . . . . .
EOI - End Of Image
DHT - Define Huffman Table
APP0 - Application Specific
SOI - Start Of Image
SOS - Start Of Scan
Data
Size
Data
Size
Data
DHT
FF C4 20 00 01 00 00 00 00 02 00 01 02 00 00 00
00 00 00 FF FF C4 0A 02 34 D3 2A 78 80 42 6D 2B
• Define Huffman Table

• Defines 4X4 comparison matrix for the JPEG Image
HEADER SIZE 4X4 MATRIX DATA
DHT
FF C4 20 00 01 00 00 00 00 02 00 01 02 00 00 00
00 00 00 FF FF C4 0A 02 34 D3 2A 78 80 42 6D 2B
∑(
)=6
• 4X4 Matrix values are summed

• The product is used as a size value for data bytes

• The data bytes are copied into a 256 bytes array located
on the stack
Stack
FF FF C4 0A 02 34
DHT
256
6
FF C4 20 00 01 00 00 00 00 02 00 01 02 00 00 00
00 00 00 FF FF C4 0A 02 34 D3 2A 78 80 42 6D 2B
CanYouSpotIt?
FF C4 20 FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF C4 0A 02 34 D3 2A 78 80 42 … 2B
DHT
Stack
256
Stack
FF FF C4 0A 02 34 D3 2A 78 80 42 … 2B
DHT
4000
256
Overflow!!
FF C4 20 FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF C4 0A 02 34 D3 2A 78 80 42 … 2B
ExploitChain
• Trivial stack overflow

• No constraints (“forbidden bytes”)

• ~4,000 user controlled bytes

• The file contains even more information we control…
Demo Time
Conclusions
• PSTN is still a valid attack surface in 2018!

• FAX can be used as a gateway to internal networks

• Old outdated protocols are not good for you…
WhatCanIDo?
• Patch your printers

• Don't connect FAX where not needed

• Segregate your printers from the rest of the network
STOP

USING

FAX
LittleHelpFromMyFriends
Lior
Oppenheim
Yannay
Livneh
Yoav
Alon
Tamir
Bahar
oppenheim1
tmr232
Yannayli
yoavalon
fin.
ynvb
EyalItkin

More Related Content

PDF
DMVPN Lab WorkBook
PDF
BGP Route Reflectors Lab WorkBook
PDF
IPv6 Basics
PDF
BGP Route Aggregation Lab WorkBook
PDF
Manual usuario - Inspur cx-h81-m1 v2 0
PDF
VRF Lab WorkBook
PDF
BlueHat Seattle 2019 || Modern Binary Analysis with ILs
PPTX
Embedded Systems Project Based Training|Engineering Projects,Summer Training
DMVPN Lab WorkBook
BGP Route Reflectors Lab WorkBook
IPv6 Basics
BGP Route Aggregation Lab WorkBook
Manual usuario - Inspur cx-h81-m1 v2 0
VRF Lab WorkBook
BlueHat Seattle 2019 || Modern Binary Analysis with ILs
Embedded Systems Project Based Training|Engineering Projects,Summer Training

What's hot (20)

PDF
Exploring the x64
DOC
PROYECTO VLANS
PDF
BlueHat Seattle 2019 || Don't forget to SUBSCRIBE.
PDF
Mikhail Belopuhov: OpenBSD: Where is crypto headed?
PDF
Cisco IOS Attack & Defense - The State of the Art
PDF
Chromium Sandbox on Linux (NDC Security 2019)
PPTX
Cisco IOS shellcode: All-in-one
PPTX
用Raspberry Pi 學Linux I2C Driver
PDF
DEF CON 27 - HUBER AND ROSKOSCH - im on your phone listening attacking voip c...
PDF
Comparison chart cloners
XLS
Sample inventory report
PPT
Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]
PPTX
ULA network experience @ JANOG34, by Shishio Tsuchiya [APNIC 38 / APIPv6TF]
PPT
Quest technology product training 8 13-14
PDF
Comparison
PDF
Dronecode: software open source em drones
PDF
Return Oriented Programming - ROP
PPTX
09 - ROP countermeasures, can we fix this?
PDF
Configure ospf v3 single areaa
PDF
Nxll24 i pv6
Exploring the x64
PROYECTO VLANS
BlueHat Seattle 2019 || Don't forget to SUBSCRIBE.
Mikhail Belopuhov: OpenBSD: Where is crypto headed?
Cisco IOS Attack & Defense - The State of the Art
Chromium Sandbox on Linux (NDC Security 2019)
Cisco IOS shellcode: All-in-one
用Raspberry Pi 學Linux I2C Driver
DEF CON 27 - HUBER AND ROSKOSCH - im on your phone listening attacking voip c...
Comparison chart cloners
Sample inventory report
Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]
ULA network experience @ JANOG34, by Shishio Tsuchiya [APNIC 38 / APIPv6TF]
Quest technology product training 8 13-14
Comparison
Dronecode: software open source em drones
Return Oriented Programming - ROP
09 - ROP countermeasures, can we fix this?
Configure ospf v3 single areaa
Nxll24 i pv6
Ad

Similar to What the Fax!? (20)

PDF
Linux+sensor+device-tree+shell=IoT !
PDF
OT Security - h-c0n 2020
PDF
DEF CON 27 - XILING GONG PETER PI - exploiting qualcom wlan and modem over th...
PDF
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
PPT
Introduction to PICAXE Microcontrollers
PDF
Rainbow Over the Windows: More Colors Than You Could Expect
PDF
DEFCON 23 - Ian Latter - remote access the apt
PDF
amrapali builders@@sub way hacking.pdf
PDF
Reverse_Engineering_of_binary_File_Formats.pdf
PPT
HBase at Xiaomi
PDF
Tools Of The Hardware Hacking Trade Final
PDF
Make ARM Shellcode Great Again - HITB2018PEK
PPT
Lec15 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- EPIC VLIW
PPTX
Dpdk applications
DOCX
Chapter 1SyllabusCatalog Description Computer structu
PPTX
Buffer overflow – Smashing The Stack
PPT
Cyclone II FPGA Overview
PDF
Attacking Industrial Remote Controllers (HITB AMS 2019)
PPT
Internet Technology for the Commodore 64
PPT
student_pres120202final
Linux+sensor+device-tree+shell=IoT !
OT Security - h-c0n 2020
DEF CON 27 - XILING GONG PETER PI - exploiting qualcom wlan and modem over th...
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
Introduction to PICAXE Microcontrollers
Rainbow Over the Windows: More Colors Than You Could Expect
DEFCON 23 - Ian Latter - remote access the apt
amrapali builders@@sub way hacking.pdf
Reverse_Engineering_of_binary_File_Formats.pdf
HBase at Xiaomi
Tools Of The Hardware Hacking Trade Final
Make ARM Shellcode Great Again - HITB2018PEK
Lec15 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- EPIC VLIW
Dpdk applications
Chapter 1SyllabusCatalog Description Computer structu
Buffer overflow – Smashing The Stack
Cyclone II FPGA Overview
Attacking Industrial Remote Controllers (HITB AMS 2019)
Internet Technology for the Commodore 64
student_pres120202final
Ad

More from Priyanka Aash (20)

PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
PDF
From Chatbot to Destroyer of Endpoints - Can ChatGPT Automate EDR Bypasses (1...
PDF
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
PDF
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
PDF
Lessons Learned from Developing Secure AI Workflows.pdf
PDF
Cyber Defense Matrix Workshop - RSA Conference
PDF
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
PDF
Securing AI - There Is No Try, Only Do!.pdf
PDF
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
PDF
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
PDF
10 Key Challenges for AI within the EU Data Protection Framework.pdf
PDF
Techniques for Automatic Device Identification and Network Assignment.pdf
PDF
Keynote : Presentation on SASE Technology
PDF
Keynote : AI & Future Of Offensive Security
PDF
Redefining Cybersecurity with AI Capabilities
PDF
Demystifying Neural Networks And Building Cybersecurity Applications
PDF
Finetuning GenAI For Hacking and Defending
PDF
(CISOPlatform Summit & SACON 2024) Kids Cyber Security .pdf
PDF
(CISOPlatform Summit & SACON 2024) Regulation & Response In Banks.pdf
PDF
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
From Chatbot to Destroyer of Endpoints - Can ChatGPT Automate EDR Bypasses (1...
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Cyber Defense Matrix Workshop - RSA Conference
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Securing AI - There Is No Try, Only Do!.pdf
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Keynote : Presentation on SASE Technology
Keynote : AI & Future Of Offensive Security
Redefining Cybersecurity with AI Capabilities
Demystifying Neural Networks And Building Cybersecurity Applications
Finetuning GenAI For Hacking and Defending
(CISOPlatform Summit & SACON 2024) Kids Cyber Security .pdf
(CISOPlatform Summit & SACON 2024) Regulation & Response In Banks.pdf
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf

Recently uploaded (20)

PDF
CloudStack 4.21: First Look Webinar slides
PDF
Abstractive summarization using multilingual text-to-text transfer transforme...
PDF
Flame analysis and combustion estimation using large language and vision assi...
DOCX
search engine optimization ppt fir known well about this
PDF
Architecture types and enterprise applications.pdf
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PPTX
2018-HIPAA-Renewal-Training for executives
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
UiPath Agentic Automation session 1: RPA to Agents
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PPTX
Chapter 5: Probability Theory and Statistics
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
OpenACC and Open Hackathons Monthly Highlights July 2025
PPT
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
PDF
Credit Without Borders: AI and Financial Inclusion in Bangladesh
PPTX
Custom Battery Pack Design Considerations for Performance and Safety
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
Modernising the Digital Integration Hub
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
CloudStack 4.21: First Look Webinar slides
Abstractive summarization using multilingual text-to-text transfer transforme...
Flame analysis and combustion estimation using large language and vision assi...
search engine optimization ppt fir known well about this
Architecture types and enterprise applications.pdf
Hindi spoken digit analysis for native and non-native speakers
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
2018-HIPAA-Renewal-Training for executives
Taming the Chaos: How to Turn Unstructured Data into Decisions
UiPath Agentic Automation session 1: RPA to Agents
Convolutional neural network based encoder-decoder for efficient real-time ob...
Chapter 5: Probability Theory and Statistics
Module 1.ppt Iot fundamentals and Architecture
OpenACC and Open Hackathons Monthly Highlights July 2025
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
Credit Without Borders: AI and Financial Inclusion in Bangladesh
Custom Battery Pack Design Considerations for Performance and Safety
1 - Historical Antecedents, Social Consideration.pdf
Modernising the Digital Integration Hub
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...

What the Fax!?