Hyperchem Ma, badbarcode en_1109_nocomment-final

PacSecJP
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
1 sur 49

Recommandé

Privreda osnovne karakteristike i podela par
Privreda osnovne karakteristike i podelaPrivreda osnovne karakteristike i podela
Privreda osnovne karakteristike i podelaprijicsolar
11.1K vues14 diapositives
Sekundarni sektor par
Sekundarni sektorSekundarni sektor
Sekundarni sektorprijicsolar
4.2K vues11 diapositives
Velicina i oblik teritorije drzave par
Velicina i oblik teritorije drzaveVelicina i oblik teritorije drzave
Velicina i oblik teritorije drzaveprijicsolar
7.4K vues13 diapositives
Razvijeni i nerazvijeni regioni u svetu par
Razvijeni i nerazvijeni regioni u svetuRazvijeni i nerazvijeni regioni u svetu
Razvijeni i nerazvijeni regioni u svetuprijicsolar
5.7K vues21 diapositives
Tercijarni sektor par
Tercijarni sektorTercijarni sektor
Tercijarni sektorprijicsolar
4.6K vues14 diapositives
Primarni sektor par
Primarni sektorPrimarni sektor
Primarni sektorprijicsolar
6.6K vues11 diapositives

Contenu connexe

Tendances

Polozaj, velicina i funkcije naselja par
Polozaj, velicina i funkcije naseljaPolozaj, velicina i funkcije naselja
Polozaj, velicina i funkcije naseljaprijicsolar
12.6K vues19 diapositives
Типови климе и загађивање атмосфере par
Типови климе и загађивање атмосфереТипови климе и загађивање атмосфере
Типови климе и загађивање атмосфереprijicsolar
3.6K vues26 diapositives
Kлиматски елементи par
Kлиматски елементиKлиматски елементи
Kлиматски елементиprijicsolar
10.2K vues29 diapositives
Пољопривреда основне одлике par
Пољопривреда  основне одликеПољопривреда  основне одлике
Пољопривреда основне одликеprijicsolar
7.1K vues12 diapositives
Шумарство par
ШумарствоШумарство
Шумарствоprijicsolar
2.1K vues10 diapositives
Atmosfera par
AtmosferaAtmosfera
AtmosferaTatjana Cakic
1.7K vues12 diapositives

Tendances(20)

Polozaj, velicina i funkcije naselja par prijicsolar
Polozaj, velicina i funkcije naseljaPolozaj, velicina i funkcije naselja
Polozaj, velicina i funkcije naselja
prijicsolar12.6K vues
Типови климе и загађивање атмосфере par prijicsolar
Типови климе и загађивање атмосфереТипови климе и загађивање атмосфере
Типови климе и загађивање атмосфере
prijicsolar3.6K vues
Kлиматски елементи par prijicsolar
Kлиматски елементиKлиматски елементи
Kлиматски елементи
prijicsolar10.2K vues
Пољопривреда основне одлике par prijicsolar
Пољопривреда  основне одликеПољопривреда  основне одлике
Пољопривреда основне одлике
prijicsolar7.1K vues
Шумарство par prijicsolar
ШумарствоШумарство
Шумарство
prijicsolar2.1K vues
Unutrasnja struktura, funkcije i veze grada sa okolnim prostorom par prijicsolar
Unutrasnja struktura, funkcije i veze grada sa okolnim prostoromUnutrasnja struktura, funkcije i veze grada sa okolnim prostorom
Unutrasnja struktura, funkcije i veze grada sa okolnim prostorom
prijicsolar7.1K vues
Привреда- основне карактеристике и подела par prijicsolar
Привреда- основне карактеристике и поделаПривреда- основне карактеристике и подела
Привреда- основне карактеристике и подела
prijicsolar9.4K vues
Сједињене Америчке Државе par prijicsolar
Сједињене Америчке ДржавеСједињене Америчке Државе
Сједињене Америчке Државе
prijicsolar1.8K vues
Загађивање и заштита воде, ваздуха и земљишта par prijicsolar
Загађивање и заштита воде, ваздуха и земљиштаЗагађивање и заштита воде, ваздуха и земљишта
Загађивање и заштита воде, ваздуха и земљишта
prijicsolar7.5K vues
Hidrosfera par lucidobg
HidrosferaHidrosfera
Hidrosfera
lucidobg9.5K vues
Broj stanovnika i gustina naseljenosti par prijicsolar
Broj stanovnika i gustina naseljenostiBroj stanovnika i gustina naseljenosti
Broj stanovnika i gustina naseljenosti
prijicsolar9.3K vues
Energetika par tanjamz
Energetika Energetika
Energetika
tanjamz8.9K vues
Glavni grad i oblik vladavine par prijicsolar
Glavni grad i oblik vladavineGlavni grad i oblik vladavine
Glavni grad i oblik vladavine
prijicsolar5.8K vues
Broj, razmeštaj i kretanje stanovnika na Zemlji par prijicsolar
Broj, razmeštaj i kretanje stanovnika na ZemljiBroj, razmeštaj i kretanje stanovnika na Zemlji
Broj, razmeštaj i kretanje stanovnika na Zemlji
prijicsolar2.3K vues

