SlideShare una empresa de Scribd logo
1 de 31
Descargar para leer sin conexión
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
OSS TOOLS: CREATING A
REVERSE ENGINEERING
PLUGIN FOR R2FRIDA
Merging the power of static & dynamic analysis
© Copyright 2018 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
ALL THINGS MOBILE DEVSECOPS
Subscribe Here
https://www.nowsecure.com/go/subscribe/
Semi-monthly Newsletter
Delivered 1st & 3rd Wednesdays of the month
Resources for the Mobile DevSecOps journey
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
ASK A QUESTION ANY TIME
Use the “Ask a Question” tab below the slides
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
NOWSECURE COMPANY INNOVATION TIMELINE
NowSecure Sponsorship
of OSS FRIDA & RADARE
(2015)
Launch NowSecure INTEL
for Production AppStore
Monitoring (2018)
Launch NowSecure Workstation
Complete Analyst Mobile
AppSec Testing Kit (2015)
ViaForensics
Founded (2009)
Launch Mobile Forensic
Analysis Services (2010)
Launch Mobile App Pen
Testing Services (2012)
NowSecure Series A
& Company Rename
(2014)
Launch NowSecure AUTO for
Shift Left CI/CD-integrated
Mobile AppSec Testing (2017)
Publish Books “Android Forensics”
& “iOS Forensics” (2011)
NOWSECURE MISSION: Saving the World from Unsafe Mobile Apps
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
On a scale of 1 to 5, rate your level of knowledge of mobile app security.
1. beginner
2. novice
3. intermediate
4. advanced
5. expert
POLL #1
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
AGENDA
INTRODUCTION
WHAT IS R2 & FRIDA?
WHAT’S NEW IN R2 & FRIDA?
WHAT IS R2FRIDA?
EXTENDING R2FRIDA WITH PLUGINS
Q&A
MODERATOR
BRIAN REED
CMO, NOWSECURE
SERGI ALVAREZ I CAPILLA
AUTHOR OF RADARE2
SPEAKER
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
WHO AM I?
▪ My name is Sergi Àlvarez i Capilla
▪ But most people know me as pancake
▪ Author of radare2, r2frida, applesign,
fsmon, valabind, acr, 0xFFFF, and many,
many other open source tools out there.
▪ Senior Mobile Security Research Engineer
▪ Working at NowSecure
▪ Spend my time building new tools and find
new ways to improve our products that make
safer Mobile apps.
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
On a scale of 1 to 5, rate your level of experience with r2.
1. beginner
2. novice
3. intermediate
4. advanced
5. expert
POLL #2
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
WHAT’S R2?
▪ 13yo OpenSource RE framework (tools + apis)
▪ It started as a simple hexadecimal editor for forensics.
▪ Quickly evolved, adding support for analysis,
disassembling, debugging, emulation, ...
▪ Cover many topics related to computer security:
▪ Exploiting, fuzzing, cracking, SRE, forensics..
▪ It’s written in C: small, fast and portable
▪ Easy to script with an expressive commandline shell
▪ Can be extended with plugins written in native or
dynamic languages
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
On a scale of 1 to 5, rate your level of experience with Frida.
1. beginner
2. novice
3. intermediate
4. advanced
5. expert
POLL #3
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
WHAT’S FRIDA?
Dynamic instrumentation toolkit written by my colleague Ole André
▪ Written in C with bindings for JavaScript and Python
▪ It’s the best introspection tooling for iOS and Android
▪ Injects an egg with a JS interpreter into the target process.
▪ At this point you can instrument the entire process with js
▪ Provides APIs to read/write memory, list symbols, add traces, ..
▪ Modify the behaviour or trace protocols, APIs, behaviours, ..
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
WHAT’S NEW IN R2 AND FRIDA?
There are ~500 commits/month in r2,
▪ So it’s hard to describe all the
improvements and new features in
a single slide.
Both projects have a solid userbase
and the main development focus is on
improving the core, cleanup/ refactor,
and improve usability.
▪ Frida
▪ Crashlog retrieval for iOS/Android
▪ Shorter APIs and more OO
▪ New Kernel APIs for tfp0
▪ ChromeDev tools
▪ Radare2
▪ Better graphs + navigation
▪ Improved Code and type analysis
▪ Performance improvements
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
WHAT’S R2FRIDA?
IO plugin for radare2 that uses Frida as backend.
Extends the scripting and static analysis capabilities of r2 with all the dynamic
analysis, code injection and tracing facilities of Frida.
▪ Works seamlessly on iOS, Android, macOS, Linux and Windows.
▪ Read/Write remote process memory from r2
▪ Type short commands instead of writing code
▪ Also can access remote filesystems
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
R2FRIDA OVERVIEW
▪ Radare2 runs in host
▪ r2frida is an r2 plugin that links
against the Frida SDK
▪ Spawn/attach local/remote
processes.
▪ Extend agent commands with plugins
▪ Frida-Server runs in the device
▪ Provides Interface to talk to inspect
processes and attach from host.
▪ End to end r2pipe
▪ r2frida commands mimic r2 ones
▪ Handle sync and async
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
WHAT’S NEW IN R2FRIDA v3.4
▪ New URI handler schema
▪ frida://usb/deviceid/spawn/appname
▪ Improved trace-logs support
▪ Trace logs are now cached and accessible via dtl
▪ All traces generate a JSON message sent to host for later postprocessing
▪ Trace-logs have counters, timestamp, module name, symbol name, address, ...
▪ Binary information listed depends on the current seek
▪ Added command to get the entrypoint of the program
▪ Fuzzy resolution of objc methods by using the objc: prefix
▪ Support remote FileSystems on all unix targets
▪ Retrieve crashlog message from device (ios + android only)
▪ Improved support for Android tracing and return injection
▪ Faster addr2name and name2addr resolutions
▪ Safer pointer/data auto-identification with isObjC and such
▪ Resolve thread and file descriptor names
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
SIMPLE R2FRIDA EXAMPLE DEMO
Attach to a running while hello world program and change the program behaviour at runtime
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
EXTENDING R2FRIDA WITH PLUGINS
R2 can interpret scripts in several languages, interact with r2 via r2pipe.
▪ Use r2pipe to script anything in r2frida from Rust, Python, Ruby, NodeJS, Java, ...
Run Frida oneliners (or run a js file in the agent) from the r2 shell
▪ Useful for small stuff, but kind of annoying for large code snippets
The R2Frida plugin API can extend the r2frida commands
▪ Load/Unload and List those plugins
▪ Loaded in the agent side and fully compatible with Frida scripts
▪ Allows to run r2 commands from the agent side
▪ r2frida global object to access trace logs or register new commands
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
HELLO WORLD PLUGIN EXAMPLE
Basic plugin example looks like this:
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
What else can be interesting for the analyst to have in r2frida?
▪ UI interaction commands
▪ Cookie tracing and curlification of http traffic
▪ Use your own custom trace hooks
▪ Integration with Frida CodeShare
▪ Web interface on top of the internal r2’s http webserver
▪ Expose a fake filesystem to the process
▪ Bypass anti-debugging or authentication protections
▪ OS-specific features
BEYOND THE HELLO WORLD
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
CREATING THE PLUGIN
Open your favourite editor and create this hookurl.js
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
RUNNING THE PLUGIN
The ‘urls’ command will show all the URLs captured from the NSURL traces
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
EXTRACTING URLS FROM LOGS
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
By typing:
▪ dtf objc:NSURL.^URLWithString:$ ooo
We get noisy messages with the trace information
▪ e hook.verbose=false
We can list the trace
▪ dtlj~{}
And finally get the QR codes with the plugin:
▪ .hookurl qrs
TRACING NSURL INTO QR CODES
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
BACKTRACE GRAPHS
hookurls btgraph
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
REMOTE FILESYSTEM ACCESS DEMO
▪ IO plugins can expose commands to support mounting remote
filesystems and accessible via the ‘m’ command
▪ ‘mo’ command will open a remote file in memory for local analysis
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
WEBUI AND R2PIPE
With r2frida, it is also possible to use any r2pipe script or the Web browser
with your custom interface to automate Frida and r2 at the same time.
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
FINAL WORDS
▪ Radare2 and Frida are powerful open source tools
▪ They provide many ways to extend them and integrate with other tools
▪ R2frida is also open-source and combines the power of both
▪ Bring the state of the art in Reverse Engineering Mobile to the analyst
▪ https://rada.re
▪ https://github.com/nowsecure/r2frida
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
bit.ly/Connect-2019
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
MONDAY - DAY 1
Mobile Security Analysts Toolbox
In depth OSS Training Sessions
▪ Frida
▪ Radare
▪ r2Frida
▪ Capstone
▪ Ret2dec
▪ ZigBee
▪ And more…
Monday Night Party
NOWSECURE CONNECT19 OSS TRACK
TUESDAY - DAY 2
Mobile OSS tools hackathon
▪ Multiple tools and tracks
New OSS Tool Launch Sessions
▪ Multiple new OSS tools
Tool Creator’s Panel
Contest Awards
bit.ly/Connect-2019
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
NOWSECURE COMING ATTRACTIONS
NowSecure Connect 2019
Jun 3-4, 2019 | Washington D.C.
Black Hat USA (Training + Conference)
Aug 3-8, 2019 | Las Vegas, NV
r2con
Sep 4-7, 2019 | Barcelona, Spain
Webinar: Integrating Security into the
Mobile App DevOps Ecosystem
May 22, 2019
© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
OPEN Q&A
Use the “Ask a Question” tab below the slides
BRIAN REED
CMO
PANCAKE
Radare2 Author

