SlideShare a Scribd company logo
Making and breaking 
security in embedded 
devices 
Yashin Mehaboobe 
SDR Engineer, Bastille Networks
#whoami 
•Security enthusiast 
•SDR Engineer @ Bastille Networks 
•Hardware tinkerer 
•Speaker: C0C0n 2013, Nullcon V, HITB Amsterdam and Kaspersky Cyberconference 
•Organiser, Defcon Kerala 
twitter.com/YashinMehaboobe 
github.com/sp3ctr3 
http://www.linkedin.com/pub/yashin-mehaboobe/38/a2/367
Why embedded? 
•Large numbers 
•Critical infrastructure dependent on embedded devices 
•Network devices (both enterprise and SOHO) 
•Even if it’s not critical: 
•Botnet fodder 
•Pivoting 
•Storage for the bad guys 
•On the internet and unsecured (Mostly)
But…..why?! 
•REPRODUCTION: 
•Understand how the product works by reverse engineering it 
•Build a similar product 
•$$$$$Profit$$$$$$$$ 
•FREE STUFF!: 
•Bypass restrictions 
•Get premium services 
•UNLOCKING FEATURES: 
•Ex:Install dd-wrt 
•Don’t have to pay extra
But…..why?! 
•ACCESS TO OTHERWISE SECURE NETWORKS 
•No one expects the embedded inquisition! 
•SOHO/Enterprise routers are not audited most times 
•No one checks the firmware
TOOLS OF THE TRADE 
Choose your weapons!
Making and breaking security in embedded devices
A word about equipment 
•Good equipment = $$$$ 
•Use open source equipment such as the bus pirate, hackRF, OpenBench etc… 
•Commercial tools work better in most of the cases 
•Would be a good investment 
•Have at least one each of the separate categories of tools 
•Logic Analyzer 
•RF Spectrum Analyzer 
•Oscilloscope 
•JTAG debugger 
•Etc……
LOGIC ANALYZERS 
•Monitor communication 
•Decode protocols 
•Replay (in some cases) 
•Cheap (44$ to 500$++) 
•Open source ones: 
•Open Bench 
•Bus Pirate
Making and breaking security in embedded devices
RF Analysis tools 
•For scanning the RF frequencies 
•Recognizing signals 
•Storing and replay 
•SDRs are your friends! 
•Example: 
•RFExplorer 
•RTL-SDR 
•HackRF/BladeRF/USRP
Oscilloscope 
•Digital/Analog 
•Useful for noting timing 
•Can also help in recognition of 
communication protocol 
•Very much needed
Debug Ports
Debug ports FTW 
•Ports setup to allow developer/engineer access during testing/repairing 
•Loved by hackers because of the access it provides 
•Different types: 
•JTAG 
•Serial 
•LPC (Xbox/TPM) 
•Allow access to boot messages 
•Allows you to log in without authentication 
•Sometimes you can even access bash
Debug ports identification 
1.Identify the ports 
2.Connect the debugger/communication device 
3.Profit! 
•First step is the most complex 
•Methodology varies from protocol to protocol 
•Number of points is a good indication
Identifying Serial ports 
•Serial has 4 lines: 
•Vcc 
•Ground 
•Rx 
•Tx 
•Identify ground pin with a multimeter continuity test 
•Find vcc by powering up and checking vcc + ground with multimeter 
•Tx will be the pin with high activity 
•Rx will be the other 
•Identify baudrate by trial and error 
•JTAGulator has support for serial
JTAG ports 
•Joint Test Action Group 
•Used for debugging, updating firmware etc… 
•Running homebrew on Xbox 
•Dumping firmware 
•Use JTAGulator for finding JTAG ports 
•OpenOCD has support for a large number of JTAG 
debuggers
Defending against debug port attacks 
•Disable unneeded ports 
•Use authentication for the debug ports 
•Shell access should not be given without authentication 
•Unfortunately these defenses may not be practical in some cases
Electronic bus attacks
SPI,UART and I2C 
•SPI, UART and I2c are some of the more commonly used protocols in embedded 
devices 
•There is no authentication or authorization 
•It is trivial to sniff traffic 
•Very easy to replay attacks 
•Bus pirate would be a good tool 
•Hardware hackers swiss army knife 
•Developed by Dangerous Prototypes
Radio communication
Sniffing radio signals 
•Use to be hard and expensive 
•With the arrival of SDRs the situation changed 
•Now you can RX and TX with hardware ranging from 20$ RTL SDR to 1000$ devices 
•Most signals aren’t encrypted 
•Some rely on FHSS (Not a good idea)
Tools used 
•For most radio communication attacks an SDR would suffice 
•Mainly because they can TX and RX in a wide range of frequencies 
•Some examples are 
•USRP B210 
•HackRF 
•BladeRF 
•RTLSDR 
•You can also use RFCat (cc1111 based attack toolkit) 
•Ubertooth One can be used for Bluetooth sniffing 
•OR sniff the buses of the transmitter
RF attacks 
•Jamming 
•Basically DoS at RF level 
•Decreases SNR 
•Techniques differ 
•Some even disrupt handshakes 
•Replay 
•Capture signal 
•Store it 
•Replay at some other time
Defenses against RF attacks 
•FHSS is effective against jamming 
•Use of encryption will defeat most sniffing attacks 
•Encryption is built into most transmitters 
•Unfortunately it is not used as much as it should be 
•Rolling code system is a good defense against replay attack
Flash memory forensics
Flash memory 
•Nonvolatile 
•Used to store data 
•Firmware is usually stored in flash memory 
•Usually uses SPI for communication 
•Usually does not have any protection
Extracting data from flash memory 
•In circuit: 
•Don’t remove the chip 
•Use a chip programmer or bus pirate to read data 
•Desoldering 
•The chip should be removed by desoldering it. 
•It is then accessed using a chip programmer to get the data 
•Firmware can be extracted in this manner
Defenses against Flash memory 
forensics 
•OTP memory protection bits 
•Doesn’t allow the modification of flash memory 
•Only useful against modification attacks 
•Encryption 
•Storing the firmware/data encrypted would defeat memory forensics 
•Also not storing confidential info on the chip
Firmware/Code Analysis
(In)Security 
•Code is outdated in most devices 
•Routers are the worst transgressors 
•Most are internet facing 
•Have more vulns than a CTF challenge 
•Code is available for us to check and find vulns
Firmware 
•Almost always linux 
•Bootloader is usually Uboot 
•Serial output usually gives you hints about the device 
•Some may be obfuscated 
•Can be obtained by either: 
•JTAG dump 
•Flash dump via Serial 
•Flash dump via chip desoldering 
•From the company website
Analysing firmware 
•Usually various sections wrapped into one bin file 
•You can use dd to separate 
•Best option is to use binwalk 
•Binwalk is a tool by Craig (of devttys0 blog(great resource for hw reversing)) 
•Automatically analyze and extract firmware files
Making and breaking security in embedded devices
Defenses 
•Review your code! 
•Obfuscate your firmware 
•Review your code again!
Invasive attacks
Invasion of chips 
•Pretty easy to notice 
•Chips will be desoldered and/or destroyed in the process 
•Processors are mapped using microscopes 
•Very complicated attacks 
•Usually done for replication of chips
Resources 
Stuff that helped me and may help you
Blogs 
•http://www.devttys0.com/ 
•http://www.bunniestudios.com/ 
•http://travisgoodspeed.blogspot.com 
•http://www.grandideastudio.com/
Thanks! 
Questions?

