BadBarcode: How to hack a
starship with a piece of paper
Hyperchem Ma
Tencent’s Xuanwu Lab
http://xlab.tencent.com @XuanwuLab
Who am I ?
Security Researcher @
– Embedded Device Security
– Firmware Reverse-Engineering
– Big Fan of IoT
Wait, hack a starship?
4
Hyperchem Ma, badbarcode en_1109_nocomment-final
Hyperchem Ma, badbarcode en_1109_nocomment-final
About Barcode
Though often be ignored, barcode is
the most ancient technology of IoT.
What is barcode?
•  Barcode is an optical machine-readable
representation of data relating to the object
to which it is attached;
•  Originally barcodes(1D) systematically
represented data by varying the widths and
spacings of parallel lines.
Hyperchem Ma, badbarcode en_1109_nocomment-final
Hyperchem Ma, badbarcode en_1109_nocomment-final
Hyperchem Ma, badbarcode en_1109_nocomment-final
Hyperchem Ma, badbarcode en_1109_nocomment-final
Barcode Symbology
•  Every barcode includes:
– Quiet Zone: Blank margin, No Information, Tell where
barcode starts and stops;
– Start character(s): Special pattern for barcode starts;
– Data: Includes Numeric, Alpha-Numeric, Full ASCII
chars depending on different barcode protocols;
– Stop character(s): Special pattern for barcode ends.
•  Some barcode have checksum bits/character(s)
Barcode Scanners
Scanner Inside
How Barcode Scanner Work
Capturing Decoding Transferring
RS232
PS/2
USB HID
…
Code 39
Code 128
QR Code
…
LED
Laser
CCD
CMOS
…
Protocols
Code 128
•  Full ASCII Encode Ability, Effictive and
High-Density
•  4 Function Codes Availiable For Manufacture
•  Three Character Sets: CodeA,CodeB,CodeC
– Unprintable ASCII can be encoded by CodeA
– CodeC encodes only two-digit numbers
– CharSets are chosen automatically
– Encoder can hybridize three code sets
In addition to supporting standard protocols,
many manufacturers also typically implement
some of their unique features in scanners.
Scanner Manufactures
•  Symbol (Zebra)
•  HoneyWell
•  TaoTronics
•  ESky
•  ACCESS IS
•  UNITECH
•  AIBO
•  Newland
•  Copycat products
Barcode Scanner Is Everywhere
Hyperchem Ma, badbarcode en_1109_nocomment-final
Previous Work on Barcodes Security
“Toying with Barcodes”, Phenoelit, 24C3
•  Barcode driven buffer overflow
•  Barcode driven format string
•  Barcode driven SQL injection
•  Barcode driven XSS
Other Scenarios
•  Predict and recreate barcodes
•  Duplicate barcodes
•  Phishing attacks by QR code
However, most of previous research
focused on the application that do not
properly process data from barcodes
Our Research:BadBarcode
What is BadBarcode?
•  Many barcode scanners are keyboard emulation device
•  Some barcode protocols, like Code 128, supports
ASCII control characters
•  Almost every barcode scanner support Code 128
•  Almost every barcode scanner has its own additional
keyboard emulation features
So, is it possible to open a shell and “type”
commands by barcodes like a keyboard?
ASCII Table
Hex ASCII Scan code Hex ASCII Scan code Hex ASCII Scan code
00 NUL CTRL+2 0B VT CTRL+K 16 SYN CTRL+V
01 SOH CTRL+A 0C FF CTRL+L 17 TB CTRL+W
02 STX CTRL+B 0D CR CTRL+M 18 CAN CTRL+X
03 ETX CTRL+C 0E SO CTRL+N 19 EM CTRL+Y
04 EOT CTRL+D 0F SI CTRL+O 1A SUB CTRL+Z
05 ENQ CTRL+E 10 DLE CTRL+P 1B ESC CTRL+[
06 ACK CTRL+F 11 DC1 CTRL+Q 1C FS CTRL+
07 BEL CTRL+G 12 DC2 CTRL+R 1D GS CTRL+]
08 BS CTRL+H 13 DC3 CTRL+S 1E RS CTRL+6
09 HT CTRL+I 14 DC4 CTRL+T 1F US CTRL+-
0A LF CTRL+J 15 NAK CTRL+U 7F DEL *
ASCII Control Characters
•  Combination key, like "Ctrl+ ", is mapped to a
single ASCII code
•  Encode these chars with Code 128 ,scan it with
scanner, and finally a combination key was
sent to computer
•  No Win keys, Alt keys, or other function keys
support
•  Though only “Ctrl+*” keys can be sent, it still poses
threat to kiosks! WHY?
Dialog Attack
•  Common Hotkeys are registered by many
programs, like: CTRL+O, CTRL+P
•  Hotkeys can launch common dialogs, like
OpenFile, SaveFile, PrintDialog and etc
•  These dialogs offer us opportunity to
browse file system, launch browsers and
execute program
•  And the most essential thing is "Besides
barcode scanner, touch screen is often available
as input device in kiosks."
Demo 1: Dialog Attack
What about Win+R?
If there is no touch screen, is it
possible to make a blind attack?
ADF(Advanced Data Formatting)
•  Symbol Technologies Invent this
•  Scanned data can be edited to suit particular
requirements before transmitted to host device
•  Specified Key can be sent to computer
•  Set up ONLY by scanning barcodes!
ADF
Actions Examples
Send data Send all or part of data
Setup fields Move cursor
Modify data Remove spaces and others
Data padding Pad data with space or zero
Beep Beep 1,2,3 times
Send Keystrokes Send ctrl+, alt+,shft+ etc keys.
Send GUI Keys Send GUI+ keys.
Send Right Control Send right contrl stroke.
Demo 2: ADF Attack
Unfortunately, not all scanners support
read barcodes from LCD/LED screen.
Can this attack be cooler ?
Can we do it automatically?
What about making an android APP?
Though scanners which read barcodes from
LCD/LED screen exist, many of them read
barcodes from materials which can absorb
and reflect light of certain wavelength.
However, LCD/LED screen display images
by modulating backlight rather absorbing
and reflecting lights, which means total black
for barcode scanners.
Display Technology
•  CRT
•  LCD
•  OLED
•  Electronic Paper
The answer is Kindle
•  Kindle use E-ink technology
•  It display words and images based on absorb
and reflect light, just like a paper
•  High Resolution, Up to 300 PPI
•  Programmable, of course after Jailbreak.
Kindle is perfect BadBarcode tool !
Demo 3: Fully-automated ADF Attack
Can we execute a command
by only one single barcode?
Yes, for some products, it is possible
But, the product in the next demo is widely
used in many really serious places, like
airports, so we would not disclose details
this time
Let’s just see the demo
Demo 4: A Piece of Paper Attack
Summary
BadBarcode is not a vulnerability of a certain product. It’s
even difficult to say that BadBarcode is the problem of
scanners or host systems.
So when we discovered BadBarcode, we even do not
know which manufacturer should be reported.
Although our demos is based on Windows, but in fact it
can attack any system as long as there is appropriate
hotkey.
Summary
•  BadBarcode is really a serious problem
•  Host system using keyboard emulation barcode scanner is
potentially vulnerable
•  Kiosks with touch screen and barcode scanner are easy to be
compromised
•  Barcode scanner that support ADF or some special keyboard
emulation features can be utilized to achieve automatic and
advanced attack
•  Other device via keyboard emulation connection might
suffer from the same problem
•  Keyboard Wedge RFID/NFC Reader ?
Security Suggestions
•  For barcode scanner manufactures
– Do NOT enable ADF or other additional features by
default
– Do NOT transmit ASCII control characters to host
device by default
•  For host system manufactures
– Do NOT use keyboard emulation barcode scanner as
far as possible
– Do NOT implement hotkeys in application, and
disable system hotkeys
Acknowledgement
•  My leader : tombkeeper
•  All team members in Xuanwu Lab
Q&A