Más contenido relacionado

La actualidad más candente

Mobile App Security Predictions 2019
Mobile App Security Predictions 2019Mobile App Security Predictions 2019
Mobile App Security Predictions 2019NowSecure
 
From Tangled Mess to Organized Flow: A Mobile DevSecOps Reference Architecture
From Tangled Mess to Organized Flow: A Mobile DevSecOps Reference ArchitectureFrom Tangled Mess to Organized Flow: A Mobile DevSecOps Reference Architecture
From Tangled Mess to Organized Flow: A Mobile DevSecOps Reference ArchitectureNowSecure
 
5 Tips for Agile Mobile App Security Testing
5 Tips for Agile Mobile App Security Testing5 Tips for Agile Mobile App Security Testing
5 Tips for Agile Mobile App Security TestingNowSecure
 
85% of App Store Apps Fail OWASP Mobile Top 10: Are you exposed?
85% of App Store Apps Fail OWASP Mobile Top 10: Are you exposed?85% of App Store Apps Fail OWASP Mobile Top 10: Are you exposed?
85% of App Store Apps Fail OWASP Mobile Top 10: Are you exposed?NowSecure
 
Mobile Penetration Testing: Episode III - Attack of the Code
Mobile Penetration Testing: Episode III - Attack of the CodeMobile Penetration Testing: Episode III - Attack of the Code
Mobile Penetration Testing: Episode III - Attack of the CodeNowSecure
 