En vedette

Adam Laurie, Blue Toot -pacsec-2015 par
Adam Laurie, Blue Toot -pacsec-2015Adam Laurie, Blue Toot -pacsec-2015
Adam Laurie, Blue Toot -pacsec-2015PacSecJP
1.1K vues45 diapositives
Guang gong escalate privilege by vulnerabilities in android system services ... par
Guang gong  escalate privilege by vulnerabilities in android system services ...Guang gong  escalate privilege by vulnerabilities in android system services ...
Guang gong escalate privilege by vulnerabilities in android system services ...PacSecJP
581 vues34 diapositives
Mickey pac sec2016_final_ja par
Mickey pac sec2016_final_jaMickey pac sec2016_final_ja
Mickey pac sec2016_final_jaPacSecJP
480 vues33 diapositives
Marc schoenefeld grandma‘s old handbag_draft2_ja par
Marc schoenefeld grandma‘s old handbag_draft2_jaMarc schoenefeld grandma‘s old handbag_draft2_ja
Marc schoenefeld grandma‘s old handbag_draft2_jaPacSecJP
229 vues92 diapositives
James Forshaw, elevator action par
James Forshaw, elevator actionJames Forshaw, elevator action
James Forshaw, elevator actionPacSecJP
2.2K vues60 diapositives
Richard Johnson, high performance fuzzing par
Richard Johnson, high performance fuzzingRichard Johnson, high performance fuzzing
Richard Johnson, high performance fuzzingPacSecJP
2.3K vues48 diapositives

En vedette(20)

