SlideShare a Scribd company logo
Bypass Security Checking
With Frida
Hi!
I am Satria Ady Pradana
Cyber Security
Consultant
@
Mitra Integrasi
Informatika
xathrya.sabertooth
@xathrya
Reversing.ID
Revealing the Truth through Breaking Things
My problem as Reverser (And Pentester)
 I want to analyze some binary, application, or whatever
 How it works?
 What’s this functions for?
 Why they use this solution?
 Sometimes I want to know specific part of function.
 And sometimes the binary is protected with certain kinds of “magic”
 Bypass it? Of course
 Btw, I am lazy…
Solution (of OldSchool Technique)
 Code Injection to alter the behavior
 DLL Injection, modify IAT, hook function, etc …
Problem:
 Too much works!
 Need to recreate the DLL for each iteration.
Enter Frida!
What is Frida?
 Dynamic instrumentation toolkit
 Inspect and instrument live process
 Execute instrumentation scripts inside other processes
 Multiplatform
 Windows, Linux, Mac, iOS, Android, QNX
 Open source
DBI?
 Dynamic Binary Instrumentation
 Method of analyzing the behavior of a binary application at runtime through
the injection of instrumentation code.
 gain insight into the state of an application at various points in execution.
 Instrumentation code executes as part of the normal instruction stream after
being injected.
What can be done in DBI?
 Access process memory
 Overwrite functions while the application is running
 Call functions from imported classes
 Find object instance on the heap and use them
 Hook, trace, and intercept function.
Frida’s Dynamic Nature
 JavaScript API for instrumentation script (debugging logic)
 With various bindings:
 Python
 .NET
 JavaScript (Node.js)
 Qt/Qml
 etc
Install Frida
(Python)
 # python –m pip install Frida
 Or
 # pip install frida
Basics
 Attach to process (locally, remotely)
 Enumerate modules and threads
 Check function call’s arguments
 Modify arguments
 Modify function
Bypassing Security Check
In Our Example:
 Get Plaintext on Encryption Process
 Brute Force PIN
 Root Checking
 SSL Pinning
Get Plaintext on Encryption Process
 Concept: To produce a Ciphertext, an encryption process need a plaintext,
key, and some other parameters such as Initialization vector.
 Bypass: Hook the encryption function and log the plaintext data.
Brute Force PIN
 Concept: A PIN or password protected binary need a function to compare
user-input PIN with the correct one.
 Bypass: Hook the checking and force it to return true.
Root Checking
(Android, iOS)
 Concept: Check the presence of several items as result or end of rooting
process
 Does binary SU exist?
 Does apk Superuser exist?
 Bypass: Hook the checking and force it to return true.
SSL Pinning
 Concept: Use a local copy of x509 digital certificate to verify digital
certificate provided by server.
 Bypass: Hook the checking and force it to return true, regardless the value of
provided certificate.
Alternative?
 PIN:
 https://software.intel.com/en-us/articles/pin-a-dynamic-binary-instrumentation-
tool
 DynamoRIO:
 http://www.dynamorio.org/
In both cases, you write a code on top of those framework, compile them, and
inject the library into the target.

More Related Content

What's hot

Secure Coding - Web Application Security Vulnerabilities and Best Practices
Secure Coding - Web Application Security Vulnerabilities and Best PracticesSecure Coding - Web Application Security Vulnerabilities and Best Practices
Secure Coding - Web Application Security Vulnerabilities and Best Practices
Websecurify
 
Tema 4. Qué se entiende por cultura de masas.
Tema 4. Qué se entiende por cultura de masas.Tema 4. Qué se entiende por cultura de masas.
Tema 4. Qué se entiende por cultura de masas.
DiegoArias138
 

What's hot (20)

Continuous Deployment: The Dirty Details
Continuous Deployment: The Dirty DetailsContinuous Deployment: The Dirty Details
Continuous Deployment: The Dirty Details
 
Session 8 - Creating Data Processing Services | Train the Trainers Program
Session 8 - Creating Data Processing Services | Train the Trainers ProgramSession 8 - Creating Data Processing Services | Train the Trainers Program
Session 8 - Creating Data Processing Services | Train the Trainers Program
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & Development
 
Rest API Testing
Rest API TestingRest API Testing
Rest API Testing
 
How to Build Interoperable Decentralized Identity Systems with OpenID for Ver...
How to Build Interoperable Decentralized Identity Systems with OpenID for Ver...How to Build Interoperable Decentralized Identity Systems with OpenID for Ver...
How to Build Interoperable Decentralized Identity Systems with OpenID for Ver...
 
