Giter Site home page Giter Site logo

jafarbadour / hybridflow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yuanchun-li/hybridflow

0.0 1.0 0.0 34.6 MB

static taint analysis of hybrid Android Apps (Java + HTML)

License: GNU General Public License v2.0

Java 99.96% HTML 0.04%

hybridflow's Introduction

HybridFlow

Static taint analysis for Android Hybrid Apps (Java + HTML).

About

Increasing numbers of Android apps are ``hybrid'' (aka. hybrid apps), which contains both Java code and HTML code.

Java side and HTML side can interact with each other via WebView. For example, the HTML in WebView can invoke Java interfaces, which are registered via addJavascriptInterface, . For another example, the Java code can execute JS in HTML via loadUrl. The data flow across Java and HTML are which we called hybrid data flow.

Existing Android taint analysis tools (FlowDroid, AmanDroid, DroidSafe, etc) focus on Java side data flow, which are insufficient in handling the hybrid flow. This tool (HybridFlow) aims to fix the gap between existing analysis tools and increasing numbers of hybrid apps.

How does it work

HybridFlow analyze a hybrid app in three steps:

  1. BuildBridge. In this step, it performs a points-to analysis and a string analysis to determine the hybrid bridges between Java and HTML. This step produces a instrumented apk in java directory for Java side taint analysis, and a html directory for HTML side taint analysis.
  2. RunTaintAnalysis. In this step, it runs taint analysis for each side. Currently, we use FlowDroid to run Java side taint analysis and extend WALA to run HTML side taint analysis.
  3. MergeTaintFlow. This step merges the Java source-to-sink paths with the HTML source-to-sink paths generated in step 2, according to the bridge generated in step 1. The merging result is the hybrid source-to-sink flows.

Installation

git clone XXX
mvn install

If everything goes well, this command will generate an executable jar file under the target directory.

Usage

This tool requires a apk file (which you want to analyze) and a sources and sinks definition as inputs.

You may also specify the Android SDK home which contains the proper version of android.jar. For example, if the apk is targeted android 19, the android.jar file should appear in sdk/platforms directory.

Run:

java -jar hybridflow.jar -i webviewdemo.apk -d output -sdk $ANDROID_SDK_HOME$ -source_sink SourcesAndSinks.txt

If everything goes well, a AnalysisResult.md file will be generated under the output directory, which contains the taint analysis result (source to sink paths). You can also run each step separately using -m option.

Example

The example directory contains a running example of HybridFlow. The AnalysisResult.md file is the generated report.

Acknowledgement

hybridflow's People

Contributors

yuanchun-li avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.