More Related Content

PPTX
Fuzzing usb modems rahu_sasi
PDF
Mickey, threats inside your platform final
PDF
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
PPTX
Advanced SOHO Router Exploitation XCON
PDF
aleph - Malware analysis pipelining for the masses
PDF
Intro to Hardware Firmware Hacking
PPTX
Hardware hacking 101
PDF
Hardware Reverse Engineering: From Boot to Root
Fuzzing usb modems rahu_sasi
Mickey, threats inside your platform final
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Advanced SOHO Router Exploitation XCON
aleph - Malware analysis pipelining for the masses
Intro to Hardware Firmware Hacking
Hardware hacking 101
Hardware Reverse Engineering: From Boot to Root

What's hot (20)

PDF
Adventures in Femtoland: 350 Yuan for Invaluable Fun
PDF
Defcon 22-jesus-molina-learn-how-to-control-every-room
PDF
Arduino Forensics
PDF
Feasibility of Security in Micro-Controllers
PPTX
Esp8266 Workshop
PDF
Solnik secure enclaveprocessor-pacsec
PDF
Root via SMS: 4G access level security assessment, Sergey Gordeychik, Alexand...
PPTX
Root via sms. 4G security assessment
PDF
SD-WAN Internet Census, Zeronighst 2018
PPTX
[CB16] COFI break – Breaking exploits with Processor trace and Practical cont...
PDF
Home Automation by ESP8266
PDF
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
PPTX
Build WiFi gadgets using esp8266
PDF
Create a-strong-two-factors-authentication-device-for-less-than-chf-100
PDF
D1 t1 t. yunusov k. nesterov - bootkit via sms
PDF
SCADA deep inside: protocols and security mechanisms
PDF
Predicting and Abusing WPA2/802.11 Group Keys
PDF
lwM2M OTA for ESP8266
PDF
[CB20] Reverse Engineering archeology : Reverse engineering multiple devices ...
PPTX
OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
Adventures in Femtoland: 350 Yuan for Invaluable Fun
Defcon 22-jesus-molina-learn-how-to-control-every-room
Arduino Forensics
Feasibility of Security in Micro-Controllers
Esp8266 Workshop
Solnik secure enclaveprocessor-pacsec
Root via SMS: 4G access level security assessment, Sergey Gordeychik, Alexand...
Root via sms. 4G security assessment
SD-WAN Internet Census, Zeronighst 2018
[CB16] COFI break – Breaking exploits with Processor trace and Practical cont...
Home Automation by ESP8266
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
Build WiFi gadgets using esp8266
Create a-strong-two-factors-authentication-device-for-less-than-chf-100
D1 t1 t. yunusov k. nesterov - bootkit via sms
SCADA deep inside: protocols and security mechanisms
Predicting and Abusing WPA2/802.11 Group Keys
lwM2M OTA for ESP8266
[CB20] Reverse Engineering archeology : Reverse engineering multiple devices ...
OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
Ad

