Mobile applications are one of the most widespread classes of software currently in use, and their development is one of the main focuses of the software development industry. Due to this importance, the analysis of mobile applications to assess their security - including reverse engineering and static analysis - is a key activity in the computer security field, with many techniques, tools and services being developed for this purpose. Such tools often fall short in analyzing applications written using modern frameworks. A framework that poses specific challenges to analysis tools is React Native, a popular cross-platform application development framework based on JavaScript. Indeed, the default engine for React Native, Hermes, uses a custom bytecode that must be properly understood and processed by analysis tools. The few currently available tools to analyze Hermes bytecode are lacking, as they mainly perform disassembly of the bytecode without reconstructing the high-level semantics of the code. In this thesis, we design and develop a solution to analyze Hermes bytecode of React Native applications. Our solution is built as a plugin for a popular reverse engineering platform, Binary Ninja, leveraging the provided API to represent the Hermes bytecode and architecture and ultimately allowing to transform the bytecode into a human-understandable format to aid analysis. We validate the capability of our solution on a set of representative React Native applications showing that it is able to analyze them and reconstruct the code semantics.

Le applicazioni mobile sono una delle forme di software più comuni a livello mondiale, ed Il loro sviluppo è una delle attività principali dell'industria di sviluppo software. A causa della loro importanza, l'analisi di applicazioni mobile al fine di valutare la loro sicurezza - che include le tecniche di reverse engineering e analisi statica - è un'attività chiave nel settore della sicurezza informatica, con una varietà di tecniche, strumenti e servizi che sono sviluppati a questo fine. Tali strumenti spesso si rivelano insufficienti nell'analizzare applicazioni sviluppate con framework moderni. Un framework che rappresenta una sfida per gli attuali strumenti di analisi è React Native, un diffuso framework per lo sviluppo di applicazioni multipiattaforma basato su JavaScript. In particolare, l'interprete di default per React Native, Hermes, usa un bytecode specifico che deve essere compreso e processato dagli strumenti di analisi. I pochi strumenti attualmente disponibili sono insufficienti allo scopo, in quanto effettuano quasi esclusivamente disassembly del bytecode senza ricostruire i costrutti semantici di più alto livello del codice sorgente. In questa tesi progettiamo e sviluppiamo una soluzione per analizzare il bytecode Hermes di applicazioni sviluppate in React Native. La nostra soluzione è costituita da un plugin per una popolare piattaforma di reverse engineering, Binary Ninja, utilizzando le API che essa fornisce per rappresentare il bytecode e l'architettura di Hermes, con il risultato ultimo di rappresentare il bytecode in una forma più comprensibile per supportare le attività di analisi. Abbiamo poi valutato le capacità della nostra soluzione con una selezione rappresentativa di applicazioni in React Native, mostrando la capacità di analizzarle e di ricostruirne la semantica a livello di codice.

BN-Hermes : a decompilation and analysis plugin for react native's Hermes bytecode

Falvo, Cristian
2022/2023

Abstract

Mobile applications are one of the most widespread classes of software currently in use, and their development is one of the main focuses of the software development industry. Due to this importance, the analysis of mobile applications to assess their security - including reverse engineering and static analysis - is a key activity in the computer security field, with many techniques, tools and services being developed for this purpose. Such tools often fall short in analyzing applications written using modern frameworks. A framework that poses specific challenges to analysis tools is React Native, a popular cross-platform application development framework based on JavaScript. Indeed, the default engine for React Native, Hermes, uses a custom bytecode that must be properly understood and processed by analysis tools. The few currently available tools to analyze Hermes bytecode are lacking, as they mainly perform disassembly of the bytecode without reconstructing the high-level semantics of the code. In this thesis, we design and develop a solution to analyze Hermes bytecode of React Native applications. Our solution is built as a plugin for a popular reverse engineering platform, Binary Ninja, leveraging the provided API to represent the Hermes bytecode and architecture and ultimately allowing to transform the bytecode into a human-understandable format to aid analysis. We validate the capability of our solution on a set of representative React Native applications showing that it is able to analyze them and reconstruct the code semantics.
ING - Scuola di Ingegneria Industriale e dell'Informazione
4-mag-2023
2022/2023
Le applicazioni mobile sono una delle forme di software più comuni a livello mondiale, ed Il loro sviluppo è una delle attività principali dell'industria di sviluppo software. A causa della loro importanza, l'analisi di applicazioni mobile al fine di valutare la loro sicurezza - che include le tecniche di reverse engineering e analisi statica - è un'attività chiave nel settore della sicurezza informatica, con una varietà di tecniche, strumenti e servizi che sono sviluppati a questo fine. Tali strumenti spesso si rivelano insufficienti nell'analizzare applicazioni sviluppate con framework moderni. Un framework che rappresenta una sfida per gli attuali strumenti di analisi è React Native, un diffuso framework per lo sviluppo di applicazioni multipiattaforma basato su JavaScript. In particolare, l'interprete di default per React Native, Hermes, usa un bytecode specifico che deve essere compreso e processato dagli strumenti di analisi. I pochi strumenti attualmente disponibili sono insufficienti allo scopo, in quanto effettuano quasi esclusivamente disassembly del bytecode senza ricostruire i costrutti semantici di più alto livello del codice sorgente. In questa tesi progettiamo e sviluppiamo una soluzione per analizzare il bytecode Hermes di applicazioni sviluppate in React Native. La nostra soluzione è costituita da un plugin per una popolare piattaforma di reverse engineering, Binary Ninja, utilizzando le API che essa fornisce per rappresentare il bytecode e l'architettura di Hermes, con il risultato ultimo di rappresentare il bytecode in una forma più comprensibile per supportare le attività di analisi. Abbiamo poi valutato le capacità della nostra soluzione con una selezione rappresentativa di applicazioni in React Native, mostrando la capacità di analizzarle e di ricostruirne la semantica a livello di codice.
File allegati
File Dimensione Formato  
2023_05_Falvo.pdf

accessibile in internet per tutti

Dimensione 840.28 kB
Formato Adobe PDF
840.28 kB Adobe PDF Visualizza/Apri

I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/10589/206456