Adam Laurie, Blue Toot -pacsec-2015 par PacSecJP
Adam Laurie, Blue Toot -pacsec-2015Adam Laurie, Blue Toot -pacsec-2015
Adam Laurie, Blue Toot -pacsec-2015
PacSecJP1.1K vues
Guang gong escalate privilege by vulnerabilities in android system services ... par PacSecJP
Guang gong  escalate privilege by vulnerabilities in android system services ...Guang gong  escalate privilege by vulnerabilities in android system services ...
Guang gong escalate privilege by vulnerabilities in android system services ...
PacSecJP581 vues
Mickey pac sec2016_final_ja par PacSecJP
Mickey pac sec2016_final_jaMickey pac sec2016_final_ja
Mickey pac sec2016_final_ja
PacSecJP480 vues
Marc schoenefeld grandma‘s old handbag_draft2_ja par PacSecJP
Marc schoenefeld grandma‘s old handbag_draft2_jaMarc schoenefeld grandma‘s old handbag_draft2_ja
Marc schoenefeld grandma‘s old handbag_draft2_ja
PacSecJP229 vues
James Forshaw, elevator action par PacSecJP
James Forshaw, elevator actionJames Forshaw, elevator action
James Forshaw, elevator action
PacSecJP2.2K vues
Richard Johnson, high performance fuzzing par PacSecJP
Richard Johnson, high performance fuzzingRichard Johnson, high performance fuzzing
Richard Johnson, high performance fuzzing
PacSecJP2.3K vues
Richard high performance fuzzing ja par PacSecJP
Richard  high performance fuzzing jaRichard  high performance fuzzing ja
Richard high performance fuzzing ja
PacSecJP795 vues
James Windows10 elevator action final-jp par PacSecJP
James Windows10 elevator action final-jpJames Windows10 elevator action final-jp
James Windows10 elevator action final-jp
PacSecJP769 vues
Filippo, Plain simple reality of entropy par PacSecJP
Filippo, Plain simple reality of  entropyFilippo, Plain simple reality of  entropy
Filippo, Plain simple reality of entropy
PacSecJP2.8K vues
Georgi Geshev, warranty void if label removed par PacSecJP
Georgi Geshev,   warranty void if label removedGeorgi Geshev,   warranty void if label removed
Georgi Geshev, warranty void if label removed
PacSecJP4.5K vues
Andersson hacking ds_mx_with_sdr_pac_sec_2016_japanese par PacSecJP
Andersson hacking ds_mx_with_sdr_pac_sec_2016_japaneseAndersson hacking ds_mx_with_sdr_pac_sec_2016_japanese
Andersson hacking ds_mx_with_sdr_pac_sec_2016_japanese
PacSecJP332 vues
Martin Zeiser, Universal Pwn n Play - pacsec -final par PacSecJP
Martin Zeiser, Universal Pwn n Play - pacsec -finalMartin Zeiser, Universal Pwn n Play - pacsec -final
Martin Zeiser, Universal Pwn n Play - pacsec -final
PacSecJP1.5K vues
Martin UPnP - pacsec -final-ja par PacSecJP
Martin UPnP - pacsec -final-jaMartin UPnP - pacsec -final-ja
Martin UPnP - pacsec -final-ja
PacSecJP763 vues
Gang gong, escalate privilege by vulnerabilities in android system services par PacSecJP
Gang gong, escalate privilege by vulnerabilities in android system servicesGang gong, escalate privilege by vulnerabilities in android system services
Gang gong, escalate privilege by vulnerabilities in android system services
PacSecJP1.8K vues
Kochetova+osipv atm how_to_make_the_fraud__final par PacSecJP
Kochetova+osipv atm how_to_make_the_fraud__finalKochetova+osipv atm how_to_make_the_fraud__final
Kochetova+osipv atm how_to_make_the_fraud__final
PacSecJP607 vues
Qinghao vulnerabilities mining technology of cloud and virtualization platfo... par PacSecJP
Qinghao  vulnerabilities mining technology of cloud and virtualization platfo...Qinghao  vulnerabilities mining technology of cloud and virtualization platfo...
Qinghao vulnerabilities mining technology of cloud and virtualization platfo...
PacSecJP810 vues
Hyperchem bad barcode final_ja par PacSecJP
Hyperchem  bad barcode final_jaHyperchem  bad barcode final_ja
Hyperchem bad barcode final_ja
PacSecJP833 vues
Mickey, threats inside your platform final par PacSecJP
Mickey,  threats inside your platform finalMickey,  threats inside your platform final
Mickey, threats inside your platform final
PacSecJP4.5K vues
Adam blue toot pacsec-2015-jp par PacSecJP
Adam blue toot pacsec-2015-jpAdam blue toot pacsec-2015-jp
Adam blue toot pacsec-2015-jp
PacSecJP593 vues
Stuart attacking http2 implementations truefinal-jp par PacSecJP
Stuart  attacking http2 implementations truefinal-jpStuart  attacking http2 implementations truefinal-jp
Stuart attacking http2 implementations truefinal-jp
PacSecJP593 vues

Similaire à Hyperchem Ma, badbarcode en_1109_nocomment-final