How Android and iOS Security Enhancements Complicate Threat Detection
How Android and iOS Security Enhancements Complicate Threat DetectionHow Android and iOS Security Enhancements Complicate Threat Detection
How Android and iOS Security Enhancements Complicate Threat DetectionNowSecure
 
Mobile Penetration Testing: Episode 1 - The Forensic Menace
Mobile Penetration Testing: Episode 1 - The Forensic MenaceMobile Penetration Testing: Episode 1 - The Forensic Menace
Mobile Penetration Testing: Episode 1 - The Forensic MenaceNowSecure
 
5 Mobile App Security MUST-DOs in 2018
5 Mobile App Security MUST-DOs in 20185 Mobile App Security MUST-DOs in 2018
5 Mobile App Security MUST-DOs in 2018NowSecure
 
Backstage Tour of Identity - London Identity Summit
Backstage Tour of Identity - London Identity SummitBackstage Tour of Identity - London Identity Summit
Backstage Tour of Identity - London Identity SummitForgeRock
 
The fundamentals of Android and iOS app security
The fundamentals of Android and iOS app securityThe fundamentals of Android and iOS app security
The fundamentals of Android and iOS app securityNowSecure
 
I mas appsecusa-nov13-v2
I mas appsecusa-nov13-v2I mas appsecusa-nov13-v2
I mas appsecusa-nov13-v2drewz lin
 
Identity Relationship Management - The Right Approach for a Complex Digital W...
Identity Relationship Management - The Right Approach for a Complex Digital W...Identity Relationship Management - The Right Approach for a Complex Digital W...
Identity Relationship Management - The Right Approach for a Complex Digital W...ForgeRock
 
Cyber Kill Chain: Web Application Exploitation
Cyber Kill Chain: Web Application ExploitationCyber Kill Chain: Web Application Exploitation
Cyber Kill Chain: Web Application ExploitationPrathan Phongthiproek
 
OWASP Mobile Top 10
OWASP Mobile Top 10OWASP Mobile Top 10
OWASP Mobile Top 10NowSecure
 
iOS and Android security: Differences you need to know
iOS and Android security: Differences you need to knowiOS and Android security: Differences you need to know
iOS and Android security: Differences you need to knowNowSecure
 
OWASP Mobile Security: Top 10 Risks for 2017
OWASP Mobile Security: Top 10 Risks for 2017OWASP Mobile Security: Top 10 Risks for 2017
OWASP Mobile Security: Top 10 Risks for 2017TecsyntSolutions
 

La actualidad más candente (20)

Mobile App Security Predictions 2019
Mobile App Security Predictions 2019Mobile App Security Predictions 2019
Mobile App Security Predictions 2019
 
From Tangled Mess to Organized Flow: A Mobile DevSecOps Reference Architecture
From Tangled Mess to Organized Flow: A Mobile DevSecOps Reference ArchitectureFrom Tangled Mess to Organized Flow: A Mobile DevSecOps Reference Architecture
From Tangled Mess to Organized Flow: A Mobile DevSecOps Reference Architecture
 
5 Tips for Agile Mobile App Security Testing
5 Tips for Agile Mobile App Security Testing5 Tips for Agile Mobile App Security Testing
5 Tips for Agile Mobile App Security Testing
 
85% of App Store Apps Fail OWASP Mobile Top 10: Are you exposed?
85% of App Store Apps Fail OWASP Mobile Top 10: Are you exposed?85% of App Store Apps Fail OWASP Mobile Top 10: Are you exposed?
85% of App Store Apps Fail OWASP Mobile Top 10: Are you exposed?
 
Mobile Penetration Testing: Episode III - Attack of the Code
Mobile Penetration Testing: Episode III - Attack of the CodeMobile Penetration Testing: Episode III - Attack of the Code
Mobile Penetration Testing: Episode III - Attack of the Code
 
How Android and iOS Security Enhancements Complicate Threat Detection
How Android and iOS Security Enhancements Complicate Threat DetectionHow Android and iOS Security Enhancements Complicate Threat Detection
How Android and iOS Security Enhancements Complicate Threat Detection
 
Mobile Penetration Testing: Episode 1 - The Forensic Menace
Mobile Penetration Testing: Episode 1 - The Forensic MenaceMobile Penetration Testing: Episode 1 - The Forensic Menace
Mobile Penetration Testing: Episode 1 - The Forensic Menace
 
5 Mobile App Security MUST-DOs in 2018
5 Mobile App Security MUST-DOs in 20185 Mobile App Security MUST-DOs in 2018
5 Mobile App Security MUST-DOs in 2018
 
Backstage Tour of Identity - London Identity Summit
Backstage Tour of Identity - London Identity SummitBackstage Tour of Identity - London Identity Summit
Backstage Tour of Identity - London Identity Summit
 
The fundamentals of Android and iOS app security
The fundamentals of Android and iOS app securityThe fundamentals of Android and iOS app security
The fundamentals of Android and iOS app security
 
I mas appsecusa-nov13-v2
I mas appsecusa-nov13-v2I mas appsecusa-nov13-v2
I mas appsecusa-nov13-v2
 
Mobile Defense-in-Dev (Depth)
Mobile Defense-in-Dev (Depth)Mobile Defense-in-Dev (Depth)
Mobile Defense-in-Dev (Depth)
 
