remove html generation and only export xml

This commit is contained in:
TrustedSec 2019-02-23 16:50:43 -05:00
parent fc7e0e518b
commit f395647db4
2 changed files with 21 additions and 27 deletions

View file

@ -434,10 +434,8 @@ def run():
if apache_counter == 1:
# check if we are running apache mode
print_status(
"Successfully stopped Apache. Starting the credential harvester.")
print_status(
"Harvester is ready, have victim browse to your site.")
print_status("Successfully stopped Apache. Starting the credential harvester.")
print_status("Harvester is ready, have victim browse to your site.")
if apache_check == False:
try:
@ -465,11 +463,11 @@ def run():
except Exception:
apache_counter = 0
if apache_counter == 0:
print(bcolors.GREEN + "[*] Try disabling Apache and try SET again." + bcolors.ENDC)
print("[*] Printing error: " + str(e) + "\n")
return_continue()
exit_set()
#if apache_counter == 0:
# print(bcolors.GREEN + "[*] Try disabling Apache and try SET again." + bcolors.ENDC)
# print("[*] Printing error: " + str(e) + "\n")
# return_continue()
# exit_set()
# if we are using apache, then use the harvester php type that writes it out to post.php
# note just change the index.html to post somewhere else and rename the

View file

@ -7,8 +7,7 @@ import datetime
from src.core.setcore import *
# make sure the reports directory is created
if not os.path.isdir(userconfigpath + "reports/"):
os.makedirs(userconfigpath + "reports/")
if not os.path.isdir(userconfigpath + "reports/"): os.makedirs(userconfigpath + "reports/")
#
# Quick report generation script
@ -46,28 +45,27 @@ for line in fileopen:
filewrite2.write(r"<harvester>" + "\n")
for line2 in fileopen1:
counter = 0
filewrite = open(userconfigpath + "reports/%s.html" % (now), "a")
#filewrite = open(userconfigpath + "reports/%s.html" % (now), "a")
match1 = re.search("REPLACEHEREDUDE", line2)
if match1:
line2 = line2.replace("REPLACEHEREDUDE", url)
filewrite.write(line2)
#filewrite.write(line2)
url_xml = url.rstrip()
filewrite2.write(" %s" % (url_xml) + "\n")
counter = 1
match2 = re.search(
"If this is blank, SET did not get a successful attempt on the website, sorry hoss..", line2)
match2 = re.search("If this is blank, SET did not get a successful attempt on the website, sorry hoss..", line2)
if match2:
line2 = line2.replace(
"If this is blank, SET did not get a successful attempt on the website, sorry hoss..", "Report findings on %s<br><br>" % (url))
counter = 1
filewrite.write(line2)
#filewrite.write(line2)
opentag = True
for line3 in site_template:
match3 = re.search("PARAM:", line3)
if match3:
xml = line3.replace("PARAM: ", "")
xml = xml.rstrip()
filewrite.write(line3 + "<br>")
#filewrite.write(line3 + "<br>")
if opentag:
filewrite2.write(r" <url>")
opentag = False
@ -77,8 +75,8 @@ for line in fileopen:
if match4:
filewrite2.write(" </url>" + "\n")
opentag = True
filewrite.write(
"<br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br><br>")
#filewrite.write(
# "<br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br><br>")
# look for how many people visited the website
match5 = re.search("VISITORSHERE", line2)
@ -112,19 +110,17 @@ for line in fileopen:
line2 = line2.replace("BITESHERE", str(counter5))
counter = 1
filewrite.write(line2)
#filewrite.write(line2)
if counter == 0:
filewrite.write(line2)
#if counter == 0:
#filewrite.write(line2)
try:
filewrite.close()
#filewrite.close()
filewrite2.write(r"</harvester>" + "\n")
filewrite2.close()
except:
pass
subprocess.Popen("cp -rf %s/src/core/reports/files %sreports/" % (definepath,
userconfigpath), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).wait()
print(bcolors.BLUE + "[*] File exported to %s/reports/%s.html for your reading pleasure..." % (userconfigpath, now) + bcolors.ENDC)
print(bcolors.BLUE + "[*] File in XML format exported to %s/reports/%s.xml for your reading pleasure..." % (userconfigpath, now) + bcolors.ENDC)
subprocess.Popen("cp -rf %s/src/core/reports/files %sreports/" % (definepath, userconfigpath), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).wait()
print(bcolors.BLUE + "[*] File in XML format exported to %sreports/%s.xml for your reading pleasure..." % (userconfigpath, now) + bcolors.ENDC)