IBM: Hey FIDO, Meet Passkey!.pptx
IBM: Hey FIDO, Meet Passkey!.pptxIBM: Hey FIDO, Meet Passkey!.pptx
IBM: Hey FIDO, Meet Passkey!.pptx
 
API for Beginners
API for BeginnersAPI for Beginners
API for Beginners
 
Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...
Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...
Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...
 
Writing REST APIs with OpenAPI and Swagger Ada
Writing REST APIs with OpenAPI and Swagger AdaWriting REST APIs with OpenAPI and Swagger Ada
Writing REST APIs with OpenAPI and Swagger Ada
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
 
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
 
Version control system
Version control systemVersion control system
Version control system
 
Secure Coding - Web Application Security Vulnerabilities and Best Practices
Secure Coding - Web Application Security Vulnerabilities and Best PracticesSecure Coding - Web Application Security Vulnerabilities and Best Practices
Secure Coding - Web Application Security Vulnerabilities and Best Practices
 
Salesforce DevOps using GitHub Action
Salesforce DevOps using GitHub ActionSalesforce DevOps using GitHub Action
Salesforce DevOps using GitHub Action
 
Arquitetura de Internet das Coisas usando Google Cloud
Arquitetura de Internet das Coisas usando Google CloudArquitetura de Internet das Coisas usando Google Cloud
Arquitetura de Internet das Coisas usando Google Cloud
 
Tema 4. Qué se entiende por cultura de masas.
Tema 4. Qué se entiende por cultura de masas.Tema 4. Qué se entiende por cultura de masas.
Tema 4. Qué se entiende por cultura de masas.
 
Crowd sourcing social media
Crowd sourcing social mediaCrowd sourcing social media
Crowd sourcing social media
 
Rest API
Rest APIRest API
Rest API
 
iOS Application Security
iOS Application SecurityiOS Application Security
iOS Application Security
 
IdM and AC
IdM and ACIdM and AC
IdM and AC
 

Similar to Bypass Security Checking with Frida

Stuxnet redux. malware attribution & lessons learned
Stuxnet redux. malware attribution & lessons learnedStuxnet redux. malware attribution & lessons learned
Stuxnet redux. malware attribution & lessons learned
Yury Chemerkin
 
Secure visual algorithm simulator
Secure visual algorithm simulatorSecure visual algorithm simulator
Secure visual algorithm simulator
Prachi Singhal
 

Similar to Bypass Security Checking with Frida (20)

Bypass Security Checking with Frida
Bypass Security Checking with FridaBypass Security Checking with Frida
Bypass Security Checking with Frida
 
Microservices and Devs in Charge: Why Monitoring is an Analytics Problem
Microservices and Devs in Charge: Why Monitoring is an Analytics ProblemMicroservices and Devs in Charge: Why Monitoring is an Analytics Problem
Microservices and Devs in Charge: Why Monitoring is an Analytics Problem
 
Why monitoring is an analytics problem
Why monitoring is an analytics problemWhy monitoring is an analytics problem
Why monitoring is an analytics problem
 
From Reversing to Exploitation
From Reversing to ExploitationFrom Reversing to Exploitation
From Reversing to Exploitation
 
DEVNET-1010 Using Cisco pxGrid for Security Platform Integration
DEVNET-1010	Using Cisco pxGrid for Security Platform IntegrationDEVNET-1010	Using Cisco pxGrid for Security Platform Integration
DEVNET-1010 Using Cisco pxGrid for Security Platform Integration
 
From Reversing to Exploitation: Android Application Security in Essence
From Reversing to Exploitation: Android Application Security in EssenceFrom Reversing to Exploitation: Android Application Security in Essence
From Reversing to Exploitation: Android Application Security in Essence
 
Building Interpretable & Secure AI Systems using PyTorch
Building Interpretable & Secure AI Systems using PyTorchBuilding Interpretable & Secure AI Systems using PyTorch
Building Interpretable & Secure AI Systems using PyTorch
 
MobSecCon 2015 - Dynamic Analysis of Android Apps
MobSecCon 2015 - Dynamic Analysis of Android AppsMobSecCon 2015 - Dynamic Analysis of Android Apps
MobSecCon 2015 - Dynamic Analysis of Android Apps
 
Delivering Infrastructure and Security Policy as Code with Puppet and CyberAr...
Delivering Infrastructure and Security Policy as Code with Puppet and CyberAr...Delivering Infrastructure and Security Policy as Code with Puppet and CyberAr...
Delivering Infrastructure and Security Policy as Code with Puppet and CyberAr...
 
