Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi-r3v0 committed Jul 10, 2018
1 parent c40852b commit 43926d3
Show file tree
Hide file tree
Showing 22 changed files with 53 additions and 48 deletions.
Empty file modified Docs/images/1.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Docs/images/2.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Docs/images/3.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Docs/images/4.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Docs/images/5.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Docs/images/6.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Docs/logo/banner.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Docs/logo/bannerb.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Docs/logo/bannerg.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Docs/logo/logo.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified LICENSE.txt 100644 → 100755
Empty file.
46 changes: 17 additions & 29 deletions README.md 100644 → 100755
@@ -1,11 +1,13 @@
![1024x512](https://user-images.githubusercontent.com/37318022/40054882-d783bc50-5878-11e8-9dbd-493404f5169f.png)
## FROM INDIA, TO THE WORLD :blue_heart:

![Logo](Docs/logo/banner.png)

---

![BUILD STATUS](https://travis-ci.org/abhi-r3v0/Adhrit.svg?branch=master) [![Open Source Love](https://badges.frapsoft.com/os/v2/open-source.svg?v=103)](https://www.github.com/abhi-r3v0/Adhrit) [![GPL Licence](https://badges.frapsoft.com/os/gpl/gpl.png?v=103)](https://www.github.com/abhi-r3v0/Adhrit)


Adhrit is an open source Android APK reversing and analysis tool that can help security researchers and CTF enthusiasts alike. The tool is an effort to cut down on the amount of time spent on reversing and basic reconnaissance of Android applications. The project is still under progress and will continually incorporate features with time. Feel free to report the issues. Feature requests and suggestions are always welcome!
Adhrit is an open source Android APK reversing and analysis tool that can help security researchers and CTF enthusiasts alike. The tool is an effort to cut down on the amount of time spent on reversing and basic reconnaissance of Android applications. The project is still under progress and will continually incorporate features with time. Feel free to report the issues. Feature requests and suggestions are always welcome!

---

Expand All @@ -15,15 +17,15 @@ Adhrit is an open source Android APK reversing and analysis tool that can help s
* Disassembles native libraries
* Extracts jar out of dex.
* Extracts source code in Java.
* Extracts source code in Smali.
* Extracts source code in Smali.
* Recompiles smali into APK
* Signs the APK
* Checks for virtual apps/droppers
* Checks for bytecode injection points and write it to a file.
* Analyzes permissions used by the application.
* Dumps the Manifest.
* Dumps the certificate details.
* Checks for malware footprints in the VirusTotal database.
* Checks for malware footprints in the VirusTotal database.

---

Expand All @@ -34,13 +36,19 @@ Adhrit is an open source Android APK reversing and analysis tool that can help s

---

### USAGE:
### SETUP

1. Dowload the zip or clone the package and extract the tool ( ```git clone https://github.com/abhi-r3v0/Adhrit.git``` ).
2. Place the application in the tool directory.
2. Open ```config``` and input your VirusTotal API key without any quotes. ([Click here to know how to obtain your VT API key](https://community.mcafee.com/t5/Documents/How-to-get-a-VirusTotal-public-API-Key/ta-p/552797))
3. Open a terminal and cd into the directory.
4. Run ```python installer.py``` for installing the necessary tools.
5. Use ```python adhrit.py -h``` for usage help.

---

### USAGE:

1. Place the application (apk file) in the tool directory.
2. Use ```python adhrit.py -h``` for usage help.

Example: ```python adhrit.py -a my_app.apk```

Expand Down Expand Up @@ -70,7 +78,7 @@ Example: ```python adhrit.py -a my_app.apk```

### PRESENTATION:

[Cysinfo](https://cysinfo.com/12th-meetup-analysis-android-apk-using-adhrit/)
[Cysinfo Cyber Security Meetup](https://cysinfo.com/12th-meetup-analysis-android-apk-using-adhrit/)

---

Expand All @@ -80,26 +88,6 @@ Example: ```python adhrit.py -a my_app.apk```

---

## CONTRIBUTING:

* Have any cool idea? Here's how you can implement it:

1. Create a ```module_name.py``` and place it in the ```recons``` directory.
2. Define a class with a relevant name and define a function that takes```apk_name``` as a parameter. [eg: ```my_func(apk_name)```]
3. Open ```adhrit.py``` and import the new class from recons. You can look at the already existing imports as an example.
4. Define a new function inside the class ```Adhrit``` in this format: ```my_new_func(self, apk_name)```. Call the imported function here. [eg: ```my_func(apk_name)```]
5. Create a new argument in the argument parser for the new included ```my_new_func```
6. Call the function with the argument.

Voila! Send us a PR. We'll review it and add it to the project.

#### THINGS TO REMEMBER:

* Follow the pep8 conventions.
* Comment wherever necessary.

---

## THE SQUAD:

#### PROJECT LEAD:
Expand Down Expand Up @@ -165,6 +153,6 @@ For example, if your file name is ```my.app.apk```, rename it to ```myapp.apk```

---

## From India, to the world :blue_heart:



1 change: 0 additions & 1 deletion adhrit.py 100644 → 100755
Expand Up @@ -109,7 +109,6 @@ def main():
adhrit.vappsearch(args.a)
adhrit.smaliextractor(args.a)
adhrit.smali_inj(args.a)
adhrit.nativedebug(args.a)

elif args.r:
adhrit.apkripper(args.r)
Expand Down
5 changes: 5 additions & 0 deletions config
@@ -0,0 +1,5 @@
[config-data]

vt_api_key =
emulator_path =

Empty file modified installer.py 100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions recons/smali_extract.py
Expand Up @@ -10,7 +10,7 @@ def smali_de(apk_name):
print "[+] SOURCE EXTRATION IN SMALI"
print "----------------------------------------------------"
snamesplit = apk_name.split('.')[0]
SmaliCmd = 'java -jar tools/apktool.jar d -f ' + apk_name + ' -o apk/' + snamesplit
SmaliCmd = 'java -jar tools/apktool.jar d -f ' + apk_name
os.system(SmaliCmd)
if os.path.isdir(snamesplit):
print "\n\t[+] Extraction complete."
Expand All @@ -35,7 +35,7 @@ def apk_sign(apk_name):
print "[+] SIGNING APK"
print "------------------------------------------------"
snamesplit = apk_name.split('.')[0]
sdir = 'apk/' + snamesplit + '/' + snamesplit + '/dist/' + snamesplit + '.apk'
sdir = snamesplit + '/dist/' + snamesplit + '.apk'
if os.path.exists(sdir):
signCmd = 'java -jar tools/sign.jar ' + snamesplit + '/dist/' + snamesplit + '.apk'
os.system(signCmd)
Expand All @@ -58,7 +58,7 @@ def inj_check(apk_name):
smali_dir = 'smali'
if os.path.isdir('smali_copy'):
os.system('rm -r smali_copy')
os.system('cp -R ' + 'apk/' + snamesplit + '/' + smali_dir + ' smali_copy')
os.system('cp -R ' + snamesplit + '/' + smali_dir + ' smali_copy')
if os.path.isdir('smali_copy'):
os.chdir('smali_copy')
ignore_dirs = ['android', 'org', 'google', 'localytics']
Expand Down
41 changes: 26 additions & 15 deletions recons/virustotal.py
@@ -1,11 +1,17 @@
# !/usr/bin/env python

import ConfigParser
import requests
import hashlib
from prettytable import PrettyTable


def api_check(apk_name):
config = ConfigParser.ConfigParser()
config.readfp((open(r'config')))

vt_apikey = config.get('config-data', 'vt_api_key')

print "\n"
print "--------------------------------------------------"
print "[+] SCANNING FOR MALWARE TRACE"
Expand All @@ -19,28 +25,33 @@ def api_check(apk_name):
msum.update(chunk)
md5digest = msum.hexdigest()

parameters = {'apikey': '099d11fe87377f9c8cfe0ae00b5c40fd04f7d4c425972cf09e4cd47d82a0c6df', 'resource': md5digest}
parameters = {'apikey': vt_apikey, 'resource': md5digest}
header = {
"Accepted-Encoding": "gzip, deflate",
"User-Agent": "gzip, Test"
}

response = requests.get('https://www.virustotal.com/vtapi/v2/file/report',
try:
response = requests.get('https://www.virustotal.com/vtapi/v2/file/report',
params=parameters, headers=header)
json_response = response.json()
if json_response['response_code'] == 0:
print "\t[!] Error Getting Details. Aborting\n"
return
if json_response['positives'] > 0:
print "\n\t[+] Positives Found: " + str(json_response['positives'])
pos = 1
for engine, det in json_response['scans'].iteritems():
if det["detected"]:
t.add_row([engine, det["result"]])
else:
print "\n[-] No Positives Found"
json_response = response.json()

if json_response['response_code'] == 0:
print "\t[!] Error Getting Details. Aborting\n"
return
if json_response['positives'] > 0:
print "\n\t[+] Positives Found: " + str(json_response['positives'])
pos = 1
for engine, det in json_response['scans'].iteritems():
if det["detected"]:
t.add_row([engine, det["result"]])
else:
print "\n[-] No Positives Found"

except:
print "\n Error connecting to VirusTotal"

if pos == 1:
print t

print "\n"
print "\n"
Empty file modified tools/AXML.jar 100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions tools/JarConverter.sh
Expand Up @@ -45,5 +45,7 @@ else
done
fi

# call d2j_invoke.sh to setup java environment
#"$PRGDIR/d2j_invoke.sh" "com.googlecode.dex2jar.tools.Dex2jarCmd" "$@"

java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.Dex2jarCmd" "$@"
Binary file added tools/Unconfirmed 760119.crdownload
Binary file not shown.
Binary file modified tools/apktool.jar 100644 → 100755
Binary file not shown.
Empty file modified tools/sign.jar 100644 → 100755
Empty file.

0 comments on commit 43926d3

Please sign in to comment.