SlideShare a Scribd company logo
Prathan Phongthiproek
KPMG Thailand
TheHookshot:RuntimeExploitation
@zeq3ul
• Just a guy who is passionate in
(offensive)security ~ 10 years+
• Dota2 SEA MMR ~ 3k+
• Rainbow Six Siege LVL ~ 100+
“Keep farming (Self-study)
and
Challenge the Roshan (Get certificate)”
tanprathan
pprathan
prathan
TL;DR
• Motivation
• Dynamic binary instrumentation
• FRIDA
• DBI without rooting / jailbreaking
• Unleash the power of Frida
• Case study for runtime exploitation
• Countermeasure
• References
Motivation
• Root / Jailbreak Detection
• SSL Pinning Implementation
• End-to-end encryption on top of TLS
• Cellular network (4G) restriction
Dynamic binary instrumentation
• A method of analyzing the behavior of a binary application at
runtime through the injection of instrumentation code.
• DBI can :
• Access process memory
• Overwrite functions while the application is running
• Call functions from imported classes
• Find object instances on the heap and use them
• Hook, trace and intercept functions etc.
FRIDA
• Dynamic code instrumentation toolkit allowing you to hook into
applications while running, inject your own JavaScript while getting
complete access to the memory and functions.
• With Frida, we got the power to :
• Bypass Root / Jailbreak Detection
• Bypass SSL Pinning
• Modify the encrypted traffic over TLS
• Pwn the application without using proxy
• Bypass local authentication
• Subvert business logic
• Increase game gems without purchasing
FRIDA
Client Server
https://www.frida.re/docs/installation/
Tip!! How to root/jailbreak device
• Android
• https://www.xda-developers.com/root/
• iOS
• https://canijailbreak.com
Jailbreak Type Processor iOS Version Duration
Untethered jailbreak
32 bit
7.0.0-7.1.2 September 18, 2013 - September 16, 2014
8.0-8.4 September 17, 2014 - August 12, 2015
64 bit 9.0-9.1 September 16 2015 - December 7, 2015
Semi untethered jailbreak
32 bit
8.4.1 August 13, 2015 - September 15, 2015
9.1-9.3.5 October 21, 2015 - September 12, 2016
64 bit 9.2-9.3.3 December 8, 2015 - August 3, 2016
Unstable (Don’t work on i7) 64 bit 10.0 - 10.2 September 13, 2016- January 22, 2017
FRIDA
Bypass local authentication on Android
https://vimeo.com/235930373
FRIDA
Bypass Jailbreak Detection on iOS
https://vimeo.com/236043814
DBI without rooting / jailbreaking
Library Injection
• Re-route application control during library initialization
• Be able to conduct Runtime analysis
without rooting or jailbreaking the device
• Bypass Root/Jailbreak detection
Library Injection on Android app
Library Injection on Android app
Library Injection on Android app
Dissemble the app using apktool
Insert the Frida native library ("frida-gadget") into the APK’s /lib folder
Inject a System.loadLibrary ("frida-gadget") call into the bytecode of the app
(Main application activity)
Add the Internet permission to the manifest, so that Frida gadget can open a
socket
Repackage the app, Resign the updated APK using your own keys and
zipalign
Library Injection on Android app
• An automated script for unpacking,
patching (Insert the frida library into
binary), re-packaging, re-signing and
deploying apps on non-rooted device.
• https://github.com/dpnishant/appmon/
tree/master/apk_builder
Dynamic Library (DYLIB) Injection on iOS app
Mach-O File Structure
Dynamic Library (DYLIB) Injection on iOS app
Dynamic Library (DYLIB) Injection on iOS app
Dynamic Library (DYLIB) Injection on iOS app
Create a developer profile, provision profile and Certificate
Insert the Frida library (FridaGadget.dylib) to the application container, Insert
the load command on the load commands section of the binary
Increment the load command counter on the header section, Increase the
size binary number on the header section
Re-package the application by replacing the provision profile, re-sign both the
main executable and FridaGadget.dylib with the certificate listed in the
profile
Deploy all set of application container and run the application on device as
debug mode
Dynamic Library (DYLIB) Injection on iOS app
• An automated script for unpacking,
patching (Insert the load command
into binary), re-signing and deploying
apps on non-jailbroken device.
https://github.com/tanprathan/Fridpa
Unleash the power of Frida
https://codeshare.frida.re
Unleash the power of Frida
• Objection uses Frida to inject objects
into an applications runtime and
executes them within that applications
security context to perform various
tasks.
https://github.com/sensepost/objection
• An automated framework for
monitoring and tampering system API
calls of native MacOS, iOS and
Android apps.
https://github.com/dpnishant/appmon
Unleash the power of Frida
Using FRIDA without Jailbreaking
https://vimeo.com/236055614
• Mobile banking application (Android, iOS) that:
• Conducted source code review from commercial tools
• Be able to detect Root/Jailbreak
• Implemented SSL Pinning
• Implemented end-to-end encryption
Case study for runtime exploitation
• Mobile banking application (Android, iOS) that:
• Conducted source code review from commercial tools
• Be able to detect Root/Jailbreak
• Implemented SSL Pinning
• Implemented end-to-end encryption
Case study for runtime exploitation
tsprotector
TrustKiller
Case study for runtime exploitation
• Decrypted the app and performed reverse engineering
• Analyzed the app classes and methods
• Found some interesting class name and method
• Created script to intercept the class and method
• Customized script to manipulate the argument
• Bypassed the business logic on the app coz they didn’t validate at server-side
NOOB SPOTTED !!
Case study for runtime exploitation
Countermeasures
Defense in depth and Fix root causes
MSTG	and	MASVS
References
• http://www.ninoishere.com/frida-learn-by-example/
• https://www.slideshare.net/andreaskurtz/pentesting-i-os-apps-deepsec-2012-andreas-kurtz-15423426
• https://www.notsosecure.com/pentesting-android-apps-using-frida/
• http://blog.attify.com/2017/05/06/bypass-jailbreak-detection-frida-ios-applications/
• https://github.com/interference-security/frida-scripts/blob/master/iOS/frida_python_script.py
• https://koz.io/using-frida-on-android-without-root/
• https://www.nccgroup.trust/uk/about-us/newsroom-and-events/blogs/2016/october/ios-instrumentation-without-jailbreak/
• https://www.vantagepoint.sg/blog/85-patching-and-re-signing-ios-apps

