SlideShare una empresa de Scribd logo
1 de 36
Descargar para leer sin conexión
Яev3rse eng1neering
Daniel Stenberg, May 21st
2014
Agenda
A saga about a bunch of people
who grew bored with a factory
installed firmware in consumer
electronics and wrote their own
implementation
Daniel Stenberg
Email: daniel@haxx.se
Twitter: @bagder
Web: daniel.haxx.se
Blog: daniel.haxx.se/blog
hacker at
Please ask!
Feel free to interrupt and ask at any time!
Let me tell you a story...
•this story begins in the early 2001
•3 men in their best years
•embedded systems hackers
•the dawn of the mp3 player revolution
Archos mp3 players
•December 2000
•First mp3 player with a HDD
•Probably the crappiest firmware
in the world
•Surely we could do better? How
hard can it be?
What's inside?
•Read the onboard circuits and search or ask
•Used to be a good away
•… barely gives away anything nowadays
•Can it be hacked?
•Almost universally: yes
Firmware upgrade option!
•Look you can upgrade firmware...
•What's the architecture again?
•Collect several firmware files
•Analyze differences
•Throw everything and everyone at it
•This can take a lot of time
Intermission: legality
•Were we allowed to do this?
•The world is full of jurisdictions
•We are Swedish, what does EU laws say?
•The 1991 EU Computer Programs Directive, article 6:
•The 2009 EU Computer Program Directive:
The authorization of the rightholder shall not be required
where reproduction of the code and translation of its form ...
are indispensable to obtain the information necessary to
achieve the interoperability of an independently created
computer program with other programs
performance of the acts of reproduction and translation by or
on behalf of a person having a right to use a copy of the
program is legitimate and compatible with fair practice and
must therefore be deemed not to require the authorisation of
the rightholder. An objective of this exception is to make it
possible to connect all components of a computer system,
including those of different manufacturers, so that they can
work together
XORing a fixed string
•By guessing parts of the decrypted file some “encryption”
is easier than others
•Early devices just scrambled firmwares like this
How do things work in there?
•Figure out how your architecture works
•Master things like the CPU instruction set and how a
stack works
•These days things are “always” ARM
•The CPU core is not the problem, the peripherals, busses
and associated HW are the challenges
Disassembly
•Objdump is an excellent tool
•Is not as hard as you might think
•Look for register addresses / memory layout patterns
•Error messages/strings/bitmaps or pointers to them
Disassembly even easier
•IDApro is an advanced tool to automate the task even
more
• Detects lots of C/C++ magic by itself
• Stack frames
• Bitmaps
• Structs
• Strings
• Memory layout
Scan the bare PCB and beep them
BGA
removed!
Surprisingly many
clues printed on the
PCB
Hiding what's inside
•Rub off all markings
•Use chips without public documentation
•Use chips unsupported by gcc
Hardware debuggers
•Many devices leave debug points for BDM / JTAG or
debug uarts
•Like this:
Attaching stuff on their HW
•Hm, what do we have here...
oh so useful
Stripped and attached
Anti-bricking measures
•Have multiple devices
•Primary boot-loader feature: run the original
•If possible, load and run from RAM only until tested
Software decoding targets
•Our first targets had mp3 decoding hardware
•New architectures entered
•More XOR and checksums
•Detect code patterns and search online for data sheets.
•Partial matches may give “similar chips” that have
documentation
Early ipods
•Used hidden hard-drive partitions
•Used completely (publicly) undocumented chips
•Took a long time to master
Later target examples
•Boot-loader that loads and decrypts firmware
•Magic constants in the boot-loader code revealed
algorithm.
•Boot-loader also upgradable (plain) gave away crypto
keys
•Known flags in digital signature algorithm (DSA) offered
shortcut in code signing
So what about true cryptography?
Loading encrypted payloads
•Target loads only encrypted files
•User finds flaw in one firmware version that crashes the
device
•A buffer overflow in the HTML reader
•Look, if we add crafted data in that HTML file we can
execute code
•When we used a loop to write in memory we managed to
toggle the backlight
A backlight reading device
From backlight to restored key
• dump memory using a videocamera and toggle backlight
• 32MB contents took many hours
• analyze what's in memory
• code, data, clues
• see, there's a pattern of USB registers
• rewrite the memory dump program to send contents over USB, insert
the whole thing into a HTML file, load it on target device
• there seems to be code referencing an SRAM
• dump SRAM too
• Look, there's something that looks like a crypto key!
It takes time and people
•Many volunteers
•Skilled volunteers
•Devoted volunteers
•Lots of time
•> 1 year from buffer overflow to running code
Getting it done faster?
•What if there was (lots of) money to gain?
•More clever people spending more of their time
•More computers cracking crypto
•More hardware analyzers
•If you can upgrade the device, reverse engineering it will
be possible
From tiny to Android
2001
2MB RAM
6GB HDD
12 MHz CPU
2010
64MB RAM
120GB HDD
500 MHz CPU
Today: the dedicated mp3 player market is dead or dying
and everyone is going Android
Reverse engineering is still done mostly the same
Linux-based reverse engineering
•More devices use full-fledged Linux
•More flaws, more drivers, less ways to have “unique”
solutions hard to figure out
•Manufacturers stick to undocumented hardware
•… and booting encrypted blobs
•Once “hacked”, putting your own SW can be much easier:
• familiar APIs (libc, u-boot, standard libs)
• familar drivers (even if binary blobs will be there)
• gcc!
Rockbox
A complete and very portable open source mp3 player
firmware replacement, including multi-tasking operating
system and application suite...
Started by me and my two friends Linus and Björn.
Runs on almost 100 different mp3 players from brands such
as Toshiba, Tatung, Sony, SanDisk, Samsung, Philips, Pandora,
Onda, Olympus, MPIO, Creative, Apple, Archos, Cowon,
HifiMan, Meizu, iRiver, Packard Bell, iAudio and more...
Tower of Rockbox
Thank you!
Learn more!
•Rockbox http://www.rockbox.org/
•“Reverse Engineering for Beginners”
http://yurichev.com/writings/RE_for_beginners-en.pdf
Doing good is part of our code