More Related Content

PDF
Hardware Reverse Engineering: From Boot to Root
PPTX
PyTriage: A malware analysis framework
PPTX
Hardware Hacking Primer
PPTX
Advanced SOHO Router Exploitation XCON
PDF
A BEGINNER’S JOURNEY INTO THE WORLD OF HARDWARE HACKING
PPTX
Hardware hacking 101
PPTX
Practical Security Assessments of IoT Devices and Systems
PDF
Intro to Hardware Firmware Hacking
Hardware Reverse Engineering: From Boot to Root
PyTriage: A malware analysis framework
Hardware Hacking Primer
Advanced SOHO Router Exploitation XCON
A BEGINNER’S JOURNEY INTO THE WORLD OF HARDWARE HACKING
Hardware hacking 101
Practical Security Assessments of IoT Devices and Systems
Intro to Hardware Firmware Hacking

What's hot (20)

PPT
Attacking Embedded Devices (No Axe Required)
PDF
Arduino Forensics
PDF
Cracking Into Embedded Devices - Hack in The Box Dubai 2008
PDF
CODE BLUE 2014 : DeviceDisEnabler : A hypervisor which hides devices to prote...
PPTX
Hacker's and painters Hardware Hacking 101 - 10th Oct 2014
PPTX
PDF
Top 10 secure boot mistakes
PPTX
Security Testing: Fuzzing
PDF
How to hide your browser 0-days
PPTX
Ransomware - what is it, how to protect against it
PPT
Wireless security testing with attack by Keiichi Horiai - CODE BLUE 2015
PDF
BlackHat Asia 2017-Myth and Truth about Hypervisor-Based Kernel Protector
PDF
BSides DFW2016-Hack Mode Enabled
PDF
HITBSecConf 2017-Shadow-Box-the Practical and Omnipotent Sandbox
PPTX
ShinoBOT Suite
PDF
CODE BLUE 2014 : Embedded Security in The Land of the Rising Sun by BEN SCHMI...
PDF
Kavya racharla ndh-naropanth_fin
PDF
A Hypervisor IPS based on Hardware Assisted Virtualization Technology
PDF
HITBSecConf 2016-Create Your Own Bad Usb
PDF
CODE BLUE 2014 : [Keynote] IDA and digital security by Ilfak Guilfanov
Attacking Embedded Devices (No Axe Required)
Arduino Forensics
Cracking Into Embedded Devices - Hack in The Box Dubai 2008
CODE BLUE 2014 : DeviceDisEnabler : A hypervisor which hides devices to prote...
Hacker's and painters Hardware Hacking 101 - 10th Oct 2014
Top 10 secure boot mistakes
Security Testing: Fuzzing
How to hide your browser 0-days
Ransomware - what is it, how to protect against it
Wireless security testing with attack by Keiichi Horiai - CODE BLUE 2015
BlackHat Asia 2017-Myth and Truth about Hypervisor-Based Kernel Protector
BSides DFW2016-Hack Mode Enabled
HITBSecConf 2017-Shadow-Box-the Practical and Omnipotent Sandbox
ShinoBOT Suite
CODE BLUE 2014 : Embedded Security in The Land of the Rising Sun by BEN SCHMI...
Kavya racharla ndh-naropanth_fin
A Hypervisor IPS based on Hardware Assisted Virtualization Technology
HITBSecConf 2016-Create Your Own Bad Usb
CODE BLUE 2014 : [Keynote] IDA and digital security by Ilfak Guilfanov
Ad