Viewers also liked (20)

PDF
Adam Laurie, Blue Toot -pacsec-2015
PDF
Guang gong escalate privilege by vulnerabilities in android system services ...
PDF
Mickey pac sec2016_final_ja
PDF
Marc schoenefeld grandma‘s old handbag_draft2_ja
PDF
James Forshaw, elevator action
PDF
Richard Johnson, high performance fuzzing
PDF
Richard high performance fuzzing ja
PDF
James Windows10 elevator action final-jp
PDF
Filippo, Plain simple reality of entropy
PDF
Georgi Geshev, warranty void if label removed
PDF
Andersson hacking ds_mx_with_sdr_pac_sec_2016_japanese
PDF
Martin Zeiser, Universal Pwn n Play - pacsec -final
PDF
Martin UPnP - pacsec -final-ja
PDF
Gang gong, escalate privilege by vulnerabilities in android system services
PDF
Kochetova+osipv atm how_to_make_the_fraud__final
PDF
Qinghao vulnerabilities mining technology of cloud and virtualization platfo...
PDF
Hyperchem bad barcode final_ja
PDF
Adam blue toot pacsec-2015-jp
PDF
Stuart attacking http2 implementations truefinal-jp
PDF
Filippo, plain simple reality of entropy ja
Adam Laurie, Blue Toot -pacsec-2015
Guang gong escalate privilege by vulnerabilities in android system services ...
Mickey pac sec2016_final_ja
Marc schoenefeld grandma‘s old handbag_draft2_ja
James Forshaw, elevator action
Richard Johnson, high performance fuzzing
Richard high performance fuzzing ja
James Windows10 elevator action final-jp
Filippo, Plain simple reality of entropy
Georgi Geshev, warranty void if label removed
Andersson hacking ds_mx_with_sdr_pac_sec_2016_japanese
Martin Zeiser, Universal Pwn n Play - pacsec -final
Martin UPnP - pacsec -final-ja
Gang gong, escalate privilege by vulnerabilities in android system services
Kochetova+osipv atm how_to_make_the_fraud__final
Qinghao vulnerabilities mining technology of cloud and virtualization platfo...
Hyperchem bad barcode final_ja
Adam blue toot pacsec-2015-jp
Stuart attacking http2 implementations truefinal-jp
Filippo, plain simple reality of entropy ja
Ad