Workshop 2016 Genebank IT - Print Barcode par
Workshop 2016 Genebank IT - Print BarcodeWorkshop 2016 Genebank IT - Print Barcode
Workshop 2016 Genebank IT - Print BarcodeEdwin Rojas
479 vues31 diapositives
Feasibility of Security in Micro-Controllers par
Feasibility of Security in Micro-ControllersFeasibility of Security in Micro-Controllers
Feasibility of Security in Micro-Controllersardiri
1.8K vues46 diapositives
HITBSecConf 2016-Create Your Own Bad Usb par
HITBSecConf 2016-Create Your Own Bad UsbHITBSecConf 2016-Create Your Own Bad Usb
HITBSecConf 2016-Create Your Own Bad UsbSeunghun han
385 vues46 diapositives
Barcode technology par
Barcode technologyBarcode technology
Barcode technologySubhash Vadadoriya
73.7K vues18 diapositives
Barcode Decoder par
Barcode DecoderBarcode Decoder
Barcode DecoderArijitDhali
169 vues14 diapositives
IDA Vulnerabilities and Bug Bounty  by Masaaki Chida par
IDA Vulnerabilities and Bug Bounty  by Masaaki ChidaIDA Vulnerabilities and Bug Bounty  by Masaaki Chida
IDA Vulnerabilities and Bug Bounty  by Masaaki ChidaCODE BLUE
4K vues21 diapositives

Similaire à Hyperchem Ma, badbarcode en_1109_nocomment-final(20)

Workshop 2016 Genebank IT - Print Barcode par Edwin Rojas
Workshop 2016 Genebank IT - Print BarcodeWorkshop 2016 Genebank IT - Print Barcode
Workshop 2016 Genebank IT - Print Barcode
Edwin Rojas479 vues
Feasibility of Security in Micro-Controllers par ardiri
Feasibility of Security in Micro-ControllersFeasibility of Security in Micro-Controllers
Feasibility of Security in Micro-Controllers
ardiri1.8K vues
HITBSecConf 2016-Create Your Own Bad Usb par Seunghun han
HITBSecConf 2016-Create Your Own Bad UsbHITBSecConf 2016-Create Your Own Bad Usb
HITBSecConf 2016-Create Your Own Bad Usb
Seunghun han385 vues
IDA Vulnerabilities and Bug Bounty  by Masaaki Chida par CODE BLUE
IDA Vulnerabilities and Bug Bounty  by Masaaki ChidaIDA Vulnerabilities and Bug Bounty  by Masaaki Chida
IDA Vulnerabilities and Bug Bounty  by Masaaki Chida
CODE BLUE4K vues
Embedded system design process par Rayees CK
Embedded system design processEmbedded system design process
Embedded system design process
Rayees CK27.8K vues
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for... par Alexandre Moneger
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
Reversing Mobile - Swiss Cyber Storm 2011, Switzerland par SignalSEC Ltd.
Reversing Mobile - Swiss Cyber Storm 2011, SwitzerlandReversing Mobile - Swiss Cyber Storm 2011, Switzerland
Reversing Mobile - Swiss Cyber Storm 2011, Switzerland
SignalSEC Ltd.422 vues
Tools Of The Hardware Hacking Trade Final par Priyanka Aash
Tools Of The Hardware Hacking Trade FinalTools Of The Hardware Hacking Trade Final
Tools Of The Hardware Hacking Trade Final
Priyanka Aash2.1K vues
Is Rust Programming ready for embedded development? par Knoldus Inc.
Is Rust Programming ready for embedded development?Is Rust Programming ready for embedded development?
Is Rust Programming ready for embedded development?
Knoldus Inc.188 vues
Arduino by yogesh t s' par tsyogesh46
Arduino by yogesh t s'Arduino by yogesh t s'
Arduino by yogesh t s'
tsyogesh46339 vues
Breaking Smart Speakers: We are Listening to You. par Priyanka Aash
Breaking Smart Speakers: We are Listening to You.Breaking Smart Speakers: We are Listening to You.
Breaking Smart Speakers: We are Listening to You.
Priyanka Aash1.2K vues
.NET Debugging Tips and Techniques par Bala Subra
.NET Debugging Tips and Techniques.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques
Bala Subra2.1K vues
.Net Debugging Techniques par Bala Subra
.Net Debugging Techniques.Net Debugging Techniques
.Net Debugging Techniques
Bala Subra4K vues
2015 02 28 DotNetSpain IoT Fight par Bruno Capuano
2015 02 28 DotNetSpain IoT Fight2015 02 28 DotNetSpain IoT Fight
2015 02 28 DotNetSpain IoT Fight
Bruno Capuano1.9K vues

