SlideShare uma empresa Scribd logo
1 de 23
Slicing into Apple: iPhone Reverse Engineering Ryan PermehTrace TeamMcAfee
Introduction Reverse engineering is taking a finished product and working back towards it’s constituent artifacts Gives us a peek behind the curtains of software Helpful for a variety of legitimate uses Better understanding how software works Recovering lost knowledge Interfacing to closed systems Finding security issues May be used illegally DCMA, software piracy, IP theft
Skill Outlay Reverse engineering is a very technical subject Requires a deep understanding of several topics Hardware Architecture Software Architecture Operating system internals Assembly language Higher level languages Compiler, linker, and loader internals Debugging The better you understand how software is made, the easier it is to reverse engineer it.
JailBreak your iPhone You really need to be jailbroken to have a platform to work from Jailbreak breaks signing requirements for applications Opens the phone up to a variety of new uses Run software from other sources Develop software without need for Apple Developer cost Allows you access to the internals of the iPhone Jailbreak for 4.3.3 and beyond This changes often, so do your research Jailbreaking happens via an exploit, leveraged to patch the kernel Install Cydia and use that to install your tools Gcc/gdb SSH access Class-dump Whatever else you want
Tools used Reverse engineering leverages several tools to get a better understanding of the code Disassembler Parses finished code into assembly language Understand and visualize program flow  Provides cross references, searching, and other useful tools We use IDA Pro 6.0 in these examples Debugger Offers a view of the program at runtime Helpful for dynamic analysis Can tie into other reverse engineering artifacts We use gdb in these examples
Tools - iPhone Specific Clutch – http://clutch.hackulo.us Tool to crack software Handles decrypting binaries automatically class-dump - http://www.codethecode.com/projects/class-dump/ Dumps internal Objective-C objects Helps understand interfaces, objects in project Itunnel - http://www.cs.toronto.edu/~jingsu/itunnel/ Useful for connecting from a host machine directly to a jailbrokeniphone For windows and unix (windows – search for itunnel.exe) Used in lieu of a WIFI connection
Inside the iPhone
Hardware Processor: ARM Cortex A8 Developed by Apple and Samsung Latest devices use A4 designation 32 bit RISC architecture Uses thumb extensions Radio functionality 3g Wifi Bluetooth Nordic Semiconductor proprietary chipset Camera Touch Screen
Operating System  iOS(previously iPhone OS) is currently at 4.3.3 Darwin based kernel Unix platform Ships drivers for all hardware OS versions defines support for various features iOS 4 brought multitasking, Game Center iOS 3 brought video, improved GPS Security Mechanisms Code Signing Sandboxing
Programming on the iPhone Objective-C  A superset of the C language Uses an Object oriented model Uses messages instead of calls Uses late runtime binding of objects Cocoa Appkit Graphics that fit UI guidelines FoundationKit Containers Value manipulation
iPhone Binary Format Uses MACH-O format Comprised of a standard header a series of load commands a series of segments Sections within the segments The process of loading is Loader recognizes header Processes each load command Expands each segment Maps each section to memory Universal Binaries pair multiple platforms in one package iPhone binaries often have both ARM 6 and ARM 7
Examining a Binary Key Steps to Disassemble an iPhone Binary Get the Binary Put it on the phone Decrypt the segments Transfer it off the phone Load it in your Disassembler PROFIT!
Getting the Binary You can get the binary in a number of ways Download via iTunes Use iPhone Store app on device iPhone Backup Find third party place (be careful) Binary locations Itunes:   My MusicTunesTunes Mediaobile Applications On Phone:  /Applications /private/var/mobile/Applications
Getting Files On and Off the Phone If you downloaded from the appstore, you can skip this step Itunes Do a simple sync Third party (and getting apps off the phone) Use SCP or iPhone Browser Clutch puts binaries here /var/root/Documents/Cracked/
WinSCP Demo Demo 1
Installing From the Appstore Demo 2
Decrypt the segments Appstore iPhone binaries are encrypted and signed Tied to the phone it is to be installed on Code segments are encrypted, so look like gibberish We need a way to decrypt The hard way Calculate encryption offsets Run program with debugger Dump unecrypted memory segment Patch binary with unecrypted segment Update references to crypto The easy way Clutch
Clutch Demo Demo 3
Load It into the Disassembler Unpack the clutch output ipa Ipa files are just zip files, you can rename them to .zip  Should have a directory structure /some GUID /App files App is probably the largest file, has no extension Explore other files Use plist editor to examine .plist files DB/data files often SQLLite Load File into the Disassembler
Unpacking the IPA Demo 4
iPhone Binary Internals Uses Objective-C and Cocoa Calls are non-obvious Use python tool to fixup calls Reanalyze with new markup Code is ARM assembler Areas to look at Strings Areas of import Network calls Crypto Calls to key iPhone areas (mail, sms, calendar, etc) Key functionality per app Graphs help understand flow
Analyzing the Binary Demo 5
Questions? Ryan_Permeh@mcafee.com http://www.mcafee.com