Similar to Hyperchem Ma, badbarcode en_1109_nocomment-final (20)

PDF
BarcOwned : Popping shells with your cereal box
PDF
Eloi Sanfélix y Javier Moreno - Hardware hacking on your couch [RootedCON 2012]
PDF
A Barcode-Based Prototype Authentication System Using Python Programming and ...
PPTX
Barcode Technology ppt
PPT
PDF
NIK PPT INDUSTRIAL TRAINING.pdf ppt ppt ppt
PPTX
Barcode printing presentation lgi
PPTX
Chapter 2 lesson 2.pptxhhhhhhhhhhhhhhhhhhhhhhhh
PPTX
Barcode technology
PDF
Barcode Educational Guide - IDAutomation.com
PDF
Review of Types and Analysis of Two Dimensional Bar Codes in Logistics and E-...
PDF
RFID Hacking: Live Free or RFID Hard
PDF
InfoSec World 2016 – RFIDiggity – Pentester Guide to Hacking HF/NFC and UHF...
PDF
The scanner for direct payment invoices
PPTX
Barcode Reader(Scanner)
PDF
DEF CON 23 - Phil Polstra - one device to pwn them all
PDF
Hardware Hacking
PDF
DEF CON 27 - PHILIPPE LAULHERET - introduction to hardware hacking extended v...
PDF
Guia de configuracao_ms9520
PDF
Hardware hacking on the pi; what's js got to do with it
BarcOwned : Popping shells with your cereal box
Eloi Sanfélix y Javier Moreno - Hardware hacking on your couch [RootedCON 2012]
A Barcode-Based Prototype Authentication System Using Python Programming and ...
Barcode Technology ppt
NIK PPT INDUSTRIAL TRAINING.pdf ppt ppt ppt
Barcode printing presentation lgi
Chapter 2 lesson 2.pptxhhhhhhhhhhhhhhhhhhhhhhhh
Barcode technology
Barcode Educational Guide - IDAutomation.com
Review of Types and Analysis of Two Dimensional Bar Codes in Logistics and E-...
RFID Hacking: Live Free or RFID Hard
InfoSec World 2016 – RFIDiggity – Pentester Guide to Hacking HF/NFC and UHF...
The scanner for direct payment invoices
Barcode Reader(Scanner)
DEF CON 23 - Phil Polstra - one device to pwn them all
Hardware Hacking
DEF CON 27 - PHILIPPE LAULHERET - introduction to hardware hacking extended v...
Guia de configuracao_ms9520
Hardware hacking on the pi; what's js got to do with it

More from PacSecJP (20)

