initial fix for issue #49, still more work to be done

This commit is contained in:
ekultek 2017-10-05 21:21:51 -05:00
parent 3004ca5595
commit 97b620aef4
7 changed files with 23 additions and 35 deletions

View file

@ -12,7 +12,6 @@ from lib.settings import (
replace_http,
set_color,
create_tree,
fix_log_file
)
@ -60,7 +59,6 @@ def check_for_admin_page(url, exts, protocol="http://", show_possibles=False, ve
logger.exception(set_color(
"failed to connect with unexpected error '{}'...".format(str(e)), level=50
))
fix_log_file()
request_issue_creation()
possible_connections, connections = list(possible_connections), list(connections)
data_msg = "found {} possible connections(s) and {} successful connection(s)..."

View file

@ -9,7 +9,6 @@ from lib.settings import (
proxy_string_to_dict,
logger, set_color,
DEFAULT_USER_AGENT,
fix_log_file
)
@ -122,5 +121,4 @@ def main_intel_amt(url, agent=None, proxy=None):
logger.exception(set_color(
"ran into exception '{}', cannot continue...".format(e)
))
fix_log_file()
request_issue_creation()

View file

@ -9,7 +9,6 @@ from lib.settings import (
set_color,
create_dir,
find_application,
fix_log_file
)
@ -135,7 +134,6 @@ def perform_port_scan(url, ports=None, scanner=NmapHook, verbose=False, opts=Non
logger.exception(set_color(
"ran into exception '{}', cannot continue quitting...".format(e), level=50
))
fix_log_file()
request_issue_creation()
pass
else:

View file

@ -40,7 +40,7 @@ class SqlmapHook(object):
new_scan_url = "{}{}".format(self.connection, self.commands["init"])
return requests.get(new_scan_url, params=self.headers)
def get_scan_id(self):
def get_scan_id(self, split_by=16):
"""
get the ID of the current API scan
"""
@ -48,7 +48,8 @@ class SqlmapHook(object):
api_id_url = "{}{}".format(self.connection, self.commands["id"])
req = requests.get(api_id_url)
to_check = str(json.loads(req.content)["tasks"]).lower()
return ''.join(id_re.findall(to_check))
current_scan_id = ''.join(id_re.findall(to_check))
return current_scan_id
def start_scan(self, api_id, opts=None):
"""
@ -189,6 +190,5 @@ def sqlmap_scan_main(url, port=None, verbose=None, auto_search=False, opts=None,
"ran into error '{}', seems something went wrong, error has "
"been saved to current log file.".format(e), level=50
))
lib.settings.fix_log_file()
request_issue_creation()
pass

View file

@ -22,7 +22,7 @@ except NameError:
# clone link
CLONE = "https://github.com/ekultek/zeus-scanner.git"
# current version <major.minor.commit.patch ID>
VERSION = "1.0.29"
VERSION = "1.0.29.1f59"
# colors to output depending on the version
VERSION_TYPE_COLORS = {"dev": 33, "stable": 92, "other": 30}
# version string formatting

View file

@ -14,7 +14,10 @@ from lib.settings import (
set_color,
get_latest_log_file,
CURRENT_LOG_FILE_PATH,
VERSION
VERSION,
shutdown,
prompt,
fix_log_file
)
@ -35,6 +38,16 @@ def decode(n, token):
def request_issue_creation():
question = prompt(
"would you like to create an anonymous issue and post it to Zeus's Github", opts="yN"
)
if question.lower().startswith("n"):
logger.error(set_color(
"Zeus has experienced an internal error and cannot continue, shutting down...", level=40
))
shutdown()
fix_log_file()
logger.info(set_color(
"Zeus got an unexpected error and will automatically create an issue for this error, please wait..."
))

29
zeus.py
View file

@ -413,12 +413,7 @@ if __name__ == "__main__":
logger.exception(set_color(
"ran into exception '{}'...".format(e), level=50
))
issue = prompt(
"would you like to create an anonymous issue on Zeus's Github page", opts="yN"
)
if issue.lower().startswith("y"):
fix_log_file()
request_issue_creation()
request_issue_creation()
pass
urls_to_use = get_latest_log_file(URL_LOG_PATH)
@ -490,12 +485,7 @@ if __name__ == "__main__":
logger.exception(set_color(
"ran into exception '{}'...".format(e), level=50
))
issue = prompt(
"would you like to create an anonymous issue on Zeus's Github page", opts="yN"
)
if issue.lower().startswith("y"):
fix_log_file()
request_issue_creation()
request_issue_creation()
pass
urls_to_use = get_latest_log_file(URL_LOG_PATH)
@ -540,12 +530,8 @@ if __name__ == "__main__":
"ran into exception '{}' and cannot continue, saved to current log file...".format(e),
level=50
))
issue = prompt(
"would you like to create an anonymous issue on Zeus's Github page", opts="yN"
)
if issue.lower().startswith("y"):
fix_log_file()
request_issue_creation()
request_issue_creation()
pass
elif opt.spiderWebSite:
problem_identifiers = ["http://", "https://"]
@ -633,12 +619,7 @@ if __name__ == "__main__":
logger.exception(set_color(
"ran into exception '{}' exception has been saved to log file...".format(e), level=50
))
issue = prompt(
"would you like to create an anonymous issue on Zeus's Github page", opts="yN"
)
if issue.lower().startswith("y"):
fix_log_file()
request_issue_creation()
request_issue_creation()
fix_log_file()
shutdown()