Más contenido relacionado

La actualidad más candente

From Silicon to Software - IIT Madras
From Silicon to Software - IIT MadrasFrom Silicon to Software - IIT Madras
From Silicon to Software - IIT Madras
Aanjhan Ranganathan
 
Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires
Kernel Recipes 2017 - What's inside the input stack? - Benjamain TissoiresKernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires
Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires
Anne Nicolas
 
[Wroclaw #4] Fuzzing - underestimated method of finding hidden bugs
[Wroclaw #4] Fuzzing - underestimated method of finding hidden bugs[Wroclaw #4] Fuzzing - underestimated method of finding hidden bugs
[Wroclaw #4] Fuzzing - underestimated method of finding hidden bugs
OWASP
 
Bz backtrack.usage
Bz backtrack.usageBz backtrack.usage
Bz backtrack.usage
djenoalbania
 
Cloud, Distributed, Embedded: Erlang in the Heterogeneous Computing World
Cloud, Distributed, Embedded: Erlang in the Heterogeneous Computing WorldCloud, Distributed, Embedded: Erlang in the Heterogeneous Computing World
Cloud, Distributed, Embedded: Erlang in the Heterogeneous Computing World
Omer Kilic
 

La actualidad más candente (20)

Nerves Project Intro to ErlangDC
Nerves Project Intro to ErlangDCNerves Project Intro to ErlangDC
Nerves Project Intro to ErlangDC
 
Is Rust Programming ready for embedded development?
Is Rust Programming ready for embedded development?Is Rust Programming ready for embedded development?
Is Rust Programming ready for embedded development?
 
LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205
 
Asus Tinker Board
Asus Tinker BoardAsus Tinker Board
Asus Tinker Board
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
From Silicon to Software - IIT Madras
From Silicon to Software - IIT MadrasFrom Silicon to Software - IIT Madras
From Silicon to Software - IIT Madras
 
Fuzzing underestimated method of finding hidden bugs
Fuzzing underestimated method of finding hidden bugsFuzzing underestimated method of finding hidden bugs
Fuzzing underestimated method of finding hidden bugs
 
Alessandro Abbruzzetti - Kernal64
Alessandro Abbruzzetti - Kernal64Alessandro Abbruzzetti - Kernal64
Alessandro Abbruzzetti - Kernal64
 
Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires
Kernel Recipes 2017 - What's inside the input stack? - Benjamain TissoiresKernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires
Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires
 
Kernel Recipes 2017 - The Serial Device Bus - Johan Hovold
Kernel Recipes 2017 - The Serial Device Bus - Johan HovoldKernel Recipes 2017 - The Serial Device Bus - Johan Hovold
Kernel Recipes 2017 - The Serial Device Bus - Johan Hovold
 
[Wroclaw #4] Fuzzing - underestimated method of finding hidden bugs
[Wroclaw #4] Fuzzing - underestimated method of finding hidden bugs[Wroclaw #4] Fuzzing - underestimated method of finding hidden bugs
[Wroclaw #4] Fuzzing - underestimated method of finding hidden bugs
 
DEF CON 27 - DIMITRY SNEZHKOV - zombie ant farm practical tips
DEF CON 27 - DIMITRY SNEZHKOV - zombie ant farm practical tipsDEF CON 27 - DIMITRY SNEZHKOV - zombie ant farm practical tips
DEF CON 27 - DIMITRY SNEZHKOV - zombie ant farm practical tips
 
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
 
Bz backtrack.usage
Bz backtrack.usageBz backtrack.usage
Bz backtrack.usage
 
Jollen's Presentation: Introducing Android low-level
Jollen's Presentation: Introducing Android low-levelJollen's Presentation: Introducing Android low-level
Jollen's Presentation: Introducing Android low-level
 
Intel Edison: Beyond the Breadboard
Intel Edison: Beyond the BreadboardIntel Edison: Beyond the Breadboard
Intel Edison: Beyond the Breadboard
 
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
 
Code Injection in Windows
Code Injection in WindowsCode Injection in Windows
Code Injection in Windows
 
Debian Linux on Zynq (Xilinx ARM-SoC FPGA) Setup Flow (Vivado 2015.4)
Debian Linux on Zynq (Xilinx ARM-SoC FPGA) Setup Flow (Vivado 2015.4)Debian Linux on Zynq (Xilinx ARM-SoC FPGA) Setup Flow (Vivado 2015.4)
Debian Linux on Zynq (Xilinx ARM-SoC FPGA) Setup Flow (Vivado 2015.4)
 
Cloud, Distributed, Embedded: Erlang in the Heterogeneous Computing World
Cloud, Distributed, Embedded: Erlang in the Heterogeneous Computing WorldCloud, Distributed, Embedded: Erlang in the Heterogeneous Computing World
Cloud, Distributed, Embedded: Erlang in the Heterogeneous Computing World
 

Destacado

Reverse engineering
Reverse engineeringReverse engineering
Reverse engineering
Saswat Padhi
 
Reverse Engineering of Software Architecture
Reverse Engineering of Software ArchitectureReverse Engineering of Software Architecture
Reverse Engineering of Software Architecture
Dharmalingam Ganesan
 
Reverse Engineering
Reverse EngineeringReverse Engineering
Reverse Engineering
siddu019
 
Service Operation Processes
Service Operation ProcessesService Operation Processes
Service Operation Processes
nuwulang
 

Destacado (20)

reverse engineering
reverse engineeringreverse engineering
reverse engineering
 
intra and inter personal relations
intra and inter personal relationsintra and inter personal relations
intra and inter personal relations
 
Line balancing
Line balancing Line balancing
Line balancing
 
Measurement System Analysis
Measurement System AnalysisMeasurement System Analysis
Measurement System Analysis
 
Reverse engineering
Reverse engineeringReverse engineering
Reverse engineering
 
Reverse Engineering of Software Architecture
Reverse Engineering of Software ArchitectureReverse Engineering of Software Architecture
Reverse Engineering of Software Architecture
 
Tools for capacity planning, measurement of capacity, capacity planning process
Tools for capacity planning, measurement of capacity, capacity planning processTools for capacity planning, measurement of capacity, capacity planning process
Tools for capacity planning, measurement of capacity, capacity planning process
 
Software reverse engineering
Software reverse engineeringSoftware reverse engineering
Software reverse engineering
 
Maintenance, Re-engineering &Reverse Engineering in Software Engineering
Maintenance,Re-engineering &Reverse Engineering in Software EngineeringMaintenance,Re-engineering &Reverse Engineering in Software Engineering
Maintenance, Re-engineering &Reverse Engineering in Software Engineering
 
Service Operation - Manajemen Layanan Teknologi Informasi
Service Operation - Manajemen Layanan Teknologi InformasiService Operation - Manajemen Layanan Teknologi Informasi
Service Operation - Manajemen Layanan Teknologi Informasi
 
Measuring capacity lesson3
Measuring capacity lesson3Measuring capacity lesson3
Measuring capacity lesson3
 
Unit 1 Service Operations Management
Unit 1 Service Operations ManagementUnit 1 Service Operations Management
Unit 1 Service Operations Management
 
Legacy Software Maintenance And Management
Legacy Software Maintenance And ManagementLegacy Software Maintenance And Management
Legacy Software Maintenance And Management
 
Reverse Engineering
Reverse EngineeringReverse Engineering
Reverse Engineering
 
Capacity 1
Capacity 1Capacity 1
Capacity 1
 
Reverse engineering
Reverse engineeringReverse engineering
Reverse engineering
 
Capacity Planning with Free Tools
Capacity Planning with Free ToolsCapacity Planning with Free Tools
Capacity Planning with Free Tools
 
Capacity Management
Capacity ManagementCapacity Management
Capacity Management
 
Facility layout
Facility layoutFacility layout
Facility layout
 
Service Operation Processes
Service Operation ProcessesService Operation Processes
Service Operation Processes
 

Similar a Reverse engineering

Reverse Engineering.pptx
Reverse Engineering.pptxReverse Engineering.pptx
Reverse Engineering.pptx
Sameer Sapra
 
The economies of scaling software - Abdel Remani
The economies of scaling software - Abdel RemaniThe economies of scaling software - Abdel Remani
The economies of scaling software - Abdel Remani
jaxconf
 

Similar a Reverse engineering (20)

Making and breaking security in embedded devices
Making and breaking security in embedded devicesMaking and breaking security in embedded devices
Making and breaking security in embedded devices
 
Reverse Engineering the TomTom Runner pt. 1
Reverse Engineering the TomTom Runner pt. 1 Reverse Engineering the TomTom Runner pt. 1
Reverse Engineering the TomTom Runner pt. 1
 
Advanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCONAdvanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCON
 
Hardware Reverse Engineering: From Boot to Root
Hardware Reverse Engineering: From Boot to RootHardware Reverse Engineering: From Boot to Root
Hardware Reverse Engineering: From Boot to Root
 
Stegano Forensics
Stegano ForensicsStegano Forensics
Stegano Forensics
 
Reverse Engineering.pptx
Reverse Engineering.pptxReverse Engineering.pptx
Reverse Engineering.pptx
 
REMnux tutorial-2: Extraction and decoding of Artifacts
REMnux tutorial-2: Extraction and decoding of ArtifactsREMnux tutorial-2: Extraction and decoding of Artifacts
REMnux tutorial-2: Extraction and decoding of Artifacts
 
Yet Another Dan Kaminsky Talk (Black Ops 2014)
Yet Another Dan Kaminsky Talk (Black Ops 2014)Yet Another Dan Kaminsky Talk (Black Ops 2014)
Yet Another Dan Kaminsky Talk (Black Ops 2014)
 
Computer basics
Computer basicsComputer basics
Computer basics
 
Java in High Frequency Trading
Java in High Frequency TradingJava in High Frequency Trading
Java in High Frequency Trading
 
Steelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trashSteelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trash
 
Share winter 2016 encryption
Share winter 2016 encryptionShare winter 2016 encryption
Share winter 2016 encryption
 
DEFCON 23 - Mickey Shkatov Jesse Michael - scared poopless lte vulnerabilities
DEFCON 23 - Mickey Shkatov Jesse Michael - scared poopless lte vulnerabilitiesDEFCON 23 - Mickey Shkatov Jesse Michael - scared poopless lte vulnerabilities
DEFCON 23 - Mickey Shkatov Jesse Michael - scared poopless lte vulnerabilities
 
Demystifying Binary Reverse Engineering - Pixels Camp
Demystifying Binary Reverse Engineering - Pixels CampDemystifying Binary Reverse Engineering - Pixels Camp
Demystifying Binary Reverse Engineering - Pixels Camp
 
Computer_Basics_computer_basics.pptx
Computer_Basics_computer_basics.pptxComputer_Basics_computer_basics.pptx
Computer_Basics_computer_basics.pptx
 
Care for Network and Computer Hardware L-2 (3).pptx
Care for Network and Computer Hardware     L-2 (3).pptxCare for Network and Computer Hardware     L-2 (3).pptx
Care for Network and Computer Hardware L-2 (3).pptx
 
kbrgwillis.pdf
kbrgwillis.pdfkbrgwillis.pdf
kbrgwillis.pdf
 
Toward low-latency Java applications - javaOne 2014
Toward low-latency Java applications - javaOne 2014Toward low-latency Java applications - javaOne 2014
Toward low-latency Java applications - javaOne 2014
 
Monorepo at Pinterest
Monorepo at PinterestMonorepo at Pinterest
Monorepo at Pinterest
 
The economies of scaling software - Abdel Remani
The economies of scaling software - Abdel RemaniThe economies of scaling software - Abdel Remani
The economies of scaling software - Abdel Remani
 

Más de Daniel Stenberg

Más de Daniel Stenberg (20)

mastering libcurl part 2
mastering libcurl part 2mastering libcurl part 2
mastering libcurl part 2
 
mastering libcurl part 1
mastering libcurl part 1mastering libcurl part 1
mastering libcurl part 1
 
curl - openfourm europe.pdf
curl - openfourm europe.pdfcurl - openfourm europe.pdf
curl - openfourm europe.pdf
 
curl experiments - curl up 2022
curl experiments - curl up 2022curl experiments - curl up 2022
curl experiments - curl up 2022
 
curl security - curl up 2022
curl security - curl up 2022curl security - curl up 2022
curl security - curl up 2022
 
HTTP/3 in curl - curl up 2022
HTTP/3 in curl - curl up 2022HTTP/3 in curl - curl up 2022
HTTP/3 in curl - curl up 2022
 
The state of curl 2022
The state of curl 2022The state of curl 2022
The state of curl 2022
 
Let me tell you about curl
Let me tell you about curlLet me tell you about curl
Let me tell you about curl
 
Curl with rust
Curl with rustCurl with rust
Curl with rust
 
Getting started with libcurl
Getting started with libcurlGetting started with libcurl
Getting started with libcurl
 
HTTP/3 is next generation HTTP
HTTP/3 is next generation HTTPHTTP/3 is next generation HTTP
HTTP/3 is next generation HTTP
 
Landing code in curl
Landing code in curlLanding code in curl
Landing code in curl
 
Testing curl for security
Testing curl for securityTesting curl for security
Testing curl for security
 
common mistakes when using libcurl
common mistakes when using libcurlcommon mistakes when using libcurl
common mistakes when using libcurl
 
HTTP/3 in curl 2020
HTTP/3 in curl 2020HTTP/3 in curl 2020
HTTP/3 in curl 2020
 
The state of curl 2020
The state of curl 2020The state of curl 2020
The state of curl 2020
 
curl roadmap 2020
curl roadmap 2020curl roadmap 2020
curl roadmap 2020
 
curl better
curl bettercurl better
curl better
 
HTTP/3 for everyone
HTTP/3 for everyoneHTTP/3 for everyone
HTTP/3 for everyone
 
HTTP/3, QUIC and streaming
HTTP/3, QUIC and streamingHTTP/3, QUIC and streaming
HTTP/3, QUIC and streaming
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

Reverse engineering

  • 2. Agenda A saga about a bunch of people who grew bored with a factory installed firmware in consumer electronics and wrote their own implementation
  • 3. Daniel Stenberg Email: daniel@haxx.se Twitter: @bagder Web: daniel.haxx.se Blog: daniel.haxx.se/blog hacker at
  • 4. Please ask! Feel free to interrupt and ask at any time!
  • 5. Let me tell you a story... •this story begins in the early 2001 •3 men in their best years •embedded systems hackers •the dawn of the mp3 player revolution
  • 6. Archos mp3 players •December 2000 •First mp3 player with a HDD •Probably the crappiest firmware in the world •Surely we could do better? How hard can it be?
  • 7. What's inside? •Read the onboard circuits and search or ask •Used to be a good away •… barely gives away anything nowadays •Can it be hacked? •Almost universally: yes
  • 8. Firmware upgrade option! •Look you can upgrade firmware... •What's the architecture again? •Collect several firmware files •Analyze differences •Throw everything and everyone at it •This can take a lot of time
  • 9. Intermission: legality •Were we allowed to do this? •The world is full of jurisdictions •We are Swedish, what does EU laws say? •The 1991 EU Computer Programs Directive, article 6: •The 2009 EU Computer Program Directive: The authorization of the rightholder shall not be required where reproduction of the code and translation of its form ... are indispensable to obtain the information necessary to achieve the interoperability of an independently created computer program with other programs performance of the acts of reproduction and translation by or on behalf of a person having a right to use a copy of the program is legitimate and compatible with fair practice and must therefore be deemed not to require the authorisation of the rightholder. An objective of this exception is to make it possible to connect all components of a computer system, including those of different manufacturers, so that they can work together
  • 10. XORing a fixed string •By guessing parts of the decrypted file some “encryption” is easier than others •Early devices just scrambled firmwares like this
  • 11. How do things work in there? •Figure out how your architecture works •Master things like the CPU instruction set and how a stack works •These days things are “always” ARM •The CPU core is not the problem, the peripherals, busses and associated HW are the challenges
  • 12. Disassembly •Objdump is an excellent tool •Is not as hard as you might think •Look for register addresses / memory layout patterns •Error messages/strings/bitmaps or pointers to them
  • 13. Disassembly even easier •IDApro is an advanced tool to automate the task even more • Detects lots of C/C++ magic by itself • Stack frames • Bitmaps • Structs • Strings • Memory layout
  • 14. Scan the bare PCB and beep them BGA removed! Surprisingly many clues printed on the PCB
  • 15. Hiding what's inside •Rub off all markings •Use chips without public documentation •Use chips unsupported by gcc
  • 16. Hardware debuggers •Many devices leave debug points for BDM / JTAG or debug uarts •Like this:
  • 17. Attaching stuff on their HW •Hm, what do we have here...
  • 20. Anti-bricking measures •Have multiple devices •Primary boot-loader feature: run the original •If possible, load and run from RAM only until tested
  • 21. Software decoding targets •Our first targets had mp3 decoding hardware •New architectures entered •More XOR and checksums •Detect code patterns and search online for data sheets. •Partial matches may give “similar chips” that have documentation
  • 22. Early ipods •Used hidden hard-drive partitions •Used completely (publicly) undocumented chips •Took a long time to master
  • 23. Later target examples •Boot-loader that loads and decrypts firmware •Magic constants in the boot-loader code revealed algorithm. •Boot-loader also upgradable (plain) gave away crypto keys •Known flags in digital signature algorithm (DSA) offered shortcut in code signing
  • 24. So what about true cryptography?
  • 25. Loading encrypted payloads •Target loads only encrypted files •User finds flaw in one firmware version that crashes the device •A buffer overflow in the HTML reader •Look, if we add crafted data in that HTML file we can execute code •When we used a loop to write in memory we managed to toggle the backlight
  • 27. From backlight to restored key • dump memory using a videocamera and toggle backlight • 32MB contents took many hours • analyze what's in memory • code, data, clues • see, there's a pattern of USB registers • rewrite the memory dump program to send contents over USB, insert the whole thing into a HTML file, load it on target device • there seems to be code referencing an SRAM • dump SRAM too • Look, there's something that looks like a crypto key!
  • 28. It takes time and people •Many volunteers •Skilled volunteers •Devoted volunteers •Lots of time •> 1 year from buffer overflow to running code
  • 29. Getting it done faster? •What if there was (lots of) money to gain? •More clever people spending more of their time •More computers cracking crypto •More hardware analyzers •If you can upgrade the device, reverse engineering it will be possible
  • 30. From tiny to Android 2001 2MB RAM 6GB HDD 12 MHz CPU 2010 64MB RAM 120GB HDD 500 MHz CPU Today: the dedicated mp3 player market is dead or dying and everyone is going Android Reverse engineering is still done mostly the same
  • 31. Linux-based reverse engineering •More devices use full-fledged Linux •More flaws, more drivers, less ways to have “unique” solutions hard to figure out •Manufacturers stick to undocumented hardware •… and booting encrypted blobs •Once “hacked”, putting your own SW can be much easier: • familiar APIs (libc, u-boot, standard libs) • familar drivers (even if binary blobs will be there) • gcc!
  • 32. Rockbox A complete and very portable open source mp3 player firmware replacement, including multi-tasking operating system and application suite... Started by me and my two friends Linus and Björn. Runs on almost 100 different mp3 players from brands such as Toshiba, Tatung, Sony, SanDisk, Samsung, Philips, Pandora, Onda, Olympus, MPIO, Creative, Apple, Archos, Cowon, HifiMan, Meizu, iRiver, Packard Bell, iAudio and more...
  • 35. Learn more! •Rockbox http://www.rockbox.org/ •“Reverse Engineering for Beginners” http://yurichev.com/writings/RE_for_beginners-en.pdf
  • 36. Doing good is part of our code