Java Hurdling: Obstacles and Techniques in Java Client Penetration-Testing
Java Hurdling: Obstacles and Techniques in Java Client Penetration-TestingJava Hurdling: Obstacles and Techniques in Java Client Penetration-Testing
Java Hurdling: Obstacles and Techniques in Java Client Penetration-Testing
 
Pentesting iOS Apps
Pentesting iOS AppsPentesting iOS Apps
Pentesting iOS Apps
 
Allegory of the cave(1)
Allegory of the cave(1)Allegory of the cave(1)
Allegory of the cave(1)
 
Stuxnet redux. malware attribution & lessons learned
Stuxnet redux. malware attribution & lessons learnedStuxnet redux. malware attribution & lessons learned
Stuxnet redux. malware attribution & lessons learned
 
Agile Secure Development
Agile Secure DevelopmentAgile Secure Development
Agile Secure Development
 
HITCON Defense Summit 2019 - 從 SAST 談持續式資安測試
HITCON Defense Summit 2019 - 從 SAST 談持續式資安測試HITCON Defense Summit 2019 - 從 SAST 談持續式資安測試
HITCON Defense Summit 2019 - 從 SAST 談持續式資安測試
 
Making Security Agile
Making Security AgileMaking Security Agile
Making Security Agile
 
The Hookshot: Runtime Exploitation
The Hookshot: Runtime ExploitationThe Hookshot: Runtime Exploitation
The Hookshot: Runtime Exploitation
 
SplunkLive! Zurich 2018: The Evolution of Splunk at Helvetia Insurance
SplunkLive! Zurich 2018: The Evolution of Splunk at Helvetia InsuranceSplunkLive! Zurich 2018: The Evolution of Splunk at Helvetia Insurance
SplunkLive! Zurich 2018: The Evolution of Splunk at Helvetia Insurance
 
Secure visual algorithm simulator
Secure visual algorithm simulatorSecure visual algorithm simulator
Secure visual algorithm simulator
 
Test driven development for infrastructure as-a-code, the future trend_Gianfr...
Test driven development for infrastructure as-a-code, the future trend_Gianfr...Test driven development for infrastructure as-a-code, the future trend_Gianfr...
Test driven development for infrastructure as-a-code, the future trend_Gianfr...
 

More from Satria Ady Pradana

More from Satria Ady Pradana (20)

Malware for Red Team
Malware for Red TeamMalware for Red Team
Malware for Red Team
 
Down The Rabbit Hole, From Networker to Security Professional
Down The Rabbit Hole, From Networker to Security ProfessionalDown The Rabbit Hole, From Networker to Security Professional
Down The Rabbit Hole, From Networker to Security Professional
 
MITM: Tales of Trust and Betrayal
MITM: Tales of Trust and BetrayalMITM: Tales of Trust and Betrayal
MITM: Tales of Trust and Betrayal
 
Berkarir di Cyber Security
Berkarir di Cyber SecurityBerkarir di Cyber Security
Berkarir di Cyber Security
 
IOT Security FUN-damental
IOT Security FUN-damentalIOT Security FUN-damental
IOT Security FUN-damental
 
IoT Security - Preparing for the Worst
IoT Security - Preparing for the WorstIoT Security - Preparing for the Worst
IoT Security - Preparing for the Worst
 
Silabus Training Reverse Engineering
Silabus Training Reverse EngineeringSilabus Training Reverse Engineering
Silabus Training Reverse Engineering
 
Practical Security - Modern Day Software
Practical Security - Modern Day SoftwarePractical Security - Modern Day Software
Practical Security - Modern Day Software
 
Firmware Reverse Engineering
Firmware Reverse EngineeringFirmware Reverse Engineering
Firmware Reverse Engineering
 
Reverse Engineering: The Crash Course
Reverse Engineering: The Crash CourseReverse Engineering: The Crash Course
Reverse Engineering: The Crash Course
 
The Offensive Python: Practical Python for Penetration Testing
The Offensive Python: Practical Python for Penetration TestingThe Offensive Python: Practical Python for Penetration Testing
The Offensive Python: Practical Python for Penetration Testing
 
Android Security: Art of Exploitation
Android Security: Art of ExploitationAndroid Security: Art of Exploitation
Android Security: Art of Exploitation
 
Malware: To The Realm of Malicious Code (Training)
Malware: To The Realm of Malicious Code (Training)Malware: To The Realm of Malicious Code (Training)
Malware: To The Realm of Malicious Code (Training)
 