Identity Relationship Management - The Right Approach for a Complex Digital W...
Identity Relationship Management - The Right Approach for a Complex Digital W...Identity Relationship Management - The Right Approach for a Complex Digital W...
Identity Relationship Management - The Right Approach for a Complex Digital W...
 
Cyber Kill Chain: Web Application Exploitation
Cyber Kill Chain: Web Application ExploitationCyber Kill Chain: Web Application Exploitation
Cyber Kill Chain: Web Application Exploitation
 
OWASP Mobile Top 10
OWASP Mobile Top 10OWASP Mobile Top 10
OWASP Mobile Top 10
 
iOS and Android security: Differences you need to know
iOS and Android security: Differences you need to knowiOS and Android security: Differences you need to know
iOS and Android security: Differences you need to know
 
OWASP Mobile Security: Top 10 Risks for 2017
OWASP Mobile Security: Top 10 Risks for 2017OWASP Mobile Security: Top 10 Risks for 2017
OWASP Mobile Security: Top 10 Risks for 2017
 
OWASP Mobile Top 10 Deep-Dive
OWASP Mobile Top 10 Deep-DiveOWASP Mobile Top 10 Deep-Dive
OWASP Mobile Top 10 Deep-Dive
 
Mobile App Hacking In A Nutshell
Mobile App Hacking In A NutshellMobile App Hacking In A Nutshell
Mobile App Hacking In A Nutshell
 
Mobile Hacking
Mobile HackingMobile Hacking
Mobile Hacking
 

Similar a Merging Static and Dynamic Analysis with R2Frida Plugins

Lightning Talk: From Sinatra to Grape.pdf
Lightning Talk: From Sinatra to Grape.pdfLightning Talk: From Sinatra to Grape.pdf
Lightning Talk: From Sinatra to Grape.pdfRenato675806
 
Pentesting Android Applications
Pentesting Android ApplicationsPentesting Android Applications
Pentesting Android ApplicationsCláudio André
 
MOBILE PENTESTING Frida.pdf
MOBILE PENTESTING Frida.pdfMOBILE PENTESTING Frida.pdf
MOBILE PENTESTING Frida.pdfAdityamd4
 
Serverless survival kit
Serverless survival kitServerless survival kit
Serverless survival kitSteve Houël
 
Building a Stock Prediction system with Machine Learning using Geode, SpringX...
Building a Stock Prediction system with Machine Learning using Geode, SpringX...Building a Stock Prediction system with Machine Learning using Geode, SpringX...
Building a Stock Prediction system with Machine Learning using Geode, SpringX...William Markito Oliveira
 
Oracle Modern AppDev Approach to Cloud & Container Native App
Oracle Modern AppDev Approach to Cloud & Container Native AppOracle Modern AppDev Approach to Cloud & Container Native App
Oracle Modern AppDev Approach to Cloud & Container Native AppPaulo Alberto Simoes ∴
 
Agoda open stack in a large scale deployment
Agoda open stack in a large scale deploymentAgoda open stack in a large scale deployment
Agoda open stack in a large scale deploymentSharkrit JOBBO
 
Functions and DevOps
Functions and DevOpsFunctions and DevOps
Functions and DevOpsShaun Smith
 
MongoDB @ Fiverr: The Road to Atlas
MongoDB @ Fiverr: The Road to AtlasMongoDB @ Fiverr: The Road to Atlas
MongoDB @ Fiverr: The Road to AtlasMongoDB
 
Sydney Identity Summit: Addressing the New Threat Landscape with Continuous S...
Sydney Identity Summit: Addressing the New Threat Landscape with Continuous S...Sydney Identity Summit: Addressing the New Threat Landscape with Continuous S...
Sydney Identity Summit: Addressing the New Threat Landscape with Continuous S...ForgeRock
 
Experiences with serverless for high throughput low usage applications | ryan...
Experiences with serverless for high throughput low usage applications | ryan...Experiences with serverless for high throughput low usage applications | ryan...
Experiences with serverless for high throughput low usage applications | ryan...AWSCOMSUM
 
Meetups - The Oracle Ace Way
Meetups - The Oracle Ace WayMeetups - The Oracle Ace Way
Meetups - The Oracle Ace WayPhil Wilkins
 
Splunk bangalore user group 2020-06-01
Splunk bangalore user group   2020-06-01Splunk bangalore user group   2020-06-01
Splunk bangalore user group 2020-06-01NiketNilay
 
Hybrid mobile development with Oracle JET
Hybrid mobile development with Oracle JETHybrid mobile development with Oracle JET
Hybrid mobile development with Oracle JETRohit Dhamija
 
API Description Languages: Which is the Right One for Me?
API Description Languages: Which is the Right One for Me?API Description Languages: Which is the Right One for Me?
API Description Languages: Which is the Right One for Me?Akana
 
API Description Languages: Which is the Right One for Me?
API Description Languages: Which is the Right One for Me?API Description Languages: Which is the Right One for Me?
API Description Languages: Which is the Right One for Me?Akana
 
Delivering Mobile Apps to the Field with Oracle JET
Delivering Mobile Apps to the Field with Oracle JETDelivering Mobile Apps to the Field with Oracle JET
Delivering Mobile Apps to the Field with Oracle JETSimon Haslam
 
Tracking crime as it occurs with apache phoenix, apache hbase and apache nifi
Tracking crime as it occurs with apache phoenix, apache hbase and apache nifiTracking crime as it occurs with apache phoenix, apache hbase and apache nifi
Tracking crime as it occurs with apache phoenix, apache hbase and apache nifiTimothy Spann
 