Plus de PacSecJP

Kavya racharla ndh-naropanth_fin_jp-final par
Kavya racharla ndh-naropanth_fin_jp-finalKavya racharla ndh-naropanth_fin_jp-final
Kavya racharla ndh-naropanth_fin_jp-finalPacSecJP
1.7K vues38 diapositives
Ryder robertson security-considerations_in_the_supply_chain_2017.11.02 par
Ryder robertson security-considerations_in_the_supply_chain_2017.11.02Ryder robertson security-considerations_in_the_supply_chain_2017.11.02
Ryder robertson security-considerations_in_the_supply_chain_2017.11.02PacSecJP
571 vues24 diapositives
Ryder robertson pac-sec skeleton 2017_jp par
Ryder robertson pac-sec skeleton 2017_jpRyder robertson pac-sec skeleton 2017_jp
Ryder robertson pac-sec skeleton 2017_jpPacSecJP
606 vues24 diapositives
Yuki chen from_out_of_memory_to_remote_code_execution_pac_sec2017_final-j par
Yuki chen from_out_of_memory_to_remote_code_execution_pac_sec2017_final-jYuki 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-jPacSecJP
526 vues83 diapositives
Yuki chen from_out_of_memory_to_remote_code_execution_pac_sec2017_final par
Yuki chen from_out_of_memory_to_remote_code_execution_pac_sec2017_finalYuki chen from_out_of_memory_to_remote_code_execution_pac_sec2017_final
Yuki chen from_out_of_memory_to_remote_code_execution_pac_sec2017_finalPacSecJP
1.4K vues83 diapositives
Rouault imbert view_alpc_rpc_pacsec_jp par
Rouault imbert view_alpc_rpc_pacsec_jpRouault imbert view_alpc_rpc_pacsec_jp
Rouault imbert view_alpc_rpc_pacsec_jpPacSecJP
421 vues50 diapositives

Plus de PacSecJP(20)

