From 09d3bf106744afd29b96cdde6e4e8e0f32222a48 Mon Sep 17 00:00:00 2001 From: ekultek Date: Wed, 27 Sep 2017 14:14:08 -0500 Subject: [PATCH] created a flag for you to pass a file to try attacks with, this way you can just attack the targets found after searching --- lib/attacks/nmap_scan/__init__.py | 2 +- lib/settings.py | 2 +- zeus.py | 36 +++++++++++++++++++++++++++---- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/lib/attacks/nmap_scan/__init__.py b/lib/attacks/nmap_scan/__init__.py index 817d943..c993624 100644 --- a/lib/attacks/nmap_scan/__init__.py +++ b/lib/attacks/nmap_scan/__init__.py @@ -128,7 +128,7 @@ def perform_port_scan(url, ports=None, scanner=NmapHook, verbose=False, opts=Non logger.fatal(set_color( "no port information found for '{}({})'...".format( url, found_ip_address - ) + ), level=50 )) except Exception as e: logger.exception(set_color( diff --git a/lib/settings.py b/lib/settings.py index 7f29c86..3a92cb4 100644 --- a/lib/settings.py +++ b/lib/settings.py @@ -22,7 +22,7 @@ except NameError: # clone link CLONE = "https://github.com/ekultek/zeus-scanner.git" # current version -VERSION = "1.0.18.7124" +VERSION = "1.0.19" # colors to output depending on the version VERSION_TYPE_COLORS = {"dev": 33, "stable": 92, "other": 30} # version string formatting diff --git a/zeus.py b/zeus.py index 5168b89..bfd4926 100755 --- a/zeus.py +++ b/zeus.py @@ -8,8 +8,7 @@ import random try: import http.client as http_client # Python 3 except ImportError: - import httplib as http_client # Python 2 - + import httplib as http_client # Python 2 from var import blackwidow from var.google_search import search from lib.errors import InvalidInputProvided @@ -63,6 +62,8 @@ if __name__ == "__main__": help="Use a random dork from the etc/dorks.txt file to perform the scan") mandatory.add_option("-b", "--blackwidow", dest="spiderWebSite", metavar="URL", help="Spider a single webpage for all available URL's") + mandatory.add_option("-f", "--url-file", dest="fileToEnumerate", metavar="FILE-PATH", + help="Run an attack on URL's in a given file") # attack options attacks = optparse.OptionGroup(parser, "Attack arguments", @@ -225,6 +226,15 @@ if __name__ == "__main__": )) http_client.HTTPConnection.debuglevel = 1 + def __choose_attack(choice, attacks): + while True: + if int(choice) in range(len(attacks)): + return int(choice) + else: + logger.warning(set_color( + "{} is not a valid choice...".format(choice) + )) + def __config_headers(): """ @@ -281,7 +291,7 @@ if __name__ == "__main__": )) logger.info(set_color( "using default search engine..." - )) + )) if opt.fileToEnumerate is None else "" se = AUTHORIZED_SEARCH_ENGINES["google"] return se @@ -485,7 +495,8 @@ if __name__ == "__main__": else: shutdown() - blackwidow.blackwidow_main(opt.spiderWebSite, agent=agent_to_use, proxy=proxy_to_use, verbose=opt.runInVerbose) + blackwidow.blackwidow_main(opt.spiderWebSite, agent=agent_to_use, proxy=proxy_to_use, + verbose=opt.runInVerbose) urls_to_use = get_latest_log_file(SPIDER_LOG_PATH) if opt.runSqliScan or opt.runPortScan or opt.intelCheck or opt.adminPanelFinder or opt.runXssScan: @@ -498,6 +509,23 @@ if __name__ == "__main__": auto=opt.autoStartSqlmap, verbose=opt.runInVerbose, batch=opt.runInBatch ) + elif opt.fileToEnumerate is not None: + with open(opt.fileToEnumerate) as urls: + if opt.runSqliScan or opt.runPortScan or opt.intelCheck or opt.adminPanelFinder or opt.runXssScan: + for url in urls.readlines(): + url = url.strip() + __run_attacks( + url, + sqlmap=opt.runSqliScan, nmap=opt.runPortScan, intel=opt.intelCheck, xss=opt.runXssScan, + admin=opt.adminPanelFinder, given_path=opt.givenSearchPath, + auto=opt.autoStartSqlmap, verbose=opt.runInVerbose, batch=opt.runInBatch + ) + else: + logger.fatal(set_color( + "failed to provide an attack argument, attack argument must be provided " + "for Zeus to attack the provided URL's", level=50 + )) + else: logger.critical(set_color( "failed to provide a mandatory argument, you will be redirected to the help menu...", level=50