Secure Application Development InfoShare 2022
Secure Application Development InfoShare 2022Secure Application Development InfoShare 2022
Secure Application Development InfoShare 2022Radu Vunvulea
 
API Description Languages: Which Is The Right One For Me?
 API Description Languages: Which Is The Right One For Me?  API Description Languages: Which Is The Right One For Me?
API Description Languages: Which Is The Right One For Me? ProgrammableWeb
 

Similar a Merging Static and Dynamic Analysis with R2Frida Plugins (20)

Lightning Talk: From Sinatra to Grape.pdf
Lightning Talk: From Sinatra to Grape.pdfLightning Talk: From Sinatra to Grape.pdf
Lightning Talk: From Sinatra to Grape.pdf
 
Pentesting Android Applications
Pentesting Android ApplicationsPentesting Android Applications
Pentesting Android Applications
 
MOBILE PENTESTING Frida.pdf
MOBILE PENTESTING Frida.pdfMOBILE PENTESTING Frida.pdf
MOBILE PENTESTING Frida.pdf
 
Serverless survival kit
Serverless survival kitServerless survival kit
Serverless survival kit
 
Building a Stock Prediction system with Machine Learning using Geode, SpringX...
Building a Stock Prediction system with Machine Learning using Geode, SpringX...Building a Stock Prediction system with Machine Learning using Geode, SpringX...
Building a Stock Prediction system with Machine Learning using Geode, SpringX...
 
Oracle Modern AppDev Approach to Cloud & Container Native App
Oracle Modern AppDev Approach to Cloud & Container Native AppOracle Modern AppDev Approach to Cloud & Container Native App
Oracle Modern AppDev Approach to Cloud & Container Native App
 
Agoda open stack in a large scale deployment
Agoda open stack in a large scale deploymentAgoda open stack in a large scale deployment
Agoda open stack in a large scale deployment
 
Functions and DevOps
Functions and DevOpsFunctions and DevOps
Functions and DevOps
 
MongoDB @ Fiverr: The Road to Atlas
MongoDB @ Fiverr: The Road to AtlasMongoDB @ Fiverr: The Road to Atlas
MongoDB @ Fiverr: The Road to Atlas
 
Sydney Identity Summit: Addressing the New Threat Landscape with Continuous S...
Sydney Identity Summit: Addressing the New Threat Landscape with Continuous S...Sydney Identity Summit: Addressing the New Threat Landscape with Continuous S...
Sydney Identity Summit: Addressing the New Threat Landscape with Continuous S...
 
Experiences with serverless for high throughput low usage applications | ryan...
Experiences with serverless for high throughput low usage applications | ryan...Experiences with serverless for high throughput low usage applications | ryan...
Experiences with serverless for high throughput low usage applications | ryan...
 
Meetups - The Oracle Ace Way
Meetups - The Oracle Ace WayMeetups - The Oracle Ace Way
Meetups - The Oracle Ace Way
 
Splunk bangalore user group 2020-06-01
Splunk bangalore user group   2020-06-01Splunk bangalore user group   2020-06-01
Splunk bangalore user group 2020-06-01
 
Hybrid mobile development with Oracle JET
Hybrid mobile development with Oracle JETHybrid mobile development with Oracle JET
Hybrid mobile development with Oracle JET
 
API Description Languages: Which is the Right One for Me?
API Description Languages: Which is the Right One for Me?API Description Languages: Which is the Right One for Me?
API Description Languages: Which is the Right One for Me?
 
API Description Languages: Which is the Right One for Me?
API Description Languages: Which is the Right One for Me?API Description Languages: Which is the Right One for Me?
API Description Languages: Which is the Right One for Me?
 
Delivering Mobile Apps to the Field with Oracle JET
Delivering Mobile Apps to the Field with Oracle JETDelivering Mobile Apps to the Field with Oracle JET
Delivering Mobile Apps to the Field with Oracle JET
 
Tracking crime as it occurs with apache phoenix, apache hbase and apache nifi
Tracking crime as it occurs with apache phoenix, apache hbase and apache nifiTracking crime as it occurs with apache phoenix, apache hbase and apache nifi
Tracking crime as it occurs with apache phoenix, apache hbase and apache nifi
 
Secure Application Development InfoShare 2022
Secure Application Development InfoShare 2022Secure Application Development InfoShare 2022
Secure Application Development InfoShare 2022
 
API Description Languages: Which Is The Right One For Me?
 API Description Languages: Which Is The Right One For Me?  API Description Languages: Which Is The Right One For Me?
API Description Languages: Which Is The Right One For Me?
 

Más de NowSecure

Jeff's Journey: Best Practices for Securing Mobile App DevOps
Jeff's Journey: Best Practices for Securing Mobile App DevOpsJeff's Journey: Best Practices for Securing Mobile App DevOps
Jeff's Journey: Best Practices for Securing Mobile App DevOpsNowSecure
 
iOS 12 Preview - What You Need To Know
iOS 12 Preview - What You Need To KnowiOS 12 Preview - What You Need To Know
iOS 12 Preview - What You Need To KnowNowSecure
 
Mobile Apps & Connected Healthcare: Managing 3rd-Party Mobile App Risk
Mobile Apps & Connected Healthcare: Managing 3rd-Party Mobile App RiskMobile Apps & Connected Healthcare: Managing 3rd-Party Mobile App Risk
Mobile Apps & Connected Healthcare: Managing 3rd-Party Mobile App RiskNowSecure
 