Reverse Engineering: Protecting and Breaking the Software (Workshop)
Reverse Engineering: Protecting and Breaking the Software (Workshop)Reverse Engineering: Protecting and Breaking the Software (Workshop)
Reverse Engineering: Protecting and Breaking the Software (Workshop)
 
Reverse Engineering: Protecting and Breaking the Software
Reverse Engineering: Protecting and Breaking the SoftwareReverse Engineering: Protecting and Breaking the Software
Reverse Engineering: Protecting and Breaking the Software
 
Memory Forensic: Investigating Memory Artefact (Workshop)
Memory Forensic: Investigating Memory Artefact (Workshop)Memory Forensic: Investigating Memory Artefact (Workshop)
Memory Forensic: Investigating Memory Artefact (Workshop)
 
Memory Forensic: Investigating Memory Artefact
Memory Forensic: Investigating Memory ArtefactMemory Forensic: Investigating Memory Artefact
Memory Forensic: Investigating Memory Artefact
 
Another Side of Hacking
Another Side of HackingAnother Side of Hacking
Another Side of Hacking
 
Automatic Malware Analysis & Repository
Automatic Malware Analysis & RepositoryAutomatic Malware Analysis & Repository
Automatic Malware Analysis & Repository
 
Web Security Jumpstart
Web Security JumpstartWeb Security Jumpstart
Web Security Jumpstart
 

Recently uploaded

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Recently uploaded (20)

Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
The architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdfThe architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdf
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 

Bypass Security Checking with Frida

  • 2. Hi! I am Satria Ady Pradana Cyber Security Consultant @ Mitra Integrasi Informatika xathrya.sabertooth @xathrya Reversing.ID Revealing the Truth through Breaking Things
  • 3. My problem as Reverser (And Pentester)  I want to analyze some binary, application, or whatever  How it works?  What’s this functions for?  Why they use this solution?  Sometimes I want to know specific part of function.  And sometimes the binary is protected with certain kinds of “magic”  Bypass it? Of course  Btw, I am lazy…
  • 4. Solution (of OldSchool Technique)  Code Injection to alter the behavior  DLL Injection, modify IAT, hook function, etc … Problem:  Too much works!  Need to recreate the DLL for each iteration.
  • 6. What is Frida?  Dynamic instrumentation toolkit  Inspect and instrument live process  Execute instrumentation scripts inside other processes  Multiplatform  Windows, Linux, Mac, iOS, Android, QNX  Open source
  • 7. DBI?  Dynamic Binary Instrumentation  Method of analyzing the behavior of a binary application at runtime through the injection of instrumentation code.  gain insight into the state of an application at various points in execution.  Instrumentation code executes as part of the normal instruction stream after being injected.
  • 8. What can be done in DBI?  Access process memory  Overwrite functions while the application is running  Call functions from imported classes  Find object instance on the heap and use them  Hook, trace, and intercept function.
  • 9. Frida’s Dynamic Nature  JavaScript API for instrumentation script (debugging logic)  With various bindings:  Python  .NET  JavaScript (Node.js)  Qt/Qml  etc
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15. Install Frida (Python)  # python –m pip install Frida  Or  # pip install frida
  • 16. Basics  Attach to process (locally, remotely)  Enumerate modules and threads  Check function call’s arguments  Modify arguments  Modify function
  • 17. Bypassing Security Check In Our Example:  Get Plaintext on Encryption Process  Brute Force PIN  Root Checking  SSL Pinning
  • 18. Get Plaintext on Encryption Process  Concept: To produce a Ciphertext, an encryption process need a plaintext, key, and some other parameters such as Initialization vector.  Bypass: Hook the encryption function and log the plaintext data.
  • 19. Brute Force PIN  Concept: A PIN or password protected binary need a function to compare user-input PIN with the correct one.  Bypass: Hook the checking and force it to return true.
  • 20. Root Checking (Android, iOS)  Concept: Check the presence of several items as result or end of rooting process  Does binary SU exist?  Does apk Superuser exist?  Bypass: Hook the checking and force it to return true.
  • 21. SSL Pinning  Concept: Use a local copy of x509 digital certificate to verify digital certificate provided by server.  Bypass: Hook the checking and force it to return true, regardless the value of provided certificate.
  • 22. Alternative?  PIN:  https://software.intel.com/en-us/articles/pin-a-dynamic-binary-instrumentation- tool  DynamoRIO:  http://www.dynamorio.org/ In both cases, you write a code on top of those framework, compile them, and inject the library into the target.