Kavya racharla ndh-naropanth_fin_jp-final par PacSecJP
Kavya racharla ndh-naropanth_fin_jp-finalKavya racharla ndh-naropanth_fin_jp-final
Kavya racharla ndh-naropanth_fin_jp-final
PacSecJP1.7K vues
Ryder robertson security-considerations_in_the_supply_chain_2017.11.02 par PacSecJP
Ryder robertson security-considerations_in_the_supply_chain_2017.11.02Ryder robertson security-considerations_in_the_supply_chain_2017.11.02
Ryder robertson security-considerations_in_the_supply_chain_2017.11.02
PacSecJP571 vues
Ryder robertson pac-sec skeleton 2017_jp par PacSecJP
Ryder robertson pac-sec skeleton 2017_jpRyder robertson pac-sec skeleton 2017_jp
Ryder robertson pac-sec skeleton 2017_jp
PacSecJP606 vues
Yuki chen from_out_of_memory_to_remote_code_execution_pac_sec2017_final-j par PacSecJP
Yuki chen from_out_of_memory_to_remote_code_execution_pac_sec2017_final-jYuki 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-j
PacSecJP526 vues
Yuki chen from_out_of_memory_to_remote_code_execution_pac_sec2017_final par PacSecJP
Yuki chen from_out_of_memory_to_remote_code_execution_pac_sec2017_finalYuki chen from_out_of_memory_to_remote_code_execution_pac_sec2017_final
Yuki chen from_out_of_memory_to_remote_code_execution_pac_sec2017_final
PacSecJP1.4K vues
Rouault imbert view_alpc_rpc_pacsec_jp par PacSecJP
Rouault imbert view_alpc_rpc_pacsec_jpRouault imbert view_alpc_rpc_pacsec_jp
Rouault imbert view_alpc_rpc_pacsec_jp
PacSecJP421 vues
Rouault imbert alpc_rpc_pacsec par PacSecJP
Rouault imbert alpc_rpc_pacsecRouault imbert alpc_rpc_pacsec
Rouault imbert alpc_rpc_pacsec
PacSecJP1K vues
Di shen pacsec_jp-final par PacSecJP
Di shen pacsec_jp-finalDi shen pacsec_jp-final
Di shen pacsec_jp-final
PacSecJP445 vues
Di shen pacsec_final par PacSecJP
Di shen pacsec_finalDi shen pacsec_final
Di shen pacsec_final
PacSecJP536 vues
Anıl kurmuş pacsec3-ja par PacSecJP
Anıl kurmuş pacsec3-jaAnıl kurmuş pacsec3-ja
Anıl kurmuş pacsec3-ja
PacSecJP253 vues
Anıl kurmuş pacsec3 par PacSecJP
Anıl kurmuş pacsec3Anıl kurmuş pacsec3
Anıl kurmuş pacsec3
PacSecJP483 vues
Ahn pacsec2017 key-recovery_attacks_against_commercial_white-box_cryptography... par PacSecJP
Ahn pacsec2017 key-recovery_attacks_against_commercial_white-box_cryptography...Ahn pacsec2017 key-recovery_attacks_against_commercial_white-box_cryptography...
Ahn pacsec2017 key-recovery_attacks_against_commercial_white-box_cryptography...
PacSecJP264 vues
Ahn pacsec2017 key-recovery_attacks_against_commercial_white-box_cryptography... par PacSecJP
Ahn pacsec2017 key-recovery_attacks_against_commercial_white-box_cryptography...Ahn pacsec2017 key-recovery_attacks_against_commercial_white-box_cryptography...
Ahn pacsec2017 key-recovery_attacks_against_commercial_white-box_cryptography...
PacSecJP336 vues
Yunusov babin 7sins-pres_atm_v4(2)_jp par PacSecJP
Yunusov babin 7sins-pres_atm_v4(2)_jpYunusov babin 7sins-pres_atm_v4(2)_jp
Yunusov babin 7sins-pres_atm_v4(2)_jp
PacSecJP249 vues
Yunusov babin 7 sins pres atm v2 par PacSecJP
Yunusov babin 7 sins pres atm v2Yunusov babin 7 sins pres atm v2
Yunusov babin 7 sins pres atm v2
PacSecJP341 vues
Shusei tomonaga pac_sec_20171026_jp par PacSecJP
Shusei tomonaga pac_sec_20171026_jpShusei tomonaga pac_sec_20171026_jp
Shusei tomonaga pac_sec_20171026_jp
PacSecJP356 vues
Shusei tomonaga pac_sec_20171026 par PacSecJP
Shusei tomonaga pac_sec_20171026Shusei tomonaga pac_sec_20171026
Shusei tomonaga pac_sec_20171026
PacSecJP447 vues
Kavya racharla ndh-naropanth_fin par PacSecJP
Kavya racharla ndh-naropanth_finKavya racharla ndh-naropanth_fin
Kavya racharla ndh-naropanth_fin
PacSecJP473 vues
Lucas apa pacsec_slides_jp-final par PacSecJP
Lucas apa pacsec_slides_jp-finalLucas apa pacsec_slides_jp-final
Lucas apa pacsec_slides_jp-final
PacSecJP546 vues
Lucas apa pacsec slides par PacSecJP
Lucas apa pacsec slidesLucas apa pacsec slides
Lucas apa pacsec slides
PacSecJP590 vues

