mirror of
https://github.com/Ekultek/Zeus-Scanner.git
synced 2026-03-11 08:55:51 +00:00
edited the bin folder to be included, bin/executed is not included, minor change to main file
This commit is contained in:
parent
14d5a1dbd1
commit
567c300f7e
7 changed files with 127 additions and 21 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -2,4 +2,4 @@ log/
|
|||
geckodriver.log
|
||||
*.pyc
|
||||
.idea/
|
||||
bin/
|
||||
bin/executed
|
||||
0
bin/__init__.py
Normal file
0
bin/__init__.py
Normal file
1
bin/executed
Normal file
1
bin/executed
Normal file
|
|
@ -0,0 +1 @@
|
|||
FALSE
|
||||
BIN
bin/geckodriver-v0.18.0-linux32.tar.gz
Normal file
BIN
bin/geckodriver-v0.18.0-linux32.tar.gz
Normal file
Binary file not shown.
BIN
bin/geckodriver-v0.18.0-linux64.tar.gz
Normal file
BIN
bin/geckodriver-v0.18.0-linux64.tar.gz
Normal file
Binary file not shown.
84
bin/unzip_gecko.py
Normal file
84
bin/unzip_gecko.py
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
import os
|
||||
import platform
|
||||
import tarfile
|
||||
|
||||
import whichcraft
|
||||
|
||||
import lib.settings
|
||||
|
||||
|
||||
def check_if_run(file_check="{}/bin/executed"):
|
||||
"""
|
||||
check if the application has been run before by reading the executed file
|
||||
"""
|
||||
with open(file_check.format(os.getcwd())) as exc:
|
||||
if "FALSE" in exc.read():
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def untar_gecko(filename="{}/bin/geckodriver-v0.18.0-linux{}.tar.gz", verbose=False):
|
||||
"""
|
||||
untar the correct gecko driver for your computer architecture
|
||||
"""
|
||||
arch_info = {"64bit": "64", "32bit": "32"}
|
||||
file_arch = arch_info[platform.architecture()[0]]
|
||||
tar = tarfile.open(filename.format(os.getcwd(), file_arch), "r:gz")
|
||||
if verbose:
|
||||
lib.settings.logger.debug(lib.settings.set_color(
|
||||
"extracting the correct driver for your architecture...", level=10
|
||||
))
|
||||
try:
|
||||
tar.extractall("/usr/bin")
|
||||
if verbose:
|
||||
lib.settings.logger.debug(lib.settings.set_color(
|
||||
"driver extracted into /usr/bin (you may change this, but ensure that it "
|
||||
"is in your PATH)...", level=10
|
||||
))
|
||||
except Exception as e:
|
||||
if "[Errno 13] Permission denied: '/usr/bin/geckodriver'" in str(e):
|
||||
lib.settings.logger.exception(lib.settings.set_color(
|
||||
"first run must be ran as root (sudo python zeus.py)...", level=50
|
||||
))
|
||||
else:
|
||||
lib.settings.logger.exception(lib.settings.set_color(
|
||||
"ran into exception '{}', logged to current log file...".format(e), level=50
|
||||
))
|
||||
exit(-1)
|
||||
tar.close()
|
||||
|
||||
|
||||
def ensure_placed(item="geckodriver", verbose=False):
|
||||
"""
|
||||
use whichcraft to ensure that the driver has been placed in your PATH variable
|
||||
"""
|
||||
if verbose:
|
||||
lib.settings.logger.debug(lib.settings.set_color(
|
||||
"ensuring that the driver exists in your system path...", level=10
|
||||
))
|
||||
if not whichcraft.which(item):
|
||||
lib.settings.logger.fatal(lib.settings.set_color(
|
||||
"the executable '{}' does not appear to be in your /usr/bin PATH. "
|
||||
"please untar the correct geckodriver (if not already done) and move "
|
||||
"it to /usr/bin.".format(item), level=50
|
||||
))
|
||||
exit(-1)
|
||||
else:
|
||||
if verbose:
|
||||
lib.settings.logger.debug(lib.settings.set_color(
|
||||
"driver exists, continuing...", level=10
|
||||
))
|
||||
return True
|
||||
|
||||
|
||||
def main(rewrite="{}/bin/executed", verbose=False):
|
||||
"""
|
||||
main method
|
||||
"""
|
||||
if check_if_run():
|
||||
untar_gecko(verbose=verbose)
|
||||
if ensure_placed(verbose=verbose):
|
||||
with open(rewrite.format(os.getcwd()), "w") as rw:
|
||||
rw.write("TRUE")
|
||||
else:
|
||||
pass
|
||||
61
zeus.py
61
zeus.py
|
|
@ -24,6 +24,7 @@ from lib.settings import (
|
|||
AUTHORIZED_SEARCH_ENGINES,
|
||||
URL_LOG_PATH,
|
||||
replace_http,
|
||||
prompt
|
||||
)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
@ -80,6 +81,8 @@ if __name__ == "__main__":
|
|||
help="Start searching for sqlmap in this given path")
|
||||
misc.add_option("--show", dest="showSqlmapArguments", action="store_true",
|
||||
help="Show the arguments that the sqlmap API understands")
|
||||
misc.add_option("--batch", dest="runInBatch", action="store_true",
|
||||
help="Skip the questions and run in default batch mode")
|
||||
|
||||
parser.add_option_group(mandatory)
|
||||
parser.add_option_group(attacks)
|
||||
|
|
@ -201,6 +204,32 @@ if __name__ == "__main__":
|
|||
))
|
||||
return retval
|
||||
|
||||
def __run_attacks(url, sqlmap=False, verbose=False, nmap=False, given_path=None, auto=False, batch=False):
|
||||
"""
|
||||
run the attacks if any are requested
|
||||
"""
|
||||
if not batch:
|
||||
question = prompt(
|
||||
"would you like to process found URL: '{}'".format(url), opts=["y", "N"]
|
||||
)
|
||||
else:
|
||||
question = "y"
|
||||
|
||||
if question.lower().startswith("y"):
|
||||
if sqlmap:
|
||||
return sqlmap_scan.sqlmap_scan_main(url.strip(), verbose=verbose, opts=__create_sqlmap_arguments(),
|
||||
auto_search=auto, given_path=given_path)
|
||||
elif nmap:
|
||||
url_ip_address = replace_http(url.strip())
|
||||
return nmap_scan.perform_port_scan(url_ip_address, verbose=verbose)
|
||||
else:
|
||||
pass
|
||||
else:
|
||||
logger.warning(set_color(
|
||||
"skipping '{}'...".format(url)
|
||||
))
|
||||
|
||||
|
||||
proxy_to_use, agent_to_use = __config_headers()
|
||||
search_engine = __config_search_engine(verbose=opt.runInVerbose)
|
||||
|
||||
|
|
@ -221,16 +250,12 @@ if __name__ == "__main__":
|
|||
pass
|
||||
|
||||
urls_to_use = get_latest_log_file(URL_LOG_PATH)
|
||||
with open(urls_to_use) as urls:
|
||||
for url in urls.readlines():
|
||||
if opt.runSqliScan:
|
||||
sqlmap_scan.sqlmap_scan_main(url.strip(), verbose=opt.runInVerbose,
|
||||
opts=__create_sqlmap_arguments(),
|
||||
auto_search=opt.autoStartSqlmap,
|
||||
given_path=opt.givenSearchPath)
|
||||
elif opt.runPortScan:
|
||||
url_to_use = replace_http(url.strip())
|
||||
nmap_scan.perform_port_scan(url_to_use, verbose=opt.runInVerbose)
|
||||
if opt.runSqliScan or opt.runPortScan:
|
||||
with open(urls_to_use) as urls:
|
||||
for url in urls.readlines():
|
||||
__run_attacks(url.strip(), sqlmap=opt.runSqliScan, nmap=opt.runPortScan,
|
||||
given_path=opt.givenSearchPath, auto=opt.autoStartSqlmap,
|
||||
batch=opt.runInBatch)
|
||||
|
||||
elif opt.dorkFileToUse is not None:
|
||||
with open(opt.dorkFileToUse) as dorks:
|
||||
|
|
@ -251,16 +276,12 @@ if __name__ == "__main__":
|
|||
pass
|
||||
|
||||
urls_to_use = get_latest_log_file(URL_LOG_PATH)
|
||||
with open(urls_to_use) as urls:
|
||||
for url in urls.readlines():
|
||||
if opt.runSqliScan:
|
||||
sqlmap_scan.sqlmap_scan_main(url.strip(), verbose=opt.runInVerbose,
|
||||
opts=__create_sqlmap_arguments(),
|
||||
auto_search=opt.autoStartSqlmap,
|
||||
given_path=opt.givenSearchPath)
|
||||
elif opt.runPortScan:
|
||||
url_to_use = replace_http(url.strip())
|
||||
nmap_scan.perform_port_scan(url_to_use, verbose=opt.runInVerbose)
|
||||
if opt.runSqliScan or opt.runPortScan:
|
||||
with open(urls_to_use) as urls:
|
||||
for url in urls.readlines():
|
||||
__run_attacks(url.strip(), sqlmap=opt.runSqliScan, nmap=opt.runPortScan,
|
||||
given_path=opt.givenSearchPath, auto=opt.autoStartSqlmap,
|
||||
batch=opt.runInBatch)
|
||||
else:
|
||||
logger.critical(set_color(
|
||||
"failed to provide a mandatory argument, you will be redirected to the help menu...", level=50
|
||||
|
|
|
|||
Loading…
Reference in a new issue