Mais conteúdo relacionado

Destaque

iOS App Reverse Engineering
iOS App Reverse EngineeringiOS App Reverse Engineering
iOS App Reverse EngineeringZishe Sha
 
Understanding the Dalvik bytecode with the Dedexer tool
Understanding the Dalvik bytecode with the Dedexer toolUnderstanding the Dalvik bytecode with the Dedexer tool
Understanding the Dalvik bytecode with the Dedexer toolGabor Paller
 
Elementary µprocessor tutorial
Elementary µprocessor tutorial Elementary µprocessor tutorial
Elementary µprocessor tutorial Nabil Chouba
 
iOS Application Penetation Test
iOS Application Penetation TestiOS Application Penetation Test
iOS Application Penetation TestJongWon Kim
 
A New Approach to Social Mobility Models: Simulation as “Reverse Engineering”
A New Approach to Social Mobility Models: Simulation as “Reverse Engineering”A New Approach to Social Mobility Models: Simulation as “Reverse Engineering”
A New Approach to Social Mobility Models: Simulation as “Reverse Engineering”Edmund Chattoe-Brown
 
Null Mumbai Meet_Android Reverse Engineering by Samrat Das
Null Mumbai Meet_Android Reverse Engineering by Samrat DasNull Mumbai Meet_Android Reverse Engineering by Samrat Das
Null Mumbai Meet_Android Reverse Engineering by Samrat Dasnullowaspmumbai
 
Software reverse engineering
Software reverse engineeringSoftware reverse engineering
Software reverse engineeringParminder Singh
 
8 bit single cycle processor
8 bit single cycle processor8 bit single cycle processor
8 bit single cycle processorDhaval Kaneria
 
型態與運算子
型態與運算子型態與運算子
型態與運算子Justin Lin
 
Total Quality Management and i phone
Total Quality Management and i phoneTotal Quality Management and i phone
Total Quality Management and i phoneJawad Ali
 
MakerBoard: MT7688 Emulator
MakerBoard: MT7688 EmulatorMakerBoard: MT7688 Emulator
MakerBoard: MT7688 EmulatorFred Chien
 
Introduction to Reverse Engineering
Introduction to Reverse EngineeringIntroduction to Reverse Engineering
Introduction to Reverse EngineeringGopinath Chintala
 
Reverse Engineering (EVO 2008)
Reverse Engineering (EVO 2008)Reverse Engineering (EVO 2008)
Reverse Engineering (EVO 2008)Tudor Girba
 
Apple iphone 6 and 6 plus front camera module teardown reverse costing report...
Apple iphone 6 and 6 plus front camera module teardown reverse costing report...Apple iphone 6 and 6 plus front camera module teardown reverse costing report...
Apple iphone 6 and 6 plus front camera module teardown reverse costing report...Yole Developpement
 
