Giter Club home page Giter Club logo

xtiankisutsa / mara_framework Goto Github PK

View Code? Open in Web Editor NEW
610.0 46.0 186.0 206.37 MB

MARA is a Mobile Application Reverse engineering and Analysis Framework. It is a toolkit that puts together commonly used mobile application reverse engineering and analysis tools to assist in testing mobile applications against the OWASP mobile security threats.

Home Page: http://www.shadowinfosec.io

License: GNU Lesser General Public License v3.0

Shell 0.95% Python 95.35% Makefile 0.02% C++ 0.31% C 0.57% Java 0.33% HTML 0.26% Jasmin 0.06% Objective-J 0.02% CSS 0.19% Batchfile 0.03% Smali 1.73% JavaScript 0.18% Perl 0.02%

mara_framework's Introduction

MARA_Framework

MARA is a Mobile Application Reverse engineering and Analysis Framework. It is a tool that puts together commonly used mobile application reverse engineering and analysis tools, to assist in testing mobile applications against the OWASP mobile security threats. Its objective is to make this task easier and friendlier to mobile application developers and security professionals.

MARA is developed and maintained by @xtian_kisutsa and @iamckn. It is in its very early stages of development and there is a lot more to come, in line with our roadmap. Any contributions and suggestions to the tool will be highly appreciated.

Alt

Features supported

APK Reverse Engineering

  • Disassembling Dalvik bytecode to smali bytecode via baksmali and apktool
  • Disassembling Dalvik bytecode to java bytecode via enjarify
  • Decompiling APK to Java source code via jadx

APK Deobfuscation

APK Analysis

  • Parsing smali files for analysis via smalisca
  • Dump apk assets,libraries and resources
  • Extracting certificate data via openssl
  • Extract strings and app permissions via aapt
  • Identify methods and classes via ClassyShark
  • Scan for apk vulnerabilities via androbugs
  • Analyze apk for potential malicious behaviour via androwarn
  • Identify compilers, packers and obfuscators via APKiD
  • Extract execution paths, IP addresses, URL, URI, emails via regex

APK Manifest Analysis

  • Extract Intents
  • Extract exported activities
  • Extract receivers
  • Extract exported receivers
  • Extract Services
  • Extract exported services
  • Check if apk is debuggable
  • Check if apk allows backups
  • Check if apk allows sending of secret codes
  • Check if apk can receive binary SMS

Domain Analysis

Security Analysis

Additional information about the framework, prerequisites and the installation guide is available on the wiki

mara_framework's People

Contributors

0xmachos avatar aquaritus avatar xtiankisutsa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mara_framework's Issues

Ansi codes