More Related Content

PDF
Introduction to Frida
PDF
FRIDA 101 Android
PPTX
Pentesting Android Apps using Frida (Beginners)
PDF
DBI-Assisted Android Application Reverse Engineering
PDF
Testing Android Security Codemotion Amsterdam edition
PPTX
[Wroclaw #2] iOS Security - 101
PDF
Learning by hacking - android application hacking tutorial
PDF
Frida Android run time hooking - Bhargav Gajera & Vitthal Shinde
Introduction to Frida
FRIDA 101 Android
Pentesting Android Apps using Frida (Beginners)
DBI-Assisted Android Application Reverse Engineering
Testing Android Security Codemotion Amsterdam edition
[Wroclaw #2] iOS Security - 101
Learning by hacking - android application hacking tutorial
Frida Android run time hooking - Bhargav Gajera & Vitthal Shinde

What's hot (20)

PDF
[CONFidence 2016] Glenn ten Cate - OWASP-SKF Making the web secure by design,...
PPTX
Drozer - An Android Application Security Tool
PDF
Breaking iOS Apps using Cycript
PDF
How to reverse engineer Android applications
PDF
Defeating firefox by Muneaki Nishimunea - CODE BLUE 2015
PDF
[CONFidence 2016] Andrey Plastunov - Simple bugs to pwn the devs
PDF
Understanding Windows Access Token Manipulation
PDF
[CONFidence 2016] Sławomir Kosowski - Introduction to iOS Application Securit...
PDF
Null 14 may_lesser_known_attacks_by_ninadsarang
PDF
Null Mumbai Meet_Android Reverse Engineering by Samrat Das
PDF
Android Tamer (Anant Shrivastava)
PPT
Reverse Engineering Android Application
PDF
What Can Reverse Engineering Do For You?
PPTX
iOS Application Exploitation
PDF
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...
PDF
Introduction to Dynamic Analysis of Android Application
PDF
Android Tamer BH USA 2016 : Arsenal Presentation
PPT
Steelcon 2015 Reverse-Engineering Obfuscated Android Applications
PDF
Android reverse engineering: understanding third-party applications. OWASP EU...
PPTX
Fuzzing | Null OWASP Mumbai | 2016 June
[CONFidence 2016] Glenn ten Cate - OWASP-SKF Making the web secure by design,...
Drozer - An Android Application Security Tool
Breaking iOS Apps using Cycript
How to reverse engineer Android applications
Defeating firefox by Muneaki Nishimunea - CODE BLUE 2015
[CONFidence 2016] Andrey Plastunov - Simple bugs to pwn the devs
Understanding Windows Access Token Manipulation
[CONFidence 2016] Sławomir Kosowski - Introduction to iOS Application Securit...
Null 14 may_lesser_known_attacks_by_ninadsarang
Null Mumbai Meet_Android Reverse Engineering by Samrat Das
Android Tamer (Anant Shrivastava)
Reverse Engineering Android Application
What Can Reverse Engineering Do For You?
iOS Application Exploitation
BlackHat 2014 Briefings - Exploiting Fundamental Weaknesses in Botnet C&C Pan...
Introduction to Dynamic Analysis of Android Application
Android Tamer BH USA 2016 : Arsenal Presentation
Steelcon 2015 Reverse-Engineering Obfuscated Android Applications
Android reverse engineering: understanding third-party applications. OWASP EU...
Fuzzing | Null OWASP Mumbai | 2016 June
Ad

Similar to The Hookshot: Runtime Exploitation (20)

PPT
Outsmarting SmartPhones
PDF
Hacking and Securing iOS Apps : Part 1
PPTX
Pentesting Android Applications
PDF
CNIT 128: 3. Attacking iOS Applications (Part 2)
PPTX
From Reversing to Exploitation
PPTX
Hacking Samsung's Tizen: The OS of Everything - Hack In the Box 2015
PPTX
From Reversing to Exploitation: Android Application Security in Essence
PDF
9 Writing Secure Android Applications
PPTX
Bypass Security Checking with Frida
PDF
Droidcon it-2014-marco-grassi-viaforensics
PDF
3. Attacking iOS Applications (Part 2)
PDF
CNIT 128 3. Attacking iOS Applications (Part 2)
PPTX
Android Penetration Testing - Day 3
PPTX
Hacking Tizen : The OS of Everything - Nullcon Goa 2015
PDF
Android malware presentation
PDF
Hacking your Droid (Aditya Gupta)
PDF
Android_Malware_IOAsis_2014_Analysis.pdf
PDF
MOBILE PENTESTING Frida.pdf
PPTX
Mobile App Penetration Testing Bsides312
PPTX
Pentesting iOS Applications
Outsmarting SmartPhones
Hacking and Securing iOS Apps : Part 1
Pentesting Android Applications
CNIT 128: 3. Attacking iOS Applications (Part 2)
From Reversing to Exploitation
Hacking Samsung's Tizen: The OS of Everything - Hack In the Box 2015
From Reversing to Exploitation: Android Application Security in Essence
9 Writing Secure Android Applications
Bypass Security Checking with Frida
Droidcon it-2014-marco-grassi-viaforensics
3. Attacking iOS Applications (Part 2)
CNIT 128 3. Attacking iOS Applications (Part 2)
Android Penetration Testing - Day 3
Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Android malware presentation
Hacking your Droid (Aditya Gupta)
Android_Malware_IOAsis_2014_Analysis.pdf
MOBILE PENTESTING Frida.pdf
Mobile App Penetration Testing Bsides312
Pentesting iOS Applications
Ad

More from Prathan Phongthiproek (20)

PDF
Mobile Defense-in-Dev (Depth)
PDF
The CARzyPire - Another Red Team Operation
PDF
Cyber Kill Chain: Web Application Exploitation
PDF
Mobile App Hacking In A Nutshell
PDF
Jump-Start The MASVS
PDF
OWASP Mobile Top 10 Deep-Dive
PDF
Understanding ransomware
PDF
OWASP Day - OWASP Day - Lets secure!
PDF
Don't Trust, And Verify - Mobile Application Attacks
PDF
Owasp Top 10 Mobile Risks
PDF
Point-Of-Sale Hacking - 2600Thailand#20
PDF
OWASP Thailand-Beyond the Penetration Testing
PDF
Mobile Application Pentest [Fast-Track]
PPTX
Hack and Slash: Secure Coding
PPTX
CDIC 2013-Mobile Application Pentest Workshop
PDF
Web Application Firewall: Suckseed or Succeed
PDF
Layer8 exploitation: Lock'n Load Target
PDF
Advanced Malware Analysis
PDF
Tisa mobile forensic
PDF
Tisa-Social Network and Mobile Security
Mobile Defense-in-Dev (Depth)
The CARzyPire - Another Red Team Operation
Cyber Kill Chain: Web Application Exploitation
Mobile App Hacking In A Nutshell
Jump-Start The MASVS
OWASP Mobile Top 10 Deep-Dive
Understanding ransomware
OWASP Day - OWASP Day - Lets secure!
Don't Trust, And Verify - Mobile Application Attacks
Owasp Top 10 Mobile Risks
Point-Of-Sale Hacking - 2600Thailand#20
OWASP Thailand-Beyond the Penetration Testing
Mobile Application Pentest [Fast-Track]
Hack and Slash: Secure Coding
CDIC 2013-Mobile Application Pentest Workshop
Web Application Firewall: Suckseed or Succeed
Layer8 exploitation: Lock'n Load Target
Advanced Malware Analysis
Tisa mobile forensic
Tisa-Social Network and Mobile Security

Recently uploaded (20)

PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Machine learning based COVID-19 study performance prediction
PDF
Approach and Philosophy of On baking technology
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Encapsulation theory and applications.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
The Rise and Fall of 3GPP – Time for a Sabbatical?
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Machine learning based COVID-19 study performance prediction
Approach and Philosophy of On baking technology
Unlocking AI with Model Context Protocol (MCP)
Digital-Transformation-Roadmap-for-Companies.pptx
cuic standard and advanced reporting.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Encapsulation_ Review paper, used for researhc scholars
MYSQL Presentation for SQL database connectivity
Programs and apps: productivity, graphics, security and other tools
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
“AI and Expert System Decision Support & Business Intelligence Systems”
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...

The Hookshot: Runtime Exploitation

  • 2. @zeq3ul • Just a guy who is passionate in (offensive)security ~ 10 years+ • Dota2 SEA MMR ~ 3k+ • Rainbow Six Siege LVL ~ 100+ “Keep farming (Self-study) and Challenge the Roshan (Get certificate)” tanprathan pprathan prathan
  • 3. TL;DR • Motivation • Dynamic binary instrumentation • FRIDA • DBI without rooting / jailbreaking • Unleash the power of Frida • Case study for runtime exploitation • Countermeasure • References
  • 4. Motivation • Root / Jailbreak Detection • SSL Pinning Implementation • End-to-end encryption on top of TLS • Cellular network (4G) restriction
  • 5. Dynamic binary instrumentation • A method of analyzing the behavior of a binary application at runtime through the injection of instrumentation code. • DBI can : • Access process memory • Overwrite functions while the application is running • Call functions from imported classes • Find object instances on the heap and use them • Hook, trace and intercept functions etc.
  • 6. FRIDA • Dynamic code instrumentation toolkit allowing you to hook into applications while running, inject your own JavaScript while getting complete access to the memory and functions. • With Frida, we got the power to : • Bypass Root / Jailbreak Detection • Bypass SSL Pinning • Modify the encrypted traffic over TLS • Pwn the application without using proxy • Bypass local authentication • Subvert business logic • Increase game gems without purchasing
  • 8. Tip!! How to root/jailbreak device • Android • https://www.xda-developers.com/root/ • iOS • https://canijailbreak.com Jailbreak Type Processor iOS Version Duration Untethered jailbreak 32 bit 7.0.0-7.1.2 September 18, 2013 - September 16, 2014 8.0-8.4 September 17, 2014 - August 12, 2015 64 bit 9.0-9.1 September 16 2015 - December 7, 2015 Semi untethered jailbreak 32 bit 8.4.1 August 13, 2015 - September 15, 2015 9.1-9.3.5 October 21, 2015 - September 12, 2016 64 bit 9.2-9.3.3 December 8, 2015 - August 3, 2016 Unstable (Don’t work on i7) 64 bit 10.0 - 10.2 September 13, 2016- January 22, 2017
  • 9. FRIDA Bypass local authentication on Android https://vimeo.com/235930373
  • 10. FRIDA Bypass Jailbreak Detection on iOS https://vimeo.com/236043814
  • 11. DBI without rooting / jailbreaking
  • 12. Library Injection • Re-route application control during library initialization • Be able to conduct Runtime analysis without rooting or jailbreaking the device • Bypass Root/Jailbreak detection
  • 13. Library Injection on Android app
  • 14. Library Injection on Android app
  • 15. Library Injection on Android app Dissemble the app using apktool Insert the Frida native library ("frida-gadget") into the APK’s /lib folder Inject a System.loadLibrary ("frida-gadget") call into the bytecode of the app (Main application activity) Add the Internet permission to the manifest, so that Frida gadget can open a socket Repackage the app, Resign the updated APK using your own keys and zipalign
  • 16. Library Injection on Android app • An automated script for unpacking, patching (Insert the frida library into binary), re-packaging, re-signing and deploying apps on non-rooted device. • https://github.com/dpnishant/appmon/ tree/master/apk_builder
  • 17. Dynamic Library (DYLIB) Injection on iOS app Mach-O File Structure
  • 18. Dynamic Library (DYLIB) Injection on iOS app
  • 19. Dynamic Library (DYLIB) Injection on iOS app
  • 20. Dynamic Library (DYLIB) Injection on iOS app Create a developer profile, provision profile and Certificate Insert the Frida library (FridaGadget.dylib) to the application container, Insert the load command on the load commands section of the binary Increment the load command counter on the header section, Increase the size binary number on the header section Re-package the application by replacing the provision profile, re-sign both the main executable and FridaGadget.dylib with the certificate listed in the profile Deploy all set of application container and run the application on device as debug mode
  • 21. Dynamic Library (DYLIB) Injection on iOS app • An automated script for unpacking, patching (Insert the load command into binary), re-signing and deploying apps on non-jailbroken device. https://github.com/tanprathan/Fridpa
  • 22. Unleash the power of Frida https://codeshare.frida.re
  • 23. Unleash the power of Frida • Objection uses Frida to inject objects into an applications runtime and executes them within that applications security context to perform various tasks. https://github.com/sensepost/objection • An automated framework for monitoring and tampering system API calls of native MacOS, iOS and Android apps. https://github.com/dpnishant/appmon
  • 24. Unleash the power of Frida Using FRIDA without Jailbreaking https://vimeo.com/236055614
  • 25. • Mobile banking application (Android, iOS) that: • Conducted source code review from commercial tools • Be able to detect Root/Jailbreak • Implemented SSL Pinning • Implemented end-to-end encryption Case study for runtime exploitation
  • 26. • Mobile banking application (Android, iOS) that: • Conducted source code review from commercial tools • Be able to detect Root/Jailbreak • Implemented SSL Pinning • Implemented end-to-end encryption Case study for runtime exploitation tsprotector TrustKiller
  • 27. Case study for runtime exploitation • Decrypted the app and performed reverse engineering • Analyzed the app classes and methods • Found some interesting class name and method • Created script to intercept the class and method • Customized script to manipulate the argument • Bypassed the business logic on the app coz they didn’t validate at server-side NOOB SPOTTED !!
  • 28. Case study for runtime exploitation
  • 29. Countermeasures Defense in depth and Fix root causes MSTG and MASVS
  • 30. References • http://www.ninoishere.com/frida-learn-by-example/ • https://www.slideshare.net/andreaskurtz/pentesting-i-os-apps-deepsec-2012-andreas-kurtz-15423426 • https://www.notsosecure.com/pentesting-android-apps-using-frida/ • http://blog.attify.com/2017/05/06/bypass-jailbreak-detection-frida-ios-applications/ • https://github.com/interference-security/frida-scripts/blob/master/iOS/frida_python_script.py • https://koz.io/using-frida-on-android-without-root/ • https://www.nccgroup.trust/uk/about-us/newsroom-and-events/blogs/2016/october/ios-instrumentation-without-jailbreak/ • https://www.vantagepoint.sg/blog/85-patching-and-re-signing-ios-apps