-
-
Save maxvonhippel/9df5d30beca2dea0a92ddac30b59e436 to your computer and use it in GitHub Desktop.
# Clone MamaDroid | |
git clone https://bitbucket.org/gianluca_students/mamadroid_code.git mamadroid | |
# Get some malware to look at | |
git clone https://github.com/ashishb/android-malware.git malware | |
# Export variables | |
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/ | |
export JRE_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/jre/bin | |
export PATH=$JAVA_HOME:$JRE_HOME:$PATH | |
# Base dir variable for convenience | |
basedir=$(echo $(pwd)/mamadroid) | |
cd mamadroid | |
mv soot_jars soot | |
cd soot | |
# axml-2.0.jar | |
wget https://github.com/secure-software-engineering/soot-infoflow-android/raw/develop/lib/axml-2.0.jar | |
# slf4j-api-1.7.5.jar | |
wget https://github.com/secure-software-engineering/soot-infoflow-android/raw/b436c512431d875a0bb3c53ea55bbdb137c0aab0/lib/slf4j-api-1.7.5.jar | |
# slf4j-simple-1.7.5.jar | |
wget https://github.com/secure-software-engineering/soot-infoflow-android/raw/b436c512431d875a0bb3c53ea55bbdb137c0aab0/lib/slf4j-simple-1.7.5.jar | |
# soot-infoflow-android.jar should already be in there | |
# soot-infoflow.jar should already be in there | |
# soot-trunk.jar should already be in there | |
# SourcesAndSinks.txt | |
wget https://raw.githubusercontent.com/secure-software-engineering/soot-infoflow-android/develop/SourcesAndSinks.txt | |
# AndroidCallbacks.txt | |
wget https://raw.githubusercontent.com/0-14N/soot-infoflow-android/master/AndroidCallbacks.txt | |
# EasyTaintWrapperSource.txt | |
wget https://raw.githubusercontent.com/secure-software-engineering/soot-infoflow/develop/EasyTaintWrapperSource.txt | |
# Export classpath for java | |
export CLASSPATH="$basedir/.:$basedir/soot/soot-trunk.jar:$basedir/soot/soot-infoflow.jar:$basedir/soot/soot-infoflow-android.jar:$basedir/soot/slf4j-simple-1.7.5.jar:$basedir/soot/slf4j-api-1.7.5.jar:$basedir/soot/axml-2.0.jar:$basedir/soot/sootclasses-trunk-jar-with-dependencies.jar" | |
cd .. | |
# Compile Appgraph | |
javac -cp $CLASSPATH Appgraph.java | |
export ANDORID_JARS=$HOME/Library/Android/sdk/platforms | |
# Get DroidBench | |
cd .. | |
git clone https://github.com/secure-software-engineering/DroidBench.git | |
cd mamadroid | |
# Add DroidBench path | |
export DROIDBENCH=$HOME/DroidBench | |
# Now we try it on an app | |
badapp=../android-malware/Android.Malware.at_plapk.a/com.fdhgkjhrtjkjbx.model.apk | |
python2 mamadroid.py -f $badapp -d $ANDORID_JARS | |
# A ton of stuff gets output | |
less com.fdhgkjhrtjkjbx.model.txt | |
# ^^ Presumably this file is what I will be able to do something interesting with using MaMaDroid once I learn how it works |
Sure! Hope it helps!
I made another gist for making a figure from MAMADROID's output, you can check it out here
Hi, do you have any idea on optimizing the MaMaDroid?
Hi maxvonhippel,
Thanks for your time and attention. I am setting up MaMadroid project. The formal steps are all executable. When I run the 'line 43' command, there appears an error as:
Exception in thread "main" java.lang.RuntimeException: file '/home/nsclab/Library/Android/sdk/platforms' does not exist!
at soot.Scene.getAndroidAPIVersion(Scene.java:338)
at soot.Scene.getAndroidJarPath(Scene.java:320)
at soot.jimple.infoflow.android.SetupApplication.getClasspath(SetupApplication.java:644)
at soot.jimple.infoflow.android.SetupApplication.initializeSoot(SetupApplication.java:660)
at soot.jimple.infoflow.android.SetupApplication.calculateCallbackMethods(SetupApplication.java:470)
at soot.jimple.infoflow.android.SetupApplication.calculateSourcesSinksEntrypoints(SetupApplication.java:401)
at soot.jimple.infoflow.android.SetupApplication.calculateSourcesSinksEntrypoints(SetupApplication.java:359)
at Appgraph.main(Appgraph.java:40)
Can you give me some advice? How can I install the SDK platforms? Look forward to your reply.
Hello Max. Would you mind give me some hints about the database:database:database as the input of MaMaStat.py? I am a little bit confused about the description of the usage.
Hey guys, I haven't tried to run this code in ~ 2 years ... I suggest you contact the project's authors. Sorry!
(I had nothing to do with developing MaMaDroid, I only figured out how to run the code in order to use it for comparison to some code I wrote in a senior thesis as an undergrad ...)
If any of you find the solutions to these problems feel free to share them here.
@PegX I am sure I never used any database in MaMaDroid, I probably only ever ran the code I wrote in this gist, ie., python2 mamadroid.py -f $badapp -d $ANDORID_JARS
... sorry!
@PegX I am sure I never used any database in MaMaDroid, I probably only ever ran the code I wrote in this gist, ie.,
python2 mamadroid.py -f $badapp -d $ANDORID_JARS
... sorry!
Hi Max. No worries. Thanks for your reply. Actually I checked the code and find out some tips. Thanks again.
Sure! Glad this helped!
Thanks for sharing this!!