What attackers know about your mobile apps that you don’t: Banking & FinTech
What attackers know about your mobile apps that you don’t: Banking & FinTechWhat attackers know about your mobile apps that you don’t: Banking & FinTech
What attackers know about your mobile apps that you don’t: Banking & FinTechNowSecure
 
Solving for Compliance: Mobile app security for banking and financial services
Solving for Compliance: Mobile app security for banking and financial servicesSolving for Compliance: Mobile app security for banking and financial services
Solving for Compliance: Mobile app security for banking and financial servicesNowSecure
 
Leaky Mobile Apps: What You Need to Know
Leaky Mobile Apps: What You Need to KnowLeaky Mobile Apps: What You Need to Know
Leaky Mobile Apps: What You Need to KnowNowSecure
 
Vetting Mobile Apps for Corporate Use: Security Essentials
Vetting Mobile Apps for Corporate Use: Security EssentialsVetting Mobile Apps for Corporate Use: Security Essentials
Vetting Mobile Apps for Corporate Use: Security EssentialsNowSecure
 
Cutting out the middleman: Man-in-the-middle attacks and prevention for mobil...
Cutting out the middleman: Man-in-the-middle attacks and prevention for mobil...Cutting out the middleman: Man-in-the-middle attacks and prevention for mobil...
Cutting out the middleman: Man-in-the-middle attacks and prevention for mobil...NowSecure
 
Delivering secure mobile financial services (MFS) - "Frictionless" vs diligence
Delivering secure mobile financial services (MFS) - "Frictionless" vs diligenceDelivering secure mobile financial services (MFS) - "Frictionless" vs diligence
Delivering secure mobile financial services (MFS) - "Frictionless" vs diligenceNowSecure
 
Next-level mobile app security: A programmatic approach
Next-level mobile app security: A programmatic approachNext-level mobile app security: A programmatic approach
Next-level mobile app security: A programmatic approachNowSecure
 
Mobile App Crashworthiness - Securing Vehicle-to-Device (V2D) Interfaces and ...
Mobile App Crashworthiness - Securing Vehicle-to-Device (V2D) Interfaces and ...Mobile App Crashworthiness - Securing Vehicle-to-Device (V2D) Interfaces and ...
Mobile App Crashworthiness - Securing Vehicle-to-Device (V2D) Interfaces and ...NowSecure
 
Cybersecurity Fundamentals for Bar Associations
Cybersecurity Fundamentals for Bar AssociationsCybersecurity Fundamentals for Bar Associations
Cybersecurity Fundamentals for Bar AssociationsNowSecure
 
Mobile Penetration Testing: Episode II - Attack of the Code
Mobile Penetration Testing: Episode II - Attack of the CodeMobile Penetration Testing: Episode II - Attack of the Code
Mobile Penetration Testing: Episode II - Attack of the CodeNowSecure
 

Más de NowSecure (13)

Jeff's Journey: Best Practices for Securing Mobile App DevOps
Jeff's Journey: Best Practices for Securing Mobile App DevOpsJeff's Journey: Best Practices for Securing Mobile App DevOps
Jeff's Journey: Best Practices for Securing Mobile App DevOps
 
iOS 12 Preview - What You Need To Know
iOS 12 Preview - What You Need To KnowiOS 12 Preview - What You Need To Know
iOS 12 Preview - What You Need To Know
 
Mobile Apps & Connected Healthcare: Managing 3rd-Party Mobile App Risk
Mobile Apps & Connected Healthcare: Managing 3rd-Party Mobile App RiskMobile Apps & Connected Healthcare: Managing 3rd-Party Mobile App Risk
Mobile Apps & Connected Healthcare: Managing 3rd-Party Mobile App Risk
 
What attackers know about your mobile apps that you don’t: Banking & FinTech
What attackers know about your mobile apps that you don’t: Banking & FinTechWhat attackers know about your mobile apps that you don’t: Banking & FinTech
What attackers know about your mobile apps that you don’t: Banking & FinTech
 
Solving for Compliance: Mobile app security for banking and financial services
Solving for Compliance: Mobile app security for banking and financial servicesSolving for Compliance: Mobile app security for banking and financial services
Solving for Compliance: Mobile app security for banking and financial services
 
Leaky Mobile Apps: What You Need to Know
Leaky Mobile Apps: What You Need to KnowLeaky Mobile Apps: What You Need to Know
Leaky Mobile Apps: What You Need to Know
 
Vetting Mobile Apps for Corporate Use: Security Essentials
Vetting Mobile Apps for Corporate Use: Security EssentialsVetting Mobile Apps for Corporate Use: Security Essentials
Vetting Mobile Apps for Corporate Use: Security Essentials
 
Cutting out the middleman: Man-in-the-middle attacks and prevention for mobil...
Cutting out the middleman: Man-in-the-middle attacks and prevention for mobil...Cutting out the middleman: Man-in-the-middle attacks and prevention for mobil...
Cutting out the middleman: Man-in-the-middle attacks and prevention for mobil...
 
Delivering secure mobile financial services (MFS) - "Frictionless" vs diligence
Delivering secure mobile financial services (MFS) - "Frictionless" vs diligenceDelivering secure mobile financial services (MFS) - "Frictionless" vs diligence
Delivering secure mobile financial services (MFS) - "Frictionless" vs diligence
 
Next-level mobile app security: A programmatic approach
Next-level mobile app security: A programmatic approachNext-level mobile app security: A programmatic approach
Next-level mobile app security: A programmatic approach
 
