@@ -92,11 +92,18 @@ def do_GET(self):
92
92
self .send_error (404 )
93
93
94
94
if path == 'rop.js' :
95
- print ('>> Exploit Sent...' )
96
- thread = threading .Thread (target = payload_brain ,
97
- args = (self .client_address [0 ],))
98
- thread .daemon = True
99
- thread .start ()
95
+ payload_menu = True
96
+ for thread in threading .enumerate ():
97
+ if thread .name == 'payload_brain' :
98
+ payload_menu = False
99
+
100
+ if payload_menu :
101
+ print ('>> Exploit Sent...' )
102
+ thread = threading .Thread (name = 'payload_brain' ,
103
+ target = payload_brain ,
104
+ args = (self .client_address [0 ],),
105
+ daemon = True )
106
+ thread .start ()
100
107
101
108
102
109
def check_root ():
@@ -249,8 +256,9 @@ def start_servers():
249
256
250
257
print ('>> Starting HTTP server thread...' )
251
258
server = ThreadedHTTPServer (('' , 80 ), MyHandler )
252
- thread = threading .Thread (target = server .serve_forever , args = ())
253
- thread .daemon = True
259
+ thread = threading .Thread (target = server .serve_forever ,
260
+ args = (),
261
+ daemon = True )
254
262
thread .start ()
255
263
clear_line ()
256
264
print ('>> HTTP server thread is running...' )
@@ -396,32 +404,32 @@ def main():
396
404
required = False , help = 'Print debug statements' )
397
405
args = parser .parse_args ()
398
406
399
- if not args .e_type :
400
- args .e_type = exploit_menu ()
407
+ try :
408
+ if args .debug :
409
+ DEBUG = True
410
+ else :
411
+ DEBUG = False
412
+ MyHandler .log_message = silence_http
401
413
402
- if os .path .isdir (os .path .join (EXPLOIT_LOC , args .e_type )) and args .e_type :
403
- EXPLOIT_LOC = os .path .join (EXPLOIT_LOC , args .e_type )
404
- else :
405
- closer ('ERROR: Could not find exploit specified' )
414
+ check_update_pups ()
406
415
407
- if args .debug :
408
- DEBUG = True
409
- else :
410
- DEBUG = False
411
- MyHandler .log_message = silence_http
416
+ if not args .e_type :
417
+ args .e_type = exploit_menu ()
412
418
413
- check_update_pups ()
419
+ if os .path .isdir (os .path .join (EXPLOIT_LOC , args .e_type )) and args .e_type :
420
+ EXPLOIT_LOC = os .path .join (EXPLOIT_LOC , args .e_type )
421
+ else :
422
+ closer ('ERROR: Could not find exploit specified' )
414
423
415
- lan = get_lan ()
424
+ lan = get_lan ()
416
425
417
- if write_conf (lan ):
418
- print ('>> Your DNS IP is {}' .format (lan ))
419
- else :
420
- closer ('ERROR: Unable to write {}' .format (DNS_LOC ))
426
+ if write_conf (lan ):
427
+ print ('>> Your DNS IP is {}' .format (lan ))
428
+ else :
429
+ closer ('ERROR: Unable to write {}' .format (DNS_LOC ))
421
430
422
- start_servers ()
431
+ start_servers ()
423
432
424
- try :
425
433
while True :
426
434
pass
427
435
except KeyboardInterrupt :
0 commit comments