Viewers also liked (20)

PPTX
PACE-IT: Securing the Workstation
PPTX
Pace IT - Setting Up a SOHO Network
PPTX
Embedded Systems, Asset or Security Threat? (6 May 2014, (ICS)2 Secure Rotter...
PPTX
Securing embedded systems (for share)
PPTX
Network Security: Protecting SOHO Networks
PPTX
Embedded based home security system
PDF
Enabling embedded security for the Internet of Things
PPTX
Security in embedded systems
PDF
Embedded Systems Security
PDF
Embedded Systems Security: Building a More Secure Device
PPT
Network security and protocols
PDF
Security in Embedded systems
PPTX
introduction to Embedded System Security
PDF
The Internet Of Insecure Things: 10 Most Wanted List - Derbycon 2014
PPT
PDF
Resource Public Key Infrastructure (RPKI)
PPTX
ppt on embedded system
PPT
Firewall
PPT
Firewall
 
PPTX
Firewall presentation
PACE-IT: Securing the Workstation
Pace IT - Setting Up a SOHO Network
Embedded Systems, Asset or Security Threat? (6 May 2014, (ICS)2 Secure Rotter...
Securing embedded systems (for share)
Network Security: Protecting SOHO Networks
Embedded based home security system
Enabling embedded security for the Internet of Things
Security in embedded systems
Embedded Systems Security
Embedded Systems Security: Building a More Secure Device
Network security and protocols
Security in Embedded systems
introduction to Embedded System Security
The Internet Of Insecure Things: 10 Most Wanted List - Derbycon 2014
Resource Public Key Infrastructure (RPKI)
ppt on embedded system
Firewall
Firewall
 
Firewall presentation
Ad

Similar to Making and breaking security in embedded devices (20)

PDF
Reverse engineering
PDF
SIGFOX Makers Tour - Madrid
PDF
Breaking Smart Speakers: We are Listening to You.
PPTX
Steelcon 2015 - 0wning the internet of trash
PDF
DEF CON 27 - XIAOHUIHUI - all the 4g modules could be hacked
PDF
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
PDF
Practical reverse engineering and exploit development for AVR-based Embedded ...
PDF
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
PDF
Socially Acceptable Methods to Walk in the Front Door
PDF
BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...
PDF
Coporate Espionage
PPTX
How to Build Your Own Physical Pentesting Go-bag
PPT
PDF
Workshop on Network Security
PPTX
Presentation1
PDF
DefCon 2012 - Gaining Access to User Android Data
PDF
SIGFOX Makers Tour - Barcelona
PDF
Insecure Obsolete and Trivial - The Real IOT
PPTX
Security Onion
PDF
Burp suite
Reverse engineering
SIGFOX Makers Tour - Madrid
Breaking Smart Speakers: We are Listening to You.
Steelcon 2015 - 0wning the internet of trash
DEF CON 27 - XIAOHUIHUI - all the 4g modules could be hacked
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical reverse engineering and exploit development for AVR-based Embedded ...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
Socially Acceptable Methods to Walk in the Front Door
BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...
Coporate Espionage
How to Build Your Own Physical Pentesting Go-bag
Workshop on Network Security
Presentation1
DefCon 2012 - Gaining Access to User Android Data
SIGFOX Makers Tour - Barcelona
Insecure Obsolete and Trivial - The Real IOT
Security Onion
Burp suite

Recently uploaded (20)

PDF
-DIGITAL-INDIA.pdf one of the most prominent
PPTX
02fdgfhfhfhghghhhhhhhhhhhhhhhhhhhhh.pptx
PPTX
quadraticequations-111211090004-phpapp02.pptx
PDF
Core Components of IoT, The elements need for IOT
PPTX
Embeded System for Artificial intelligence 2.pptx
PPTX
STEEL- intro-1.pptxhejwjenwnwnenemwmwmwm
PPTX
ERP good ERP good ERP good ERP good good ERP good ERP good
PPTX
figurative-languagepowerpoint-150309132252-conversion-gate01.pptx
PDF
Prescription1 which to be used for periodo
PPTX
Operating System Processes_Scheduler OSS
PPTX
1.pptxsadafqefeqfeqfeffeqfqeqfeqefqfeqfqeffqe
PPTX
KVL KCL ppt electrical electronics eee tiet
PPTX
sdn_based_controller_for_mobile_network_traffic_management1.pptx
PDF
How NGOs Save Costs with Affordable IT Rentals
PPTX
kvjhvhjvhjhjhjghjghjgjhgjhgjhgjhgjhgjhgjhgjh
PDF
Layer23-Switch.com The Cisco Catalyst 9300 Series is Cisco’s flagship stackab...
PDF
Chapter -24-By Dr Sajid Ali Ansari 2021.pdf
PPTX
PROGRAMMING-QUARTER-2-PYTHON.pptxnsnsndn
PPTX
Lecture-3-Computer-programming for BS InfoTech
PPTX
"Fundamentals of Digital Image Processing: A Visual Approach"
-DIGITAL-INDIA.pdf one of the most prominent
02fdgfhfhfhghghhhhhhhhhhhhhhhhhhhhh.pptx
quadraticequations-111211090004-phpapp02.pptx
Core Components of IoT, The elements need for IOT
Embeded System for Artificial intelligence 2.pptx
STEEL- intro-1.pptxhejwjenwnwnenemwmwmwm
ERP good ERP good ERP good ERP good good ERP good ERP good
figurative-languagepowerpoint-150309132252-conversion-gate01.pptx
Prescription1 which to be used for periodo
Operating System Processes_Scheduler OSS
1.pptxsadafqefeqfeqfeffeqfqeqfeqefqfeqfqeffqe
KVL KCL ppt electrical electronics eee tiet
sdn_based_controller_for_mobile_network_traffic_management1.pptx
How NGOs Save Costs with Affordable IT Rentals
kvjhvhjvhjhjhjghjghjgjhgjhgjhgjhgjhgjhgjhgjh
Layer23-Switch.com The Cisco Catalyst 9300 Series is Cisco’s flagship stackab...
Chapter -24-By Dr Sajid Ali Ansari 2021.pdf
PROGRAMMING-QUARTER-2-PYTHON.pptxnsnsndn
Lecture-3-Computer-programming for BS InfoTech
"Fundamentals of Digital Image Processing: A Visual Approach"

Making and breaking security in embedded devices

  • 1. Making and breaking security in embedded devices Yashin Mehaboobe SDR Engineer, Bastille Networks
  • 2. #whoami •Security enthusiast •SDR Engineer @ Bastille Networks •Hardware tinkerer •Speaker: C0C0n 2013, Nullcon V, HITB Amsterdam and Kaspersky Cyberconference •Organiser, Defcon Kerala twitter.com/YashinMehaboobe github.com/sp3ctr3 http://www.linkedin.com/pub/yashin-mehaboobe/38/a2/367
  • 3. Why embedded? •Large numbers •Critical infrastructure dependent on embedded devices •Network devices (both enterprise and SOHO) •Even if it’s not critical: •Botnet fodder •Pivoting •Storage for the bad guys •On the internet and unsecured (Mostly)
  • 4. But…..why?! •REPRODUCTION: •Understand how the product works by reverse engineering it •Build a similar product •$$$$$Profit$$$$$$$$ •FREE STUFF!: •Bypass restrictions •Get premium services •UNLOCKING FEATURES: •Ex:Install dd-wrt •Don’t have to pay extra
  • 5. But…..why?! •ACCESS TO OTHERWISE SECURE NETWORKS •No one expects the embedded inquisition! •SOHO/Enterprise routers are not audited most times •No one checks the firmware
  • 6. TOOLS OF THE TRADE Choose your weapons!
  • 8. A word about equipment •Good equipment = $$$$ •Use open source equipment such as the bus pirate, hackRF, OpenBench etc… •Commercial tools work better in most of the cases •Would be a good investment •Have at least one each of the separate categories of tools •Logic Analyzer •RF Spectrum Analyzer •Oscilloscope •JTAG debugger •Etc……
  • 9. LOGIC ANALYZERS •Monitor communication •Decode protocols •Replay (in some cases) •Cheap (44$ to 500$++) •Open source ones: •Open Bench •Bus Pirate
  • 11. RF Analysis tools •For scanning the RF frequencies •Recognizing signals •Storing and replay •SDRs are your friends! •Example: •RFExplorer •RTL-SDR •HackRF/BladeRF/USRP
  • 12. Oscilloscope •Digital/Analog •Useful for noting timing •Can also help in recognition of communication protocol •Very much needed
  • 14. Debug ports FTW •Ports setup to allow developer/engineer access during testing/repairing •Loved by hackers because of the access it provides •Different types: •JTAG •Serial •LPC (Xbox/TPM) •Allow access to boot messages •Allows you to log in without authentication •Sometimes you can even access bash
  • 15. Debug ports identification 1.Identify the ports 2.Connect the debugger/communication device 3.Profit! •First step is the most complex •Methodology varies from protocol to protocol •Number of points is a good indication
  • 16. Identifying Serial ports •Serial has 4 lines: •Vcc •Ground •Rx •Tx •Identify ground pin with a multimeter continuity test •Find vcc by powering up and checking vcc + ground with multimeter •Tx will be the pin with high activity •Rx will be the other •Identify baudrate by trial and error •JTAGulator has support for serial
  • 17. JTAG ports •Joint Test Action Group •Used for debugging, updating firmware etc… •Running homebrew on Xbox •Dumping firmware •Use JTAGulator for finding JTAG ports •OpenOCD has support for a large number of JTAG debuggers
  • 18. Defending against debug port attacks •Disable unneeded ports •Use authentication for the debug ports •Shell access should not be given without authentication •Unfortunately these defenses may not be practical in some cases
  • 20. SPI,UART and I2C •SPI, UART and I2c are some of the more commonly used protocols in embedded devices •There is no authentication or authorization •It is trivial to sniff traffic •Very easy to replay attacks •Bus pirate would be a good tool •Hardware hackers swiss army knife •Developed by Dangerous Prototypes
  • 22. Sniffing radio signals •Use to be hard and expensive •With the arrival of SDRs the situation changed •Now you can RX and TX with hardware ranging from 20$ RTL SDR to 1000$ devices •Most signals aren’t encrypted •Some rely on FHSS (Not a good idea)
  • 23. Tools used •For most radio communication attacks an SDR would suffice •Mainly because they can TX and RX in a wide range of frequencies •Some examples are •USRP B210 •HackRF •BladeRF •RTLSDR •You can also use RFCat (cc1111 based attack toolkit) •Ubertooth One can be used for Bluetooth sniffing •OR sniff the buses of the transmitter
  • 24. RF attacks •Jamming •Basically DoS at RF level •Decreases SNR •Techniques differ •Some even disrupt handshakes •Replay •Capture signal •Store it •Replay at some other time
  • 25. Defenses against RF attacks •FHSS is effective against jamming •Use of encryption will defeat most sniffing attacks •Encryption is built into most transmitters •Unfortunately it is not used as much as it should be •Rolling code system is a good defense against replay attack
  • 27. Flash memory •Nonvolatile •Used to store data •Firmware is usually stored in flash memory •Usually uses SPI for communication •Usually does not have any protection
  • 28. Extracting data from flash memory •In circuit: •Don’t remove the chip •Use a chip programmer or bus pirate to read data •Desoldering •The chip should be removed by desoldering it. •It is then accessed using a chip programmer to get the data •Firmware can be extracted in this manner
  • 29. Defenses against Flash memory forensics •OTP memory protection bits •Doesn’t allow the modification of flash memory •Only useful against modification attacks •Encryption •Storing the firmware/data encrypted would defeat memory forensics •Also not storing confidential info on the chip
  • 31. (In)Security •Code is outdated in most devices •Routers are the worst transgressors •Most are internet facing •Have more vulns than a CTF challenge •Code is available for us to check and find vulns
  • 32. Firmware •Almost always linux •Bootloader is usually Uboot •Serial output usually gives you hints about the device •Some may be obfuscated •Can be obtained by either: •JTAG dump •Flash dump via Serial •Flash dump via chip desoldering •From the company website
  • 33. Analysing firmware •Usually various sections wrapped into one bin file •You can use dd to separate •Best option is to use binwalk •Binwalk is a tool by Craig (of devttys0 blog(great resource for hw reversing)) •Automatically analyze and extract firmware files
  • 35. Defenses •Review your code! •Obfuscate your firmware •Review your code again!
  • 37. Invasion of chips •Pretty easy to notice •Chips will be desoldered and/or destroyed in the process •Processors are mapped using microscopes •Very complicated attacks •Usually done for replication of chips
  • 38. Resources Stuff that helped me and may help you
  • 39. Blogs •http://www.devttys0.com/ •http://www.bunniestudios.com/ •http://travisgoodspeed.blogspot.com •http://www.grandideastudio.com/