PDF
Kavya racharla ndh-naropanth_fin_jp-final
PDF
Ryder robertson security-considerations_in_the_supply_chain_2017.11.02
PDF
Ryder robertson pac-sec skeleton 2017_jp
PDF
Yuki chen from_out_of_memory_to_remote_code_execution_pac_sec2017_final-j
PDF
Yuki chen from_out_of_memory_to_remote_code_execution_pac_sec2017_final
PDF
Rouault imbert view_alpc_rpc_pacsec_jp
PDF
Rouault imbert alpc_rpc_pacsec
PDF
Di shen pacsec_jp-final
PDF
Di shen pacsec_final
PDF
Anıl kurmuş pacsec3-ja
PDF
Anıl kurmuş pacsec3
PDF
Ahn pacsec2017 key-recovery_attacks_against_commercial_white-box_cryptography...
PDF
Ahn pacsec2017 key-recovery_attacks_against_commercial_white-box_cryptography...
PDF
Yunusov babin 7sins-pres_atm_v4(2)_jp
PDF
Yunusov babin 7 sins pres atm v2
PDF
Shusei tomonaga pac_sec_20171026_jp
PDF
Shusei tomonaga pac_sec_20171026
PDF
Kavya racharla ndh-naropanth_fin
PDF
Lucas apa pacsec_slides_jp-final
PDF
Lucas apa pacsec slides
Kavya racharla ndh-naropanth_fin_jp-final
Ryder robertson security-considerations_in_the_supply_chain_2017.11.02
Ryder robertson pac-sec skeleton 2017_jp
Yuki chen from_out_of_memory_to_remote_code_execution_pac_sec2017_final-j
Yuki chen from_out_of_memory_to_remote_code_execution_pac_sec2017_final
Rouault imbert view_alpc_rpc_pacsec_jp
Rouault imbert alpc_rpc_pacsec
Di shen pacsec_jp-final
Di shen pacsec_final
Anıl kurmuş pacsec3-ja
Anıl kurmuş pacsec3
Ahn pacsec2017 key-recovery_attacks_against_commercial_white-box_cryptography...
Ahn pacsec2017 key-recovery_attacks_against_commercial_white-box_cryptography...
Yunusov babin 7sins-pres_atm_v4(2)_jp
Yunusov babin 7 sins pres atm v2
Shusei tomonaga pac_sec_20171026_jp
Shusei tomonaga pac_sec_20171026
Kavya racharla ndh-naropanth_fin
Lucas apa pacsec_slides_jp-final
Lucas apa pacsec slides

Recently uploaded (20)

PDF
KEY COB2 UNIT 1: The Business of businessĐH KInh tế TP.HCM
PDF
simpleintnettestmetiaerl for the simple testint
PPTX
Tìm hiểu về dịch vụ FTTH - Fiber Optic Access Node
PPTX
AI_Cyberattack_Solutions AI AI AI AI .pptx
PPTX
Cyber Hygine IN organizations in MSME or
PDF
Containerization lab dddddddddddddddmanual.pdf
PDF
Virtual Guard Technology Provider_ Remote Security Service Solutions.pdf
PPTX
Top Website Bugs That Hurt User Experience – And How Expert Web Design Fixes
PDF
The Evolution of Traditional to New Media .pdf
PDF
Lean-Manufacturing-Tools-Techniques-and-How-To-Use-Them.pdf
PPTX
10.2981-wlb.2004.021Figurewlb3bf00068fig0001.pptx
PPTX
The-Importance-of-School-Sanitation.pptx
PPTX
curriculumandpedagogyinearlychildhoodcurriculum-171021103104 - Copy.pptx
PDF
Course Overview and Agenda cloud security
PPTX
KSS ON CYBERSECURITY INCIDENT RESPONSE AND PLANNING MANAGEMENT.pptx
PPTX
Internet Safety for Seniors presentation
PDF
Understand the Gitlab_presentation_task.pdf
PDF
Computer Networking, Internet, Casting in Network
PDF
Alethe Consulting Corporate Profile and Solution Aproach
PDF
Alethe Consulting Corporate Profile and Solution Aproach
KEY COB2 UNIT 1: The Business of businessĐH KInh tế TP.HCM
simpleintnettestmetiaerl for the simple testint
Tìm hiểu về dịch vụ FTTH - Fiber Optic Access Node
AI_Cyberattack_Solutions AI AI AI AI .pptx
Cyber Hygine IN organizations in MSME or
Containerization lab dddddddddddddddmanual.pdf
Virtual Guard Technology Provider_ Remote Security Service Solutions.pdf
Top Website Bugs That Hurt User Experience – And How Expert Web Design Fixes
The Evolution of Traditional to New Media .pdf
Lean-Manufacturing-Tools-Techniques-and-How-To-Use-Them.pdf
10.2981-wlb.2004.021Figurewlb3bf00068fig0001.pptx
The-Importance-of-School-Sanitation.pptx
curriculumandpedagogyinearlychildhoodcurriculum-171021103104 - Copy.pptx
Course Overview and Agenda cloud security
KSS ON CYBERSECURITY INCIDENT RESPONSE AND PLANNING MANAGEMENT.pptx
Internet Safety for Seniors presentation
Understand the Gitlab_presentation_task.pdf
Computer Networking, Internet, Casting in Network
Alethe Consulting Corporate Profile and Solution Aproach
Alethe Consulting Corporate Profile and Solution Aproach