Mi 291 chapter 3 (reverse engineering)(1)
Mi 291 chapter 3 (reverse engineering)(1)Mi 291 chapter 3 (reverse engineering)(1)
Mi 291 chapter 3 (reverse engineering)(1)varun teja G.V.V
 
Reverse engineering
Reverse  engineeringReverse  engineering
Reverse engineeringYuffie Valen
 
Introduction to Operations and Supply Chain Management
Introduction to Operations and Supply Chain ManagementIntroduction to Operations and Supply Chain Management
Introduction to Operations and Supply Chain ManagementDr. Prashant Kalaskar
 

Destaque (20)

iOS App Reverse Engineering
iOS App Reverse EngineeringiOS App Reverse Engineering
iOS App Reverse Engineering
 
Understanding the Dalvik bytecode with the Dedexer tool
Understanding the Dalvik bytecode with the Dedexer toolUnderstanding the Dalvik bytecode with the Dedexer tool
Understanding the Dalvik bytecode with the Dedexer tool
 
Elementary µprocessor tutorial
Elementary µprocessor tutorial Elementary µprocessor tutorial
Elementary µprocessor tutorial
 
iOS Application Penetation Test
iOS Application Penetation TestiOS Application Penetation Test
iOS Application Penetation Test
 
A New Approach to Social Mobility Models: Simulation as “Reverse Engineering”
A New Approach to Social Mobility Models: Simulation as “Reverse Engineering”A New Approach to Social Mobility Models: Simulation as “Reverse Engineering”
A New Approach to Social Mobility Models: Simulation as “Reverse Engineering”
 
Null Mumbai Meet_Android Reverse Engineering by Samrat Das
Null Mumbai Meet_Android Reverse Engineering by Samrat DasNull Mumbai Meet_Android Reverse Engineering by Samrat Das
Null Mumbai Meet_Android Reverse Engineering by Samrat Das
 
Software reverse engineering
Software reverse engineeringSoftware reverse engineering
Software reverse engineering
 
8 Bit A L U
8 Bit  A L U8 Bit  A L U
8 Bit A L U
 
8 bit single cycle processor
8 bit single cycle processor8 bit single cycle processor
8 bit single cycle processor
 
型態與運算子
型態與運算子型態與運算子
型態與運算子
 
Total Quality Management and i phone
Total Quality Management and i phoneTotal Quality Management and i phone
Total Quality Management and i phone
 
Innovation Secrets of Steve Jobs
Innovation Secrets of Steve JobsInnovation Secrets of Steve Jobs
Innovation Secrets of Steve Jobs
 
MakerBoard: MT7688 Emulator
MakerBoard: MT7688 EmulatorMakerBoard: MT7688 Emulator
MakerBoard: MT7688 Emulator
 
Introduction to Reverse Engineering
Introduction to Reverse EngineeringIntroduction to Reverse Engineering
Introduction to Reverse Engineering
 
Reverse Engineering (EVO 2008)
Reverse Engineering (EVO 2008)Reverse Engineering (EVO 2008)
Reverse Engineering (EVO 2008)
 
Apple iphone 6 and 6 plus front camera module teardown reverse costing report...
Apple iphone 6 and 6 plus front camera module teardown reverse costing report...Apple iphone 6 and 6 plus front camera module teardown reverse costing report...
Apple iphone 6 and 6 plus front camera module teardown reverse costing report...
 
Mi 291 chapter 3 (reverse engineering)(1)
Mi 291 chapter 3 (reverse engineering)(1)Mi 291 chapter 3 (reverse engineering)(1)
Mi 291 chapter 3 (reverse engineering)(1)
 
Reverse engineering
Reverse  engineeringReverse  engineering
Reverse engineering
 
Introduction to Operations and Supply Chain Management
Introduction to Operations and Supply Chain ManagementIntroduction to Operations and Supply Chain Management
Introduction to Operations and Supply Chain Management
 
Ios vs android
Ios vs androidIos vs android
Ios vs android
 

Mais de Source Conference