Mobile App Crashworthiness - Securing Vehicle-to-Device (V2D) Interfaces and ...
Mobile App Crashworthiness - Securing Vehicle-to-Device (V2D) Interfaces and ...Mobile App Crashworthiness - Securing Vehicle-to-Device (V2D) Interfaces and ...
Mobile App Crashworthiness - Securing Vehicle-to-Device (V2D) Interfaces and ...
 
Cybersecurity Fundamentals for Bar Associations
Cybersecurity Fundamentals for Bar AssociationsCybersecurity Fundamentals for Bar Associations
Cybersecurity Fundamentals for Bar Associations
 
Mobile Penetration Testing: Episode II - Attack of the Code
Mobile Penetration Testing: Episode II - Attack of the CodeMobile Penetration Testing: Episode II - Attack of the Code
Mobile Penetration Testing: Episode II - Attack of the Code
 

Último

CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceanilsa9823
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Pooja Nehwal
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7Pooja Nehwal
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceanilsa9823
 
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPsychicRuben LoveSpells
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRnishacall1
 

Último (7)

CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
 
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
 

Merging Static and Dynamic Analysis with R2Frida Plugins

  • 1. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.© Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. OSS TOOLS: CREATING A REVERSE ENGINEERING PLUGIN FOR R2FRIDA Merging the power of static & dynamic analysis
  • 2. © Copyright 2018 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. ALL THINGS MOBILE DEVSECOPS Subscribe Here https://www.nowsecure.com/go/subscribe/ Semi-monthly Newsletter Delivered 1st & 3rd Wednesdays of the month Resources for the Mobile DevSecOps journey
  • 3. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. ASK A QUESTION ANY TIME Use the “Ask a Question” tab below the slides
  • 4. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. NOWSECURE COMPANY INNOVATION TIMELINE NowSecure Sponsorship of OSS FRIDA & RADARE (2015) Launch NowSecure INTEL for Production AppStore Monitoring (2018) Launch NowSecure Workstation Complete Analyst Mobile AppSec Testing Kit (2015) ViaForensics Founded (2009) Launch Mobile Forensic Analysis Services (2010) Launch Mobile App Pen Testing Services (2012) NowSecure Series A & Company Rename (2014) Launch NowSecure AUTO for Shift Left CI/CD-integrated Mobile AppSec Testing (2017) Publish Books “Android Forensics” & “iOS Forensics” (2011) NOWSECURE MISSION: Saving the World from Unsafe Mobile Apps
  • 5. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. On a scale of 1 to 5, rate your level of knowledge of mobile app security. 1. beginner 2. novice 3. intermediate 4. advanced 5. expert POLL #1
  • 6. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. AGENDA INTRODUCTION WHAT IS R2 & FRIDA? WHAT’S NEW IN R2 & FRIDA? WHAT IS R2FRIDA? EXTENDING R2FRIDA WITH PLUGINS Q&A MODERATOR BRIAN REED CMO, NOWSECURE SERGI ALVAREZ I CAPILLA AUTHOR OF RADARE2 SPEAKER
  • 7. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. WHO AM I? ▪ My name is Sergi Àlvarez i Capilla ▪ But most people know me as pancake ▪ Author of radare2, r2frida, applesign, fsmon, valabind, acr, 0xFFFF, and many, many other open source tools out there. ▪ Senior Mobile Security Research Engineer ▪ Working at NowSecure ▪ Spend my time building new tools and find new ways to improve our products that make safer Mobile apps.
  • 8. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. On a scale of 1 to 5, rate your level of experience with r2. 1. beginner 2. novice 3. intermediate 4. advanced 5. expert POLL #2
  • 9. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. WHAT’S R2? ▪ 13yo OpenSource RE framework (tools + apis) ▪ It started as a simple hexadecimal editor for forensics. ▪ Quickly evolved, adding support for analysis, disassembling, debugging, emulation, ... ▪ Cover many topics related to computer security: ▪ Exploiting, fuzzing, cracking, SRE, forensics.. ▪ It’s written in C: small, fast and portable ▪ Easy to script with an expressive commandline shell ▪ Can be extended with plugins written in native or dynamic languages
  • 10. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. On a scale of 1 to 5, rate your level of experience with Frida. 1. beginner 2. novice 3. intermediate 4. advanced 5. expert POLL #3
  • 11. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. WHAT’S FRIDA? Dynamic instrumentation toolkit written by my colleague Ole André ▪ Written in C with bindings for JavaScript and Python ▪ It’s the best introspection tooling for iOS and Android ▪ Injects an egg with a JS interpreter into the target process. ▪ At this point you can instrument the entire process with js ▪ Provides APIs to read/write memory, list symbols, add traces, .. ▪ Modify the behaviour or trace protocols, APIs, behaviours, ..
  • 12. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. WHAT’S NEW IN R2 AND FRIDA? There are ~500 commits/month in r2, ▪ So it’s hard to describe all the improvements and new features in a single slide. Both projects have a solid userbase and the main development focus is on improving the core, cleanup/ refactor, and improve usability. ▪ Frida ▪ Crashlog retrieval for iOS/Android ▪ Shorter APIs and more OO ▪ New Kernel APIs for tfp0 ▪ ChromeDev tools ▪ Radare2 ▪ Better graphs + navigation ▪ Improved Code and type analysis ▪ Performance improvements
  • 13. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. WHAT’S R2FRIDA? IO plugin for radare2 that uses Frida as backend. Extends the scripting and static analysis capabilities of r2 with all the dynamic analysis, code injection and tracing facilities of Frida. ▪ Works seamlessly on iOS, Android, macOS, Linux and Windows. ▪ Read/Write remote process memory from r2 ▪ Type short commands instead of writing code ▪ Also can access remote filesystems
  • 14. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. R2FRIDA OVERVIEW ▪ Radare2 runs in host ▪ r2frida is an r2 plugin that links against the Frida SDK ▪ Spawn/attach local/remote processes. ▪ Extend agent commands with plugins ▪ Frida-Server runs in the device ▪ Provides Interface to talk to inspect processes and attach from host. ▪ End to end r2pipe ▪ r2frida commands mimic r2 ones ▪ Handle sync and async
  • 15. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. WHAT’S NEW IN R2FRIDA v3.4 ▪ New URI handler schema ▪ frida://usb/deviceid/spawn/appname ▪ Improved trace-logs support ▪ Trace logs are now cached and accessible via dtl ▪ All traces generate a JSON message sent to host for later postprocessing ▪ Trace-logs have counters, timestamp, module name, symbol name, address, ... ▪ Binary information listed depends on the current seek ▪ Added command to get the entrypoint of the program ▪ Fuzzy resolution of objc methods by using the objc: prefix ▪ Support remote FileSystems on all unix targets ▪ Retrieve crashlog message from device (ios + android only) ▪ Improved support for Android tracing and return injection ▪ Faster addr2name and name2addr resolutions ▪ Safer pointer/data auto-identification with isObjC and such ▪ Resolve thread and file descriptor names
  • 16. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. SIMPLE R2FRIDA EXAMPLE DEMO Attach to a running while hello world program and change the program behaviour at runtime
  • 17. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. EXTENDING R2FRIDA WITH PLUGINS R2 can interpret scripts in several languages, interact with r2 via r2pipe. ▪ Use r2pipe to script anything in r2frida from Rust, Python, Ruby, NodeJS, Java, ... Run Frida oneliners (or run a js file in the agent) from the r2 shell ▪ Useful for small stuff, but kind of annoying for large code snippets The R2Frida plugin API can extend the r2frida commands ▪ Load/Unload and List those plugins ▪ Loaded in the agent side and fully compatible with Frida scripts ▪ Allows to run r2 commands from the agent side ▪ r2frida global object to access trace logs or register new commands
  • 18. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. HELLO WORLD PLUGIN EXAMPLE Basic plugin example looks like this:
  • 19. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. What else can be interesting for the analyst to have in r2frida? ▪ UI interaction commands ▪ Cookie tracing and curlification of http traffic ▪ Use your own custom trace hooks ▪ Integration with Frida CodeShare ▪ Web interface on top of the internal r2’s http webserver ▪ Expose a fake filesystem to the process ▪ Bypass anti-debugging or authentication protections ▪ OS-specific features BEYOND THE HELLO WORLD
  • 20. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. CREATING THE PLUGIN Open your favourite editor and create this hookurl.js
  • 21. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. RUNNING THE PLUGIN The ‘urls’ command will show all the URLs captured from the NSURL traces
  • 22. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. EXTRACTING URLS FROM LOGS
  • 23. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. By typing: ▪ dtf objc:NSURL.^URLWithString:$ ooo We get noisy messages with the trace information ▪ e hook.verbose=false We can list the trace ▪ dtlj~{} And finally get the QR codes with the plugin: ▪ .hookurl qrs TRACING NSURL INTO QR CODES
  • 24. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. BACKTRACE GRAPHS hookurls btgraph
  • 25. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. REMOTE FILESYSTEM ACCESS DEMO ▪ IO plugins can expose commands to support mounting remote filesystems and accessible via the ‘m’ command ▪ ‘mo’ command will open a remote file in memory for local analysis
  • 26. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. WEBUI AND R2PIPE With r2frida, it is also possible to use any r2pipe script or the Web browser with your custom interface to automate Frida and r2 at the same time.
  • 27. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. FINAL WORDS ▪ Radare2 and Frida are powerful open source tools ▪ They provide many ways to extend them and integrate with other tools ▪ R2frida is also open-source and combines the power of both ▪ Bring the state of the art in Reverse Engineering Mobile to the analyst ▪ https://rada.re ▪ https://github.com/nowsecure/r2frida
  • 28. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. bit.ly/Connect-2019
  • 29. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. MONDAY - DAY 1 Mobile Security Analysts Toolbox In depth OSS Training Sessions ▪ Frida ▪ Radare ▪ r2Frida ▪ Capstone ▪ Ret2dec ▪ ZigBee ▪ And more… Monday Night Party NOWSECURE CONNECT19 OSS TRACK TUESDAY - DAY 2 Mobile OSS tools hackathon ▪ Multiple tools and tracks New OSS Tool Launch Sessions ▪ Multiple new OSS tools Tool Creator’s Panel Contest Awards bit.ly/Connect-2019
  • 30. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. NOWSECURE COMING ATTRACTIONS NowSecure Connect 2019 Jun 3-4, 2019 | Washington D.C. Black Hat USA (Training + Conference) Aug 3-8, 2019 | Las Vegas, NV r2con Sep 4-7, 2019 | Barcelona, Spain Webinar: Integrating Security into the Mobile App DevOps Ecosystem May 22, 2019
  • 31. © Copyright 2019 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. OPEN Q&A Use the “Ask a Question” tab below the slides BRIAN REED CMO PANCAKE Radare2 Author