|
1 | | -# !/usr/bin/env python |
2 | | - |
3 | 1 | import os |
4 | | -import configparser |
5 | 2 | import subprocess |
6 | | -import threading |
7 | 3 | import colorama |
8 | 4 | from colorama import Fore |
9 | | -from time import sleep |
10 | | -from ppadb.client import Client as AdbClient |
11 | | - |
12 | 5 |
|
13 | | -__author__ = 'themalwarenews ( @themalwarenews) ' |
14 | | -__inspired_by__ = ' DROXES ' |
| 6 | +# Define constants for directories and file paths |
| 7 | +APK_DIR = os.path.join(os.getcwd(), "apk") |
| 8 | +XPOSED_DIR = os.path.join(os.getcwd(), "xposed") |
| 9 | +BIN_DIR = os.path.join(os.getcwd(), "bin") |
| 10 | +SYSTEM_DIR = os.path.join(os.getcwd(), "system") |
15 | 11 |
|
16 | 12 | class Garuda: |
17 | | - |
18 | 13 | def __init__(self): |
19 | 14 | self.apk_list = ['xposed.apk', 'drozer.apk', 'term.apk', 'busybox.apk', 'rootcloak.apk', 'inspeckage.apk', 'SSLunpin.apk'] |
20 | | - self.test_list = ['drozer.apk'] |
21 | | - self.server_list = ['tcpdump', 'frida_server'] |
22 | 15 | self.flashfile = ['xposed_flash.zip'] |
| 16 | + self.server_list = ['tcpdump', 'frida_server'] |
23 | 17 | self.tools_list = ['apktool','python-pip','python3-pip', 'python-dev', 'python-twisted'] |
24 | | - self.py_dependencies = ['frida','frida-tools','objection'] |
| 18 | + self.py_dependencies = ['frida','frida-tools','objection','apkleaks','andriller','quark-engine'] |
25 | 19 | self.sys_tools = ['drozer.deb'] |
| 20 | + self.DAST_tool = ['rms-runtime-mobile-security','dexcalibur'] |
26 | 21 |
|
27 | 22 | def welcome(self): |
28 | | - __banner__='''\t ██████╗ █████╗ ██████╗ ██╗ ██╗██████╗ █████╗ |
29 | | -\t██╔════╝ ██╔══██╗██╔══██╗██║ ██║██╔══██╗██╔══██╗ |
30 | | -\t██║ ███╗███████║██████╔╝██║ ██║██║ ██║███████║ |
31 | | -\t██║ ██║██╔══██║██╔══██╗██║ ██║██║ ██║██╔══██║ |
32 | | -\t╚██████╔╝██║ ██║██║ ██║╚██████╔╝██████╔╝██║ ██║ |
33 | | -\t ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ |
34 | | - ''' |
35 | | - |
36 | | - print("\n") |
37 | | - print(Fore.RED+" \t WELCOME TO ALL IN ONE ANDROID PENTESTING SETUP TOOL\n") |
38 | | - print(Fore.GREEN+__banner__) |
39 | | - |
40 | | - print (" ------------------------------------------------------------------") |
41 | | - print ("\n\t| TOOL : Android Pentesting setup \t\t|") |
42 | | - print ("\t| AUTHOR : " + __author__ + " |") |
43 | | - print ("\t| Inspiration : " + __inspired_by__ + "\t\t\t|") |
| 23 | + banner = ''' |
| 24 | + ██████╗ █████╗ ██████╗ ██╗ ██╗██████╗ █████╗ |
| 25 | + ██╔════╝ ██╔══██╗██╔══██╗██║ ██║██╔══██╗██╔══██╗ |
| 26 | + ██║ ███╗███████║██████╔╝██║ ██║██║ ██║███████║ |
| 27 | + ██║ ██║██╔══██║██╔══██╗██║ ██║██║ ██║██╔══██║ |
| 28 | + ╚██████╔╝██║ ██║██║ ██║╚██████╔╝██████╔╝██║ ██║ |
| 29 | + ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ |
| 30 | + ''' |
| 31 | + print(f"\n{Fore.RED}\t WELCOME TO ALL IN ONE ANDROID PENTESTING SETUP TOOL\n") |
| 32 | + print(f"{Fore.GREEN}{banner}\n") |
| 33 | + print(" ------------------------------------------------------------------") |
| 34 | + print("\n\t| TOOL : Android Pentesting setup \t\t|") |
| 35 | + print("\t| AUTHOR : themalwarenews ( @themalwarenews) |") |
| 36 | + print("\t| VERSION : 2.0 \t\t\t\t|\n") |
| 37 | + print(" ------------------------------------------------------------------\n\n") |
| 38 | + print(f"{Fore.RED}\t NOTE: MAKE SURE YOU HAVE TURNED ON YOUR ANDROID VIRTUAL DEVICE / REAL DEVICE AND CONNECTED VIA ADB") |
44 | 39 |
|
45 | | - print ("\t| VERSION : 1.0 \t\t\t\t|\n") |
46 | | - print (" ------------------------------------------------------------------") |
| 40 | + def install_sys_tools(self): |
| 41 | + print(f"{Fore.BLUE}\n[+] Setting up the system") |
| 42 | + for tool in self.tools_list: |
| 43 | + subprocess.call(['sudo', 'apt-get', '-f', 'install', tool], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| 44 | + print(f"{Fore.WHITE}\t[+] Installed {tool}") |
47 | 45 |
|
48 | | - print("\n\n") |
49 | | - print(Fore.RED+"\t NOTE: MAKE SURE YOU HAVE TURNED ON YOUR ANDROID VIRTUAL DEVICE / REAL DEVICE AND CONNECTED VIA ADB") |
| 46 | + for dependency in self.py_dependencies: |
| 47 | + subprocess.call(['sudo', '-H', 'pip3', 'install', dependency], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| 48 | + print(f"\t[+] Installed {dependency}") |
50 | 49 |
|
| 50 | + for dependency in self.DAST_tool: |
| 51 | + try: |
| 52 | + subprocess.check_output(['npm', '--version']) |
| 53 | + subprocess.call(['sudo', 'npm', 'install', '-g', dependency], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| 54 | + print(f"\t[+] Installed {dependency}") |
| 55 | + except subprocess.CalledProcessError: |
| 56 | + print(f"\t[+] install npm first") |
51 | 57 |
|
52 | | - def install_sys_tools(self): |
53 | | - print (Fore.BLUE+"\n[+] Setting up the system") |
54 | | - for i in self.tools_list: |
55 | | - subprocess.call(['sudo', 'apt-get', '-f', 'install', i], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
56 | | - print (Fore.WHITE+"\t[+] Installed " + i) |
57 | 58 |
|
58 | | - for j in self.py_dependencies: |
59 | | - subprocess.call(['sudo', '-H', 'pip', 'install', j], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
60 | | - print ("\t[+] Installed " + j) |
61 | | - |
62 | | - for k in self.sys_tools: |
63 | | - subprocess.call(['sudo', 'dpkg', '-i', os.getcwd() + "/system/" + k], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
64 | | - print ("\t[+] Installed " + k) |
| 59 | + for sys_tool in self.sys_tools: |
| 60 | + subprocess.call(['sudo', 'dpkg', '-i', os.path.join(SYSTEM_DIR, sys_tool)], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| 61 | + print(f"\t[+] Installed {sys_tool}") |
65 | 62 |
|
66 | 63 | def install_apks(self): |
67 | | - print (Fore.BLUE+"\n[+] Installing APK Tools") |
68 | | - for i in self.apk_list: |
69 | | - subprocess.Popen(['adb', 'install', '-r', os.getcwd() + "/apk/" + i],stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
70 | | - print (Fore.WHITE+"\n \t[+] Installed " + i) |
71 | | - |
| 64 | + print(f"{Fore.BLUE}\n[+] Installing APK Tools") |
| 65 | + for apk in self.apk_list: |
| 66 | + subprocess.Popen(['adb', 'install', '-r', os.path.join(APK_DIR, apk)], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| 67 | + print(f"{Fore.WHITE}\n \t[+] Installed {apk}") |
| 68 | + |
72 | 69 | def install_xposed(self): |
73 | | - print (Fore.BLUE+"\n[+] Installing xposedframework") |
74 | | - for i in self.flashfile: |
75 | | - subprocess.Popen(['adb', 'push', os.getcwd() + '/xposed/' + i, '/sdcard/Download'],stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
76 | | - print (Fore.WHITE+"\n \t[+] Installed " + i) |
| 70 | + print(f"{Fore.BLUE}\n[+] Installing xposedframework") |
| 71 | + for flashfile in self.flashfile: |
| 72 | + subprocess.Popen(['adb', 'push', os.path.join(XPOSED_DIR, flashfile), '/sdcard/Download'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| 73 | + print(f"{Fore.WHITE}\n \t[+] Installed {flashfile}") |
77 | 74 |
|
78 | 75 | def install_server_files(self): |
79 | | - print (Fore.BLUE+"\n[+] Installing Binary Tools") |
80 | | - for i in self.server_list: |
81 | | - subprocess.Popen(['adb', 'push', os.getcwd() + '/bin/' + i, '/data/local/tmp'],stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
82 | | - print (Fore.WHITE+"\n \t[+] Installed " + i) |
| 76 | + print(f"{Fore.BLUE}\n[+] Installing Binary Tools") |
| 77 | + for server in self.server_list: |
| 78 | + subprocess.Popen(['adb', 'push', os.path.join(BIN_DIR, server), '/data/local/tmp'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| 79 | + print(f"{Fore.WHITE}\n \t[+] Installed {server}") |
83 | 80 | os.system('adb shell "chmod 777 /data/local/tmp/frida_server"') |
84 | 81 | os.system('adb shell "chmod 777 /data/local/tmp/tcpdump"') |
85 | | - print(Fore.RED+"\n All the tools have been installed, Please goahead and configure the Xposed Framework.") |
86 | | - print(Fore.RED+"\n watch this video to setup Xposed-framework link : https://youtu.be/Sy09edb57hg .") |
87 | | - |
| 82 | + print(f"{Fore.RED}\n All the tools have been installed, Please go ahead and configure the Xposed Framework.") |
| 83 | + print(f"{Fore.RED}\n Watch this video to set up Xposed-framework link: https://youtu.be/Sy09edb57hg.") |
| 84 | + |
| 85 | + def install_go_based_tools(self): |
| 86 | + subprocess.check_call(['sudo','go', 'install', 'github.com/andpalmier/apkingo/cmd/apkingo@latest']) |
| 87 | + print("apkingo has been installed successfully.") |
| 88 | + |
| 89 | + def is_go_installed(self): |
| 90 | + try: |
| 91 | + subprocess.check_output(['go', 'version']) |
| 92 | + return True |
| 93 | + except (subprocess.CalledProcessError, FileNotFoundError): |
| 94 | + return False |
| 95 | + |
88 | 96 |
|
89 | 97 | def main(): |
90 | 98 | ga = Garuda() |
91 | 99 | ga.welcome() |
92 | | - ga.install_sys_tools() |
| 100 | + ga.install_sys_tools() |
| 101 | + if ga.is_go_installed(): |
| 102 | + ga.install_go_based_tools() |
93 | 103 | ga.install_apks() |
94 | 104 | ga.install_xposed() |
95 | 105 | ga.install_server_files() |
96 | | - |
| 106 | + |
97 | 107 |
|
98 | 108 | if __name__ == '__main__': |
99 | 109 | main() |
100 | | - |
101 | | - |
|
0 commit comments