Dernier

the internet.pptx par
the internet.pptxthe internet.pptx
the internet.pptxSrihariJena
6 vues9 diapositives
Liberando a produccion con confidencia.pdf par
Liberando a produccion con confidencia.pdfLiberando a produccion con confidencia.pdf
Liberando a produccion con confidencia.pdfAndres Almiray
8 vues49 diapositives
40th TWNIC OPM: On LEOs (Low Earth Orbits) and Starlink Download par
40th TWNIC OPM: On LEOs (Low Earth Orbits) and Starlink Download40th TWNIC OPM: On LEOs (Low Earth Orbits) and Starlink Download
40th TWNIC OPM: On LEOs (Low Earth Orbits) and Starlink DownloadAPNIC
159 vues30 diapositives
Penetration Testing for Cybersecurity Professionals par
Penetration Testing for Cybersecurity ProfessionalsPenetration Testing for Cybersecurity Professionals
Penetration Testing for Cybersecurity Professionals211 Check
52 vues17 diapositives
ATPMOUSE_융합2조.pptx par
ATPMOUSE_융합2조.pptxATPMOUSE_융합2조.pptx
ATPMOUSE_융합2조.pptxkts120898
35 vues70 diapositives
Cracking the Code Decoding Leased Line Quotes for Connectivity Excellence.pptx par
Cracking the Code Decoding Leased Line Quotes for Connectivity Excellence.pptxCracking the Code Decoding Leased Line Quotes for Connectivity Excellence.pptx
Cracking the Code Decoding Leased Line Quotes for Connectivity Excellence.pptxLeasedLinesQuote
5 vues8 diapositives

Dernier(15)

Liberando a produccion con confidencia.pdf par Andres Almiray
Liberando a produccion con confidencia.pdfLiberando a produccion con confidencia.pdf
Liberando a produccion con confidencia.pdf
40th TWNIC OPM: On LEOs (Low Earth Orbits) and Starlink Download par APNIC
40th TWNIC OPM: On LEOs (Low Earth Orbits) and Starlink Download40th TWNIC OPM: On LEOs (Low Earth Orbits) and Starlink Download
40th TWNIC OPM: On LEOs (Low Earth Orbits) and Starlink Download
APNIC159 vues
Penetration Testing for Cybersecurity Professionals par 211 Check
Penetration Testing for Cybersecurity ProfessionalsPenetration Testing for Cybersecurity Professionals
Penetration Testing for Cybersecurity Professionals
211 Check52 vues
ATPMOUSE_융합2조.pptx par kts120898
ATPMOUSE_융합2조.pptxATPMOUSE_융합2조.pptx
ATPMOUSE_융합2조.pptx
kts12089835 vues
Cracking the Code Decoding Leased Line Quotes for Connectivity Excellence.pptx par LeasedLinesQuote
Cracking the Code Decoding Leased Line Quotes for Connectivity Excellence.pptxCracking the Code Decoding Leased Line Quotes for Connectivity Excellence.pptx
Cracking the Code Decoding Leased Line Quotes for Connectivity Excellence.pptx
40th TWNIC Open Policy Meeting: A quick look at QUIC par APNIC
40th TWNIC Open Policy Meeting: A quick look at QUIC40th TWNIC Open Policy Meeting: A quick look at QUIC
40th TWNIC Open Policy Meeting: A quick look at QUIC
APNIC152 vues
The Dark Web : Hidden Services par Anshu Singh
The Dark Web : Hidden ServicesThe Dark Web : Hidden Services
The Dark Web : Hidden Services
Anshu Singh23 vues
40th TWNIC Open Policy Meeting: APNIC PDP update par APNIC
40th TWNIC Open Policy Meeting: APNIC PDP update40th TWNIC Open Policy Meeting: APNIC PDP update
40th TWNIC Open Policy Meeting: APNIC PDP update
APNIC151 vues

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