iBanking - a botnet on Android
iBanking - a botnet on AndroidiBanking - a botnet on Android
iBanking - a botnet on AndroidSource Conference
 
I want the next generation web here SPDY QUIC
I want the next generation web here SPDY QUICI want the next generation web here SPDY QUIC
I want the next generation web here SPDY QUICSource Conference
 
From DNA Sequence Variation to .NET Bits and Bobs
From DNA Sequence Variation to .NET Bits and BobsFrom DNA Sequence Variation to .NET Bits and Bobs
From DNA Sequence Variation to .NET Bits and BobsSource Conference
 
Extracting Forensic Information From Zeus Derivatives
Extracting Forensic Information From Zeus DerivativesExtracting Forensic Information From Zeus Derivatives
Extracting Forensic Information From Zeus DerivativesSource Conference
 
How to Like Social Media Network Security
How to Like Social Media Network SecurityHow to Like Social Media Network Security
How to Like Social Media Network SecuritySource Conference
 
Wfuzz para Penetration Testers
Wfuzz para Penetration TestersWfuzz para Penetration Testers
Wfuzz para Penetration TestersSource Conference
 
Security Goodness with Ruby on Rails
Security Goodness with Ruby on RailsSecurity Goodness with Ruby on Rails
Security Goodness with Ruby on RailsSource Conference
 
Securty Testing For RESTful Applications
Securty Testing For RESTful ApplicationsSecurty Testing For RESTful Applications
Securty Testing For RESTful ApplicationsSource Conference
 
Men in the Server Meet the Man in the Browser
Men in the Server Meet the Man in the BrowserMen in the Server Meet the Man in the Browser
Men in the Server Meet the Man in the BrowserSource Conference
 
Advanced Data Exfiltration The Way Q Would Have Done It
Advanced Data Exfiltration The Way Q Would Have Done ItAdvanced Data Exfiltration The Way Q Would Have Done It
Advanced Data Exfiltration The Way Q Would Have Done ItSource Conference
 
Adapting To The Age Of Anonymous
Adapting To The Age Of AnonymousAdapting To The Age Of Anonymous
Adapting To The Age Of AnonymousSource Conference
 
Are Agile And Secure Development Mutually Exclusive?
Are Agile And Secure Development Mutually Exclusive?Are Agile And Secure Development Mutually Exclusive?
Are Agile And Secure Development Mutually Exclusive?Source Conference
 
Advanced (persistent) binary planting
Advanced (persistent) binary plantingAdvanced (persistent) binary planting
Advanced (persistent) binary plantingSource Conference
 
Legal/technical strategies addressing data risks as perimeter shifts to Cloud
Legal/technical strategies addressing data risks as perimeter shifts to CloudLegal/technical strategies addressing data risks as perimeter shifts to Cloud
Legal/technical strategies addressing data risks as perimeter shifts to CloudSource Conference
 
Who should the security team hire next?
Who should the security team hire next?Who should the security team hire next?
Who should the security team hire next?Source Conference
 
The Latest Developments in Computer Crime Law
The Latest Developments in Computer Crime LawThe Latest Developments in Computer Crime Law
The Latest Developments in Computer Crime LawSource Conference
 
How To: Find The Right Amount Of Security Spend
How To: Find The Right Amount Of Security SpendHow To: Find The Right Amount Of Security Spend
How To: Find The Right Amount Of Security SpendSource Conference
 

Mais de Source Conference (20)

Million Browser Botnet
Million Browser BotnetMillion Browser Botnet
Million Browser Botnet
 
iBanking - a botnet on Android
iBanking - a botnet on AndroidiBanking - a botnet on Android
iBanking - a botnet on Android
 
I want the next generation web here SPDY QUIC
I want the next generation web here SPDY QUICI want the next generation web here SPDY QUIC
I want the next generation web here SPDY QUIC
 
