Giter Site home page Giter Site logo

jordansamhi / tsopen Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 20.14 MB

Open implementation of TriggerScope

License: GNU Lesser General Public License v2.1

Java 99.22% Python 0.78%
android-analysis malware-detection trigger-detection logic-bombs

tsopen's Introduction

TSOpen

TSOpen is a flow-, path- and context-sensitive tool to detect logic bombs in Android applicatons. This is an open implementation of TriggerScope made thanks to the details given in the 2016 Security and Privacy paper by Fratantonio & al.

TSOpen has been developped over the Soot framework which is useful in analyzing statically Java programs thanks to its internal simplified representation of Java bytecode (Jimple). Since TSOpen is made to analyze Android APKs and such applications have an atypical form (with communicating components), it is difficult to model correctly the flow of information. Therefore the modelling part rely on Flowdroid which is a tool to detect data leaks in Android APKs but can also bu used as a library.

Getting Started

Downloading the tool

I do not provide any pre-built JAR as a release yet. Therefore one has to do the following to get the tool :

git clone https://github.com/JordanSamhi/TSOpen.git

Installing the tool

To install the tool, one just has to go into cloned repository and run these maven commands :

cd TSOpen
mvn clean install:install-file -Dfile=libs/soot-infoflow-android-classes.jar -DgroupId=de.tud.sse -DartifactId=soot-infoflow-android -Dversion=2.7.1 -Dpackaging=jar
mvn clean install:install-file -Dfile=libs/soot-infoflow-classes.jar -DgroupId=de.tud.sse -DartifactId=soot-infoflow -Dversion=2.7.1 -Dpackaging=jar
mvn clean install:install-file -Dfile=libs/sootclasses-trunk.jar -DgroupId=ca.mcgill.sable -DartifactId=soot -Dversion=3.3.0 -Dpackaging=jar
mvn clean install

The built JAR will be in "target" folder with the following name :

  • TSOpen-X.Y-jar-with-dependencies.jar Where X.Y is the current version of the tool.

Using the tool

To run the tool, simply issue this command :

java -jar TSOpen/target/TSOpen-X.Y-jar-with-dependencies.jar options

Two options are currently required :

java -jar TSOpen/target/TSOpen-X.Y-jar-with-dependencies.jar -f <APK file> -p <path/to/android/platforms>

Indeed, one has to provide a file to analyze and the path to the android platforms folder (in Android SDK folder).

Additional options :

  • -e : Take exceptions into account during full path predicate recovery.
  • -t <timeout> : Set a timeout in minutes for the tool (60 mins by default). Indeed, the tool faces NP-complete problems, therefore for some apps it can run indefinitely, that is why a timeout is useful in some cases.
  • -q : Quiet mode, do not display information messages.
  • -o <file_name> : Set an input file for saving results.
  • -c <call_graph_algorithm> : Set the call-graph construction algorithm used (SPARK, CHA, RTA, VTA)
  • -r : Display raw results in stdout

Results are in this form in the file for an APK :

sha256; pkg_name; count_of_triggers; elapsed_time; has_suspicious_trigger; has_suspicious_trigger_after_control_dependency; has_suspicious_trigger_after_post_filters; dex_size; count_of_classes; count_of_if; if_depth; count_of_objects

Triggers are represented in this form :

%if_stmt, class, methodContainingLogicBomb, sensitiveMethod, componentContainingLogicBomb, sizeOfFullPathPredicate, isMethodContainingLogicBombReachable, guardedBlocksDensity, predicate_0:...:predicate_n

Theses features can be used to compute some data and statistics with a script.

Built With

  • Maven - Dependency Management

Authors

Publication

If one wants to know more about the implementation details please check the related research paper.

License

This project is licensed under the LGPLv2.1 License - see the LICENSE file for details

tsopen's People

Contributors

dependabot[bot] avatar jordansamhi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

tsopen's Issues

mvn install ERROR at first, maybe lack of some dependency?

I cloned this project and installed by the instructions.
However, first I got "Compilation failure: package com.google.common.collect does not exist"
image

After I added the dependency of guava (following the solution in https://stackoverflow.com/questions/38007629/no-class-found-com-google-common-collect-lists)
image

I got anothor ERROR:
image

" Compilation failure
[ERROR] /home/pudding/TSOpen/src/main/java/lu/uni/tsopen/graphTraversal/ICFGForwardTraversal.java:[51,33] cannot access heros.InterproceduralCFG"
I can't find that class in this project

And then after I added the dependency and re-installed.
I got "Compilation failure
[ERROR] /home/pudding/TSOpen/src/main/java/lu/uni/tsopen/Analysis.java:[411,30] cannot access org.xmlpull.v1.XmlPullParserException"

I then added the dependency, and finally installed successfully.

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.