In the terminal, we get some gibrish ansi codes:
\e[1;32m[M]\e[1;33mobile \e[1;32m[A]\e[1;33mpplication \e[1;32m[R]\e[1;33meverse Engineering & \e[1;32m[A]\e[1;33mnalysis Framework

yara-python outdated

There seems to be a problem with yara-python in the current build. I am getting compile errors running setup.sh. Also manually performing the yara-python install from the tools/yara-python directory gave me the following error below at _ERROR_.
I had yara-python installed and attempted it with apt install and pip install of both python2.7 and python3 but still no luck. APKiD would fail with an error telling me that yara-python failed to meet the requirement of yara-python==3.5.0.999.

Eventually I was able to correct the issue by manually cloning APKiD from https://github.com/rednaga/APKiD and quoting out the APKiD section in your setup.sh file. Hope this helps.
:EDIT: System is Kali Linux 2016.2 Rolling Release

_ERROR_
yara-python.c: In function ‘yara_callback’:
yara-python.c:602:18: error: ‘CALLBACK_MSG_MODULE_IMPORTED’ undeclared (first use in this function)
if (message == CALLBACK_MSG_MODULE_IMPORTED && modules_callback == NULL)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
yara-python.c:602:18: note: each undeclared identifier is reported only once for each function it appears in
yara-python.c:727:60: error: ‘YR_MATCH {aka struct _YR_MATCH}’ has no member named ‘data_length’; did you mean ‘chain_length’?
object = PyBytes_FromStringAndSize((char*) m->data, m->data_length);
^~
yara-python.c: In function ‘handle_error’:
yara-python.c:940:10: error: ‘ERROR_INVALID_EXTERNAL_VARIABLE_TYPE’ undeclared (first use in this function)
case ERROR_INVALID_EXTERNAL_VARIABLE_TYPE:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

apkid is not installed with mara

apkid tool is not getting installed with mara framework in my case. I am getting the below error :

Could not find a version that satisfies the requirement apkid (from versions: )
No matching distribution found for apkid

yara-python installation fatal error

Tried to install yara-python through both options, pip install yara-python and build but still getting this error when trying to run the mac setup script.

fatal: destination path 'yara-python' already exists and is not an empty directory.
python: can't open file 'setup.py': [Errno 2] No such file or directory
Collecting apkid
Using cached apkid-1.0.0-py2.py3-none-any.whl
Collecting yara-python==3.5.0.999 (from apkid)
Could not find a version that satisfies the requirement yara-python==3.5.0.999 (from apkid) (from versions: 3.4.0.0, 3.5.0, 3.6.0, 3.6.1, 3.6.2, 3.6.3)
No matching distribution found for yara-python==3.5.0.999 (from aphid)

Any work around for this issue?

Unclear

In the vulnerabilities/crypto_implementation.txt
Does the following mean that no SSL pinning was detected, or something else?

==========================
SSL pinning detection:

Jadx:

Java:

Illegal characters found in URL deobfuscator

Every apk file I run with deobfuscator.sh i get the follow issue using the command:
./deobfuscator.sh --apk test.apk

after uploading it and waiting curl issue:
curl: (3) Illegal characters found in URL
[-] Retrying in 30 seconds

Install on mac

The setup script is not compatible with mac.
apt-get is not available.

Deobfuscation taking too long

I am trying to do an audit for an app the deobfuscation phase is taking too long....More that five minutes. Whats the best way to do a minimalist and quick audit?

Runtime errors on mac

Not sure if this is the expected behavior:

./mara.sh: line 83: [: ==: unary operator expected
./mara.sh: line 83: [: ==: unary operator expected
./mara.sh: line 86: [: ==: unary operator expected
./mara.sh: line 86: [: ==: unary operator expected
./mara.sh: line 90: [: ==: unary operator expected
\e[1;31m[NOTE] \e[0;33mInvalid response!!

./mara.sh: line 231: dpkg: command not found
./mara.sh: line 219: ./aapt: cannot execute binary file
./mara.sh: line 243: ./dexdump: cannot execute binary file

./mara.sh: line 283: [: ==: unary operator expected
./mara.sh: line 283: [: ==: unary operator expected
./mara.sh: line 287: [: ==: unary operator expected
./mara.sh: line 287: [: ==: unary operator expected
./mara.sh: line 291: [: ==: unary operator expected
\e[1;31m[NOTE] Invalid response!!

./owasp_static_android.sh: line 478: [: ==: unary operator expected
./owasp_static_android.sh: line 478: [: ==: unary operator expected
./owasp_static_android.sh: line 481: [: ==: unary operator expected
./owasp_static_android.sh: line 481: [: ==: unary operator expected
./owasp_static_android.sh: line 485: [: ==: unary operator expected
\e[1;31m[NOTE] \e[0;33mInvalid response!!

Bash Script Shebang

It might be worth changing the shebang in the bash scripts from

#!/bin/bash

to

#!/usr/bin/env bash

The later is more portable and will allow us to remove the multiple sed invocations from setup_mac.sh.

Script can't be called from everywhere

In mara.sh an maybe in other scripts, a lot of cd and ../../ are used referring from the root of the project ignoring where the script was called from, despite of being ugly, this force the user to change his current directory to the root directory of mara project. So the script can't be launched from everywhere else.

There is an article The Right Way to Get the Directory of a bash Script which seems to have a better approach for calling resources. It would be great to apply that solution.

one of dependencies can't be installed

hello

when i install MARA

it writes

Using cached https://files.pythonhosted.org/packages/9f/dc/0683a458d21c3d561ab2f71b4fcdd812bf04e55c54e560b0854cea95610e/poster-0.8.1.tar.gz
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-d9yzvzfv/poster/setup.py'"'"'; file='"'"'/tmp/pip-install-d9yzvzfv/poster/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /tmp/pip-install-d9yzvzfv/poster/
Complete output (10 lines):
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-install-d9yzvzfv/poster/setup.py", line 2, in
import poster
File "/tmp/pip-install-d9yzvzfv/poster/poster/init.py", line 29, in
import poster.streaminghttp
File "/tmp/pip-install-d9yzvzfv/poster/poster/streaminghttp.py", line 61
print "send:", repr(value)
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

how can i resolve that issue?

Exception in thread "pool-1-thread-1" java.lang.OutOfMemoryError: Java heap space

When decompile .apk to java source code I have exception like that and more:
Exception in thread "pool-1-thread-1" java.lang.OutOfMemoryError: Java heap space at jadx.core.codegen.CodeWriter.add(CodeWriter.java:109) at jadx.core.codegen.ClassGen.makeClass(ClassGen.java:104) at jadx.core.codegen.CodeGen.visit(CodeGen.java:19) at jadx.core.ProcessClass.process(ProcessClass.java:43) at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:281) at jadx.api.JavaClass.decompile(JavaClass.java:59) at jadx.api.JadxDecompiler$1.run(JadxDecompiler.java:161) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)

./setup_mac.sh Issues

I was assisting a friend install MARA on macOS Mojave and came across some issues with ./setup_mac.sh.

I've fixed several of them in my fork of setup_mac.sh.

I'm happy to open a PR if you're happy with those changes.

However there's still a few issues outstanding that I don't have time to investigate/ fix.

I'm not sure if the following code works as there's a lot of Operation not permitted errors but this could be for source file and directories rather than regular files which need to be made executable.

chmod -R +x tools/

Shellcheck

You might want to run all the shell/bash scripts through shellcheck. It's a shell script static analysis tool.

Running them through shellcheck via CI (I use Travis) is pretty straightforward. I already have a script, test.sh, that will find all shell/ bash files and run shellcheck on them. Paied with my Travis config, .travis.yml which executes test.sh in the CI instance.

shellcheck will help catch a lot of issues. We can use its warnings as a basis for cleaning up some of scripts.

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.