From DNA Sequence Variation to .NET Bits and Bobs
From DNA Sequence Variation to .NET Bits and BobsFrom DNA Sequence Variation to .NET Bits and Bobs
From DNA Sequence Variation to .NET Bits and Bobs
 
Extracting Forensic Information From Zeus Derivatives
Extracting Forensic Information From Zeus DerivativesExtracting Forensic Information From Zeus Derivatives
Extracting Forensic Information From Zeus Derivatives
 
How to Like Social Media Network Security
How to Like Social Media Network SecurityHow to Like Social Media Network Security
How to Like Social Media Network Security
 
Wfuzz para Penetration Testers
Wfuzz para Penetration TestersWfuzz para Penetration Testers
Wfuzz para Penetration Testers
 
Security Goodness with Ruby on Rails
Security Goodness with Ruby on RailsSecurity Goodness with Ruby on Rails
Security Goodness with Ruby on Rails
 
Securty Testing For RESTful Applications
Securty Testing For RESTful ApplicationsSecurty Testing For RESTful Applications
Securty Testing For RESTful Applications
 
Esteganografia
EsteganografiaEsteganografia
Esteganografia
 
Men in the Server Meet the Man in the Browser
Men in the Server Meet the Man in the BrowserMen in the Server Meet the Man in the Browser
Men in the Server Meet the Man in the Browser
 
Advanced Data Exfiltration The Way Q Would Have Done It
Advanced Data Exfiltration The Way Q Would Have Done ItAdvanced Data Exfiltration The Way Q Would Have Done It
Advanced Data Exfiltration The Way Q Would Have Done It
 
Adapting To The Age Of Anonymous
Adapting To The Age Of AnonymousAdapting To The Age Of Anonymous
Adapting To The Age Of Anonymous
 
Are Agile And Secure Development Mutually Exclusive?
Are Agile And Secure Development Mutually Exclusive?Are Agile And Secure Development Mutually Exclusive?
Are Agile And Secure Development Mutually Exclusive?
 
Advanced (persistent) binary planting
Advanced (persistent) binary plantingAdvanced (persistent) binary planting
Advanced (persistent) binary planting
 
Legal/technical strategies addressing data risks as perimeter shifts to Cloud
Legal/technical strategies addressing data risks as perimeter shifts to CloudLegal/technical strategies addressing data risks as perimeter shifts to Cloud
Legal/technical strategies addressing data risks as perimeter shifts to Cloud
 
Who should the security team hire next?
Who should the security team hire next?Who should the security team hire next?
Who should the security team hire next?
 
The Latest Developments in Computer Crime Law
The Latest Developments in Computer Crime LawThe Latest Developments in Computer Crime Law
The Latest Developments in Computer Crime Law
 
JSF Security
JSF SecurityJSF Security
JSF Security
 
How To: Find The Right Amount Of Security Spend
How To: Find The Right Amount Of Security SpendHow To: Find The Right Amount Of Security Spend
How To: Find The Right Amount Of Security Spend
 

