mirror of
https://github.com/trustedsec/social-engineer-toolkit
synced 2024-11-23 04:53:05 +00:00
commit
a283656338
2 changed files with 37 additions and 37 deletions
|
@ -174,23 +174,23 @@ if exploit_counter == 0:
|
||||||
msfpath = (users_home + "/.msf4/")
|
msfpath = (users_home + "/.msf4/")
|
||||||
|
|
||||||
if os.path.isdir(users_home + "/.msf5/"):
|
if os.path.isdir(users_home + "/.msf5/"):
|
||||||
# then we know its actually created
|
# then we know its actually created
|
||||||
if os.path.isdir(users_home + "/.msf5/loot"):
|
if os.path.isdir(users_home + "/.msf5/loot"):
|
||||||
msfpath = (users_home + "/.msf5/")
|
msfpath = (users_home + "/.msf5/")
|
||||||
|
|
||||||
# if we have never run msf before
|
# if we have never run msf before
|
||||||
if msfpath == "":
|
if msfpath == "":
|
||||||
print_warning("Metasploit has not been previously run on the system. This means that the msf directories haven't been created yet. Running Metasploit for you.")
|
print_warning("Metasploit has not been previously run on the system. This means that the msf directories haven't been created yet. Running Metasploit for you.")
|
||||||
child = pexpect.spawn("msfconsole")
|
child = pexpect.spawn("msfconsole")
|
||||||
print_status("Waiting 10 seconds for the directories to be created...")
|
print_status("Waiting 10 seconds for the directories to be created...")
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
child.close()
|
child.close()
|
||||||
if os.path.isdir(users_home + "/.msf4"):
|
if os.path.isdir(users_home + "/.msf4"):
|
||||||
print_status("All good! The directories were created.")
|
print_status("All good! The directories were created.")
|
||||||
msfpath = (users_home + "/.msf4/")
|
msfpath = (users_home + "/.msf4/")
|
||||||
else:
|
else:
|
||||||
print_error("Please exit out of SET and type 'msfconsole' from the command prompt and launch SET again. Can't find the msf4 directory.")
|
print_error("Please exit out of SET and type 'msfconsole' from the command prompt and launch SET again. Can't find the msf4 directory.")
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
outpath = (msfpath + "local/" + outfile)
|
outpath = (msfpath + "local/" + outfile)
|
||||||
print_info("Generating fileformat exploit...")
|
print_info("Generating fileformat exploit...")
|
||||||
|
@ -209,29 +209,29 @@ if exploit_counter == 0:
|
||||||
child = pexpect.spawn(
|
child = pexpect.spawn(
|
||||||
"%smsfconsole -r %s/template.rc" % (meta_path, setdir))
|
"%smsfconsole -r %s/template.rc" % (meta_path, setdir))
|
||||||
a = 1
|
a = 1
|
||||||
counter = 0
|
counter = 0
|
||||||
while a == 1:
|
while a == 1:
|
||||||
if counter == 10:
|
if counter == 10:
|
||||||
a = 2
|
a = 2
|
||||||
print_error("Unable to generate PDF - there appears to be an issue with your Metasploit install.")
|
print_error("Unable to generate PDF - there appears to be an issue with your Metasploit install.")
|
||||||
print_error("You will need to troubleshoot Metasploit manually and try generating a PDF. You can manually troubleshoot by going to /root/.set/ and typing msfconsole -r template.rc to reproduce the issue.")
|
print_error("You will need to troubleshoot Metasploit manually and try generating a PDF. You can manually troubleshoot by going to /root/.set/ and typing msfconsole -r template.rc to reproduce the issue.")
|
||||||
pause = raw_input("Press {return} to move back.")
|
pause = raw_input("Press {return} to move back.")
|
||||||
break
|
break
|
||||||
if os.path.isfile(setdir + "/" + outfile):
|
if os.path.isfile(setdir + "/" + outfile):
|
||||||
subprocess.Popen("cp " + msfpath + "local/%s %s" % (filename_code, setdir),
|
subprocess.Popen("cp " + msfpath + "local/%s %s" % (filename_code, setdir),
|
||||||
stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=True)
|
stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=True)
|
||||||
a = 2 # break
|
a = 2 # break
|
||||||
else:
|
else:
|
||||||
print_status("Waiting for payload generation to complete (be patient, takes a bit)...")
|
print_status("Waiting for payload generation to complete (be patient, takes a bit)...")
|
||||||
if os.path.isfile(msfpath + "local/" + outfile):
|
if os.path.isfile(msfpath + "local/" + outfile):
|
||||||
subprocess.Popen("cp %slocal/%s %s" %
|
subprocess.Popen("cp %slocal/%s %s" %
|
||||||
(msfpath, outfile, setdir), shell=True)
|
(msfpath, outfile, setdir), shell=True)
|
||||||
counter = counter + 1
|
counter = counter + 1
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
|
|
||||||
print_status("Payload creation complete.")
|
print_status("Payload creation complete.")
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
print_status("All payloads get sent to the %s directory" % (outfile))
|
print_status("All payloads get sent to the %s directory" % (outfile))
|
||||||
if exploit == 'custom/exe/to/vba/payload':
|
if exploit == 'custom/exe/to/vba/payload':
|
||||||
# Creating Payload here
|
# Creating Payload here
|
||||||
# if not 64 specify raw output and filename of vb1.exe
|
# if not 64 specify raw output and filename of vb1.exe
|
||||||
|
|
|
@ -1794,7 +1794,7 @@ def get_sql_port(host):
|
||||||
except: return None
|
except: return None
|
||||||
|
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
print str(err)
|
print(err)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# capture output from a function
|
# capture output from a function
|
||||||
|
|
Loading…
Reference in a new issue