Hyperchem Ma, badbarcode en_1109_nocomment-final

  • 1. BadBarcode: How to hack a starship with a piece of paper Hyperchem Ma Tencent’s Xuanwu Lab http://xlab.tencent.com @XuanwuLab
  • 2. Who am I ? Security Researcher @ – Embedded Device Security – Firmware Reverse-Engineering – Big Fan of IoT
  • 3. Wait, hack a starship?
  • 4. 4
  • 8. Though often be ignored, barcode is the most ancient technology of IoT.
  • 9. What is barcode? •  Barcode is an optical machine-readable representation of data relating to the object to which it is attached; •  Originally barcodes(1D) systematically represented data by varying the widths and spacings of parallel lines.
  • 14. Barcode Symbology •  Every barcode includes: – Quiet Zone: Blank margin, No Information, Tell where barcode starts and stops; – Start character(s): Special pattern for barcode starts; – Data: Includes Numeric, Alpha-Numeric, Full ASCII chars depending on different barcode protocols; – Stop character(s): Special pattern for barcode ends. •  Some barcode have checksum bits/character(s)
  • 17. How Barcode Scanner Work Capturing Decoding Transferring RS232 PS/2 USB HID … Code 39 Code 128 QR Code … LED Laser CCD CMOS …
  • 19. Code 128 •  Full ASCII Encode Ability, Effictive and High-Density •  4 Function Codes Availiable For Manufacture •  Three Character Sets: CodeA,CodeB,CodeC – Unprintable ASCII can be encoded by CodeA – CodeC encodes only two-digit numbers – CharSets are chosen automatically – Encoder can hybridize three code sets
  • 20. In addition to supporting standard protocols, many manufacturers also typically implement some of their unique features in scanners.
  • 21. Scanner Manufactures •  Symbol (Zebra) •  HoneyWell •  TaoTronics •  ESky •  ACCESS IS •  UNITECH •  AIBO •  Newland •  Copycat products
  • 22. Barcode Scanner Is Everywhere
  • 24. Previous Work on Barcodes Security
  • 25. “Toying with Barcodes”, Phenoelit, 24C3 •  Barcode driven buffer overflow •  Barcode driven format string •  Barcode driven SQL injection •  Barcode driven XSS
  • 26. Other Scenarios •  Predict and recreate barcodes •  Duplicate barcodes •  Phishing attacks by QR code However, most of previous research focused on the application that do not properly process data from barcodes
  • 28. What is BadBarcode? •  Many barcode scanners are keyboard emulation device •  Some barcode protocols, like Code 128, supports ASCII control characters •  Almost every barcode scanner support Code 128 •  Almost every barcode scanner has its own additional keyboard emulation features So, is it possible to open a shell and “type” commands by barcodes like a keyboard?
  • 29. ASCII Table Hex ASCII Scan code Hex ASCII Scan code Hex ASCII Scan code 00 NUL CTRL+2 0B VT CTRL+K 16 SYN CTRL+V 01 SOH CTRL+A 0C FF CTRL+L 17 TB CTRL+W 02 STX CTRL+B 0D CR CTRL+M 18 CAN CTRL+X 03 ETX CTRL+C 0E SO CTRL+N 19 EM CTRL+Y 04 EOT CTRL+D 0F SI CTRL+O 1A SUB CTRL+Z 05 ENQ CTRL+E 10 DLE CTRL+P 1B ESC CTRL+[ 06 ACK CTRL+F 11 DC1 CTRL+Q 1C FS CTRL+ 07 BEL CTRL+G 12 DC2 CTRL+R 1D GS CTRL+] 08 BS CTRL+H 13 DC3 CTRL+S 1E RS CTRL+6 09 HT CTRL+I 14 DC4 CTRL+T 1F US CTRL+- 0A LF CTRL+J 15 NAK CTRL+U 7F DEL *
  • 30. ASCII Control Characters •  Combination key, like "Ctrl+ ", is mapped to a single ASCII code •  Encode these chars with Code 128 ,scan it with scanner, and finally a combination key was sent to computer •  No Win keys, Alt keys, or other function keys support •  Though only “Ctrl+*” keys can be sent, it still poses threat to kiosks! WHY?
  • 31. Dialog Attack •  Common Hotkeys are registered by many programs, like: CTRL+O, CTRL+P •  Hotkeys can launch common dialogs, like OpenFile, SaveFile, PrintDialog and etc •  These dialogs offer us opportunity to browse file system, launch browsers and execute program •  And the most essential thing is "Besides barcode scanner, touch screen is often available as input device in kiosks."
  • 32. Demo 1: Dialog Attack
  • 33. What about Win+R? If there is no touch screen, is it possible to make a blind attack?
  • 34. ADF(Advanced Data Formatting) •  Symbol Technologies Invent this •  Scanned data can be edited to suit particular requirements before transmitted to host device •  Specified Key can be sent to computer •  Set up ONLY by scanning barcodes!
  • 35. ADF Actions Examples Send data Send all or part of data Setup fields Move cursor Modify data Remove spaces and others Data padding Pad data with space or zero Beep Beep 1,2,3 times Send Keystrokes Send ctrl+, alt+,shft+ etc keys. Send GUI Keys Send GUI+ keys. Send Right Control Send right contrl stroke.
  • 36. Demo 2: ADF Attack
  • 37. Unfortunately, not all scanners support read barcodes from LCD/LED screen. Can this attack be cooler ? Can we do it automatically? What about making an android APP?
  • 38. Though scanners which read barcodes from LCD/LED screen exist, many of them read barcodes from materials which can absorb and reflect light of certain wavelength. However, LCD/LED screen display images by modulating backlight rather absorbing and reflecting lights, which means total black for barcode scanners.
  • 39. Display Technology •  CRT •  LCD •  OLED •  Electronic Paper
  • 40. The answer is Kindle •  Kindle use E-ink technology •  It display words and images based on absorb and reflect light, just like a paper •  High Resolution, Up to 300 PPI •  Programmable, of course after Jailbreak. Kindle is perfect BadBarcode tool !
  • 42. Can we execute a command by only one single barcode? Yes, for some products, it is possible
  • 43. But, the product in the next demo is widely used in many really serious places, like airports, so we would not disclose details this time Let’s just see the demo
  • 44. Demo 4: A Piece of Paper Attack
  • 45. Summary BadBarcode is not a vulnerability of a certain product. It’s even difficult to say that BadBarcode is the problem of scanners or host systems. So when we discovered BadBarcode, we even do not know which manufacturer should be reported. Although our demos is based on Windows, but in fact it can attack any system as long as there is appropriate hotkey.
  • 46. Summary •  BadBarcode is really a serious problem •  Host system using keyboard emulation barcode scanner is potentially vulnerable •  Kiosks with touch screen and barcode scanner are easy to be compromised •  Barcode scanner that support ADF or some special keyboard emulation features can be utilized to achieve automatic and advanced attack •  Other device via keyboard emulation connection might suffer from the same problem •  Keyboard Wedge RFID/NFC Reader ?
  • 47. Security Suggestions •  For barcode scanner manufactures – Do NOT enable ADF or other additional features by default – Do NOT transmit ASCII control characters to host device by default •  For host system manufactures – Do NOT use keyboard emulation barcode scanner as far as possible – Do NOT implement hotkeys in application, and disable system hotkeys
  • 48. Acknowledgement •  My leader : tombkeeper •  All team members in Xuanwu Lab
  • 49. Q&A