Último

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Último (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Slicing into Apple: iPhone Reverse Engineering

  • 1. Slicing into Apple: iPhone Reverse Engineering Ryan PermehTrace TeamMcAfee
  • 2. Introduction Reverse engineering is taking a finished product and working back towards it’s constituent artifacts Gives us a peek behind the curtains of software Helpful for a variety of legitimate uses Better understanding how software works Recovering lost knowledge Interfacing to closed systems Finding security issues May be used illegally DCMA, software piracy, IP theft
  • 3. Skill Outlay Reverse engineering is a very technical subject Requires a deep understanding of several topics Hardware Architecture Software Architecture Operating system internals Assembly language Higher level languages Compiler, linker, and loader internals Debugging The better you understand how software is made, the easier it is to reverse engineer it.
  • 4. JailBreak your iPhone You really need to be jailbroken to have a platform to work from Jailbreak breaks signing requirements for applications Opens the phone up to a variety of new uses Run software from other sources Develop software without need for Apple Developer cost Allows you access to the internals of the iPhone Jailbreak for 4.3.3 and beyond This changes often, so do your research Jailbreaking happens via an exploit, leveraged to patch the kernel Install Cydia and use that to install your tools Gcc/gdb SSH access Class-dump Whatever else you want
  • 5. Tools used Reverse engineering leverages several tools to get a better understanding of the code Disassembler Parses finished code into assembly language Understand and visualize program flow Provides cross references, searching, and other useful tools We use IDA Pro 6.0 in these examples Debugger Offers a view of the program at runtime Helpful for dynamic analysis Can tie into other reverse engineering artifacts We use gdb in these examples
  • 6. Tools - iPhone Specific Clutch – http://clutch.hackulo.us Tool to crack software Handles decrypting binaries automatically class-dump - http://www.codethecode.com/projects/class-dump/ Dumps internal Objective-C objects Helps understand interfaces, objects in project Itunnel - http://www.cs.toronto.edu/~jingsu/itunnel/ Useful for connecting from a host machine directly to a jailbrokeniphone For windows and unix (windows – search for itunnel.exe) Used in lieu of a WIFI connection
  • 8. Hardware Processor: ARM Cortex A8 Developed by Apple and Samsung Latest devices use A4 designation 32 bit RISC architecture Uses thumb extensions Radio functionality 3g Wifi Bluetooth Nordic Semiconductor proprietary chipset Camera Touch Screen
  • 9. Operating System iOS(previously iPhone OS) is currently at 4.3.3 Darwin based kernel Unix platform Ships drivers for all hardware OS versions defines support for various features iOS 4 brought multitasking, Game Center iOS 3 brought video, improved GPS Security Mechanisms Code Signing Sandboxing
  • 10. Programming on the iPhone Objective-C A superset of the C language Uses an Object oriented model Uses messages instead of calls Uses late runtime binding of objects Cocoa Appkit Graphics that fit UI guidelines FoundationKit Containers Value manipulation
  • 11. iPhone Binary Format Uses MACH-O format Comprised of a standard header a series of load commands a series of segments Sections within the segments The process of loading is Loader recognizes header Processes each load command Expands each segment Maps each section to memory Universal Binaries pair multiple platforms in one package iPhone binaries often have both ARM 6 and ARM 7
  • 12. Examining a Binary Key Steps to Disassemble an iPhone Binary Get the Binary Put it on the phone Decrypt the segments Transfer it off the phone Load it in your Disassembler PROFIT!
  • 13. Getting the Binary You can get the binary in a number of ways Download via iTunes Use iPhone Store app on device iPhone Backup Find third party place (be careful) Binary locations Itunes: My MusicTunesTunes Mediaobile Applications On Phone: /Applications /private/var/mobile/Applications
  • 14. Getting Files On and Off the Phone If you downloaded from the appstore, you can skip this step Itunes Do a simple sync Third party (and getting apps off the phone) Use SCP or iPhone Browser Clutch puts binaries here /var/root/Documents/Cracked/
  • 16. Installing From the Appstore Demo 2
  • 17. Decrypt the segments Appstore iPhone binaries are encrypted and signed Tied to the phone it is to be installed on Code segments are encrypted, so look like gibberish We need a way to decrypt The hard way Calculate encryption offsets Run program with debugger Dump unecrypted memory segment Patch binary with unecrypted segment Update references to crypto The easy way Clutch
  • 19. Load It into the Disassembler Unpack the clutch output ipa Ipa files are just zip files, you can rename them to .zip Should have a directory structure /some GUID /App files App is probably the largest file, has no extension Explore other files Use plist editor to examine .plist files DB/data files often SQLLite Load File into the Disassembler
  • 21. iPhone Binary Internals Uses Objective-C and Cocoa Calls are non-obvious Use python tool to fixup calls Reanalyze with new markup Code is ARM assembler Areas to look at Strings Areas of import Network calls Crypto Calls to key iPhone areas (mail, sms, calendar, etc) Key functionality per app Graphs help understand flow