mirror of
https://github.com/Ekultek/Zeus-Scanner.git
synced 2026-03-11 08:55:51 +00:00
Compare commits
15 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21b8756306 | ||
|
|
d75169e401 | ||
|
|
f6a3ada2f0 | ||
|
|
ac83743b4d | ||
|
|
910c3e434a | ||
|
|
f512423c4e | ||
|
|
2ca5c5ac3f | ||
|
|
55ba7ca7fe | ||
|
|
caa7a4a564 | ||
|
|
3d8cf0e9f8 | ||
|
|
9dae61919d | ||
|
|
fe9c0abb76 | ||
|
|
443c0d94d1 | ||
|
|
cfc348f03f | ||
|
|
6cecf4f6d1 |
10 changed files with 154 additions and 67 deletions
34
Dockerfile
Normal file
34
Dockerfile
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
FROM ubuntu:18.10
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN apt update && \
|
||||||
|
apt install -y \
|
||||||
|
libxml2-dev \
|
||||||
|
libxslt1-dev \
|
||||||
|
libgtk-3-dev \
|
||||||
|
libdbus-glib-1-2 \
|
||||||
|
python-dev \
|
||||||
|
python-pip \
|
||||||
|
git \
|
||||||
|
curl \
|
||||||
|
nmap \
|
||||||
|
sqlmap \
|
||||||
|
xvfb \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
ARG GECKO_DRIVER_VERSION=0.23.0
|
||||||
|
ARG FIREFOX_VERSION=58.0.2
|
||||||
|
|
||||||
|
RUN git clone https://github.com/ekultek/zeus-scanner.git . && \
|
||||||
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
RUN curl -L https://github.com/mozilla/geckodriver/releases/download/v${GECKO_DRIVER_VERSION}/geckodriver-v${GECKO_DRIVER_VERSION}-linux64.tar.gz | tar xz -C /usr/bin
|
||||||
|
|
||||||
|
RUN curl -L https://ftp.mozilla.org/pub/firefox/releases/${FIREFOX_VERSION}/linux-$(uname -m)/en-US/firefox-${FIREFOX_VERSION}.tar.bz2 -o firefox.tar.bz2 && \
|
||||||
|
tar xjf firefox.tar.bz2 -C /opt && \
|
||||||
|
rm firefox.tar.bz2 && \
|
||||||
|
ln -s /opt/firefox/firefox /usr/bin/firefox
|
||||||
|
|
||||||
|
CMD ["python", "zeus.py"]
|
||||||
|
|
||||||
|
|
@ -1,8 +1,12 @@
|
||||||
|
**_NOTE: due to dumbass people, automatic issue creation has been turned off until further notice_**
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
[](https://github.com/ekultek/zeus-scanner/stargazers)
|
[](https://github.com/ekultek/zeus-scanner/stargazers)
|
||||||
[](https://github.com/ekultek/zeus-scanner/network)
|
[](https://github.com/ekultek/zeus-scanner/network)
|
||||||
[](https://github.com/ekultek/zeus-scanner/issues)
|
[](https://github.com/ekultek/zeus-scanner/issues)
|
||||||
[](https://raw.githubusercontent.com/Ekultek/Zeus-Scanner/master/.github/LICENSE.md)
|
[](https://raw.githubusercontent.com/Ekultek/Zeus-Scanner/master/.github/LICENSE.md)
|
||||||
[](https://twitter.com/Zeus_Scanner)
|
[](https://twitter.com/stay__salty)
|
||||||
[](https://github.com/Ekultek/Zeus-Scanner#donations)
|
[](https://github.com/Ekultek/Zeus-Scanner#donations)
|
||||||
|
|
||||||
# Helpful links directory
|
# Helpful links directory
|
||||||
|
|
@ -80,7 +84,7 @@ There are some requirements for this to be run successfully.
|
||||||
##### Basic requirements
|
##### Basic requirements
|
||||||
|
|
||||||
- `libxml2-dev`, `libxslt1-dev`, `python-dev` are required for the installation process
|
- `libxml2-dev`, `libxslt1-dev`, `python-dev` are required for the installation process
|
||||||
- Firefox web browser is required as of now, you will need Firefox version `<=57 >=51` (between 51 and 57). Full functionality for other browsers will eventually be added.
|
- Firefox web browser is required as of now, you will need Firefox version `<=58 >=52` (between 52 and 58). Full functionality for other browsers will eventually be added.
|
||||||
- If you want to run sqlmap through the URL's you will need sqlmap somewhere on your system.
|
- If you want to run sqlmap through the URL's you will need sqlmap somewhere on your system.
|
||||||
- If you want to run a port scan using nmap on the URL's IP addresses. You will need nmap on your system.
|
- If you want to run a port scan using nmap on the URL's IP addresses. You will need nmap on your system.
|
||||||
- [Geckodriver](https://github.com/mozilla/geckodriver) is required to run the firefox web browser and will be installed the first time you run. It will be added to your `/usr/bin` so that it can be run in your ENV PATH.
|
- [Geckodriver](https://github.com/mozilla/geckodriver) is required to run the firefox web browser and will be installed the first time you run. It will be added to your `/usr/bin` so that it can be run in your ENV PATH.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
import shlex
|
||||||
import platform
|
import platform
|
||||||
|
import threading
|
||||||
import subprocess
|
import subprocess
|
||||||
import tarfile
|
import tarfile
|
||||||
try:
|
try:
|
||||||
|
|
@ -13,6 +17,27 @@ import lib.core.common
|
||||||
import lib.core.settings
|
import lib.core.settings
|
||||||
|
|
||||||
|
|
||||||
|
stop_animation = False
|
||||||
|
xvfb_path = "{}/etc/scripts/install_xvfb.sh".format(os.getcwd())
|
||||||
|
|
||||||
|
|
||||||
|
def animation(text):
|
||||||
|
global stop_animation
|
||||||
|
i = 0
|
||||||
|
while not stop_animation:
|
||||||
|
temp_text = list(text)
|
||||||
|
if i >= len(temp_text):
|
||||||
|
i = 0
|
||||||
|
temp_text[i] = temp_text[i].upper()
|
||||||
|
temp_text = ''.join(temp_text)
|
||||||
|
sys.stdout.write("\033[92m{}\r\033[0m".format(temp_text))
|
||||||
|
sys.stdout.flush()
|
||||||
|
i += 1
|
||||||
|
time.sleep(0.1)
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def disclaimer():
|
def disclaimer():
|
||||||
question = raw_input(
|
question = raw_input(
|
||||||
"\033[91mAttacking targets without consent is not only illegal, but it "
|
"\033[91mAttacking targets without consent is not only illegal, but it "
|
||||||
|
|
@ -46,6 +71,8 @@ def parse_hosts(filepath="/etc/hosts"):
|
||||||
|
|
||||||
|
|
||||||
def find_tools(to_search=("sqlmap", "nmap"), directory="{}/bin/paths", filename="path_config.ini"):
|
def find_tools(to_search=("sqlmap", "nmap"), directory="{}/bin/paths", filename="path_config.ini"):
|
||||||
|
global stop_animation
|
||||||
|
|
||||||
lib.core.settings.create_dir(directory.format(os.getcwd()))
|
lib.core.settings.create_dir(directory.format(os.getcwd()))
|
||||||
full_path = "{}/{}".format(
|
full_path = "{}/{}".format(
|
||||||
directory.format(os.getcwd()),
|
directory.format(os.getcwd()),
|
||||||
|
|
@ -62,6 +89,8 @@ def find_tools(to_search=("sqlmap", "nmap"), directory="{}/bin/paths", filename=
|
||||||
path_schema[item] = None
|
path_schema[item] = None
|
||||||
for key, value in path_schema.iteritems():
|
for key, value in path_schema.iteritems():
|
||||||
if value is None:
|
if value is None:
|
||||||
|
stop_animation = True
|
||||||
|
print("\n")
|
||||||
provided_path = lib.core.common.prompt(
|
provided_path = lib.core.common.prompt(
|
||||||
"what is the full path to {} on your system".format(key)
|
"what is the full path to {} on your system".format(key)
|
||||||
)
|
)
|
||||||
|
|
@ -78,9 +107,9 @@ def config_gecko_version(browser_version):
|
||||||
figure out which gecko version you need
|
figure out which gecko version you need
|
||||||
"""
|
"""
|
||||||
version_specs = {
|
version_specs = {
|
||||||
(56, 57): 19,
|
(57, 58): 19,
|
||||||
(55, 54): 18,
|
(56, 55, 54): 18,
|
||||||
(53, 52, 51): 17
|
(53, 52): 17
|
||||||
}
|
}
|
||||||
if isinstance(browser_version, (tuple, list, set)):
|
if isinstance(browser_version, (tuple, list, set)):
|
||||||
major = browser_version[0]
|
major = browser_version[0]
|
||||||
|
|
@ -112,11 +141,13 @@ def check_xvfb(exc="Xvfb"):
|
||||||
"""
|
"""
|
||||||
test for xvfb on the users system
|
test for xvfb on the users system
|
||||||
"""
|
"""
|
||||||
|
global xvfb_path
|
||||||
|
global stop_animation
|
||||||
if whichcraft.which(exc) is None:
|
if whichcraft.which(exc) is None:
|
||||||
lib.core.settings.logger.info(lib.core.settings.set_color(
|
cmd = shlex.split("sudo sh {}".format(xvfb_path))
|
||||||
"installing Xvfb, required by pyvirutaldisplay"
|
subprocess.call(cmd)
|
||||||
))
|
stop_animation = True
|
||||||
subprocess.call(["sudo", "apt-get", "install", "xvfb"])
|
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
@ -136,19 +167,23 @@ def check_if_run(file_check="{}/bin/executed.txt"):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def untar_gecko(filename="{}/bin/drivers/geckodriver-v0.{}.0-linux{}.tar.gz", verbose=False):
|
def untar_gecko(filename="{}/bin/drivers/geckodriver-v0.{}.0-linux{}.tar.gz"):
|
||||||
"""
|
"""
|
||||||
untar the correct gecko driver for your computer architecture
|
untar the correct gecko driver for your computer architecture
|
||||||
"""
|
"""
|
||||||
|
global stop_animation
|
||||||
|
|
||||||
arch_info = {"64bit": "64", "32bit": "32"}
|
arch_info = {"64bit": "64", "32bit": "32"}
|
||||||
file_arch = arch_info[platform.architecture()[0]]
|
file_arch = arch_info[platform.architecture()[0]]
|
||||||
ff_version = lib.core.settings.get_browser_version()
|
ff_version = lib.core.settings.get_browser_version(output=False)
|
||||||
if isinstance(ff_version, str) or ff_version is None:
|
if isinstance(ff_version, str) or ff_version is None:
|
||||||
|
stop_animation = True
|
||||||
ff_version = lib.core.common.prompt(
|
ff_version = lib.core.common.prompt(
|
||||||
"enter your firefox browser version (if you don't know it run firefox --version"
|
"enter your firefox browser version (if you don't know it run firefox --version)"
|
||||||
)
|
)
|
||||||
gecko_version = config_gecko_version(ff_version)
|
gecko_version = config_gecko_version(ff_version)
|
||||||
if gecko_version is None:
|
if gecko_version is None:
|
||||||
|
stop_animation = True
|
||||||
lib.core.settings.logger.fatal(lib.core.settings.set_color(
|
lib.core.settings.logger.fatal(lib.core.settings.set_color(
|
||||||
"your current firefox version is not supported by Zeus", level=50
|
"your current firefox version is not supported by Zeus", level=50
|
||||||
))
|
))
|
||||||
|
|
@ -157,22 +192,10 @@ def untar_gecko(filename="{}/bin/drivers/geckodriver-v0.{}.0-linux{}.tar.gz", ve
|
||||||
with open(lib.core.settings.GECKO_VERSION_INFO_PATH, "a+") as log:
|
with open(lib.core.settings.GECKO_VERSION_INFO_PATH, "a+") as log:
|
||||||
log.write(gecko_full_filename.split("/")[-1])
|
log.write(gecko_full_filename.split("/")[-1])
|
||||||
tar = tarfile.open(filename.format(os.getcwd(), gecko_version, file_arch), "r:gz")
|
tar = tarfile.open(filename.format(os.getcwd(), gecko_version, file_arch), "r:gz")
|
||||||
if verbose:
|
|
||||||
lib.core.settings.logger.debug(lib.core.settings.set_color(
|
|
||||||
"extracting the correct driver for your architecture", level=10
|
|
||||||
))
|
|
||||||
try:
|
try:
|
||||||
tar.extractall("/usr/bin")
|
tar.extractall("/usr/bin")
|
||||||
if verbose:
|
|
||||||
lib.core.settings.logger.debug(lib.core.settings.set_color(
|
|
||||||
"driver extracted into /usr/bin (you may change this, but ensure that it "
|
|
||||||
"is in your PATH)", level=10
|
|
||||||
))
|
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
if "Text file busy" in str(e):
|
if "Text file busy" in str(e):
|
||||||
lib.core.settings.logger.info(lib.core.settings.set_color(
|
|
||||||
"the driver is already installed"
|
|
||||||
))
|
|
||||||
tar.close()
|
tar.close()
|
||||||
pass
|
pass
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
@ -192,10 +215,6 @@ def ensure_placed(item="geckodriver", verbose=False):
|
||||||
"""
|
"""
|
||||||
use whichcraft to ensure that the driver has been placed in your PATH variable
|
use whichcraft to ensure that the driver has been placed in your PATH variable
|
||||||
"""
|
"""
|
||||||
if verbose:
|
|
||||||
lib.core.settings.logger.debug(lib.core.settings.set_color(
|
|
||||||
"ensuring that the driver exists in your system path", level=10
|
|
||||||
))
|
|
||||||
if not whichcraft.which(item):
|
if not whichcraft.which(item):
|
||||||
lib.core.settings.logger.fatal(lib.core.settings.set_color(
|
lib.core.settings.logger.fatal(lib.core.settings.set_color(
|
||||||
"the executable '{}' does not appear to be in your /usr/bin PATH. "
|
"the executable '{}' does not appear to be in your /usr/bin PATH. "
|
||||||
|
|
@ -204,10 +223,6 @@ def ensure_placed(item="geckodriver", verbose=False):
|
||||||
))
|
))
|
||||||
exit(-1)
|
exit(-1)
|
||||||
else:
|
else:
|
||||||
if verbose:
|
|
||||||
lib.core.settings.logger.debug(lib.core.settings.set_color(
|
|
||||||
"driver exists, continuing", level=10
|
|
||||||
))
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -215,10 +230,6 @@ def main(rewrite="{}/bin/executed.txt", verbose=False):
|
||||||
"""
|
"""
|
||||||
main method
|
main method
|
||||||
"""
|
"""
|
||||||
if verbose:
|
|
||||||
lib.core.settings.logger.debug(lib.core.settings.set_color(
|
|
||||||
"verifying operating system", level=10
|
|
||||||
))
|
|
||||||
if not check_os():
|
if not check_os():
|
||||||
raise NotImplementedError(lib.core.settings.set_color(
|
raise NotImplementedError(lib.core.settings.set_color(
|
||||||
"as of now, Zeus requires Linux to run successfully "
|
"as of now, Zeus requires Linux to run successfully "
|
||||||
|
|
@ -228,17 +239,13 @@ def main(rewrite="{}/bin/executed.txt", verbose=False):
|
||||||
if check_if_run():
|
if check_if_run():
|
||||||
if not disclaimer():
|
if not disclaimer():
|
||||||
exit(1)
|
exit(1)
|
||||||
lib.core.settings.logger.info(lib.core.settings.set_color(
|
t = threading.Thread(target=animation, args=(
|
||||||
"seems this is your first time running the application, "
|
"seems this is your first time running the application, doing setup please wait..",))
|
||||||
"doing setup please wait"
|
t.daemon = True
|
||||||
))
|
t.start()
|
||||||
if verbose:
|
|
||||||
lib.core.settings.logger.debug(lib.core.settings.set_color(
|
|
||||||
"checking if xvfb is on your system", level=10
|
|
||||||
))
|
|
||||||
find_tools()
|
find_tools()
|
||||||
check_xvfb()
|
check_xvfb()
|
||||||
untar_gecko(verbose=verbose)
|
untar_gecko()
|
||||||
parse_hosts()
|
parse_hosts()
|
||||||
if ensure_placed(verbose=verbose):
|
if ensure_placed(verbose=verbose):
|
||||||
with open(rewrite.format(os.getcwd()), "w") as rw:
|
with open(rewrite.format(os.getcwd()), "w") as rw:
|
||||||
|
|
@ -247,7 +254,4 @@ def main(rewrite="{}/bin/executed.txt", verbose=False):
|
||||||
"done, continuing process"
|
"done, continuing process"
|
||||||
))
|
))
|
||||||
else:
|
else:
|
||||||
if verbose:
|
pass
|
||||||
lib.core.settings.logger.debug(lib.core.settings.set_color(
|
|
||||||
"already ran, skipping", level=10
|
|
||||||
))
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
e46c781638861a5651a51a5a71f5d997 ./zeus.py
|
685a20fa3fc7652b5c3e39821cdc6f25 ./zeus.py
|
||||||
4b32db388e8acda35570c734d27c950c ./etc/scripts/launch_sqlmap.sh
|
4b32db388e8acda35570c734d27c950c ./etc/scripts/launch_sqlmap.sh
|
||||||
6ad5f22ec4a6f8324bfb1b01ab6d51ec ./etc/scripts/cleanup.sh
|
6ad5f22ec4a6f8324bfb1b01ab6d51ec ./etc/scripts/cleanup.sh
|
||||||
869025acb457dc881e53e440aa11dd7b ./etc/scripts/reinstall.sh
|
869025acb457dc881e53e440aa11dd7b ./etc/scripts/reinstall.sh
|
||||||
155c9482f690f1482f324a7ffd8b8098 ./etc/scripts/fix_pie.sh
|
155c9482f690f1482f324a7ffd8b8098 ./etc/scripts/fix_pie.sh
|
||||||
0e435c641bc636ac0b3d54e032d9cf6a ./etc/scripts/install_nmap.sh
|
0e435c641bc636ac0b3d54e032d9cf6a ./etc/scripts/install_nmap.sh
|
||||||
|
440431165b2db8a537c1a93cb2232f16 ./etc/scripts/install_xvfb.sh
|
||||||
66b11aa388ea909de7b212341259a318 ./etc/auths/git_auth
|
66b11aa388ea909de7b212341259a318 ./etc/auths/git_auth
|
||||||
8f686b05c5c5dfc02f0fcaa7ebc8677c ./etc/auths/whois_auth
|
8f686b05c5c5dfc02f0fcaa7ebc8677c ./etc/auths/whois_auth
|
||||||
d3ad89703575a712a0aeead2b176d8c5 ./etc/html/clickjacking_test_page.html
|
d3ad89703575a712a0aeead2b176d8c5 ./etc/html/clickjacking_test_page.html
|
||||||
|
|
@ -15,7 +16,7 @@ cf85d83da34d70720193d83950c31fdc ./etc/text_files/xss_payloads.txt
|
||||||
5250f0aa13b8af4775efa506e77de1ce ./etc/xml/headers.xml
|
5250f0aa13b8af4775efa506e77de1ce ./etc/xml/headers.xml
|
||||||
d41d8cd98f00b204e9800998ecf8427e ./bin/__init__.py
|
d41d8cd98f00b204e9800998ecf8427e ./bin/__init__.py
|
||||||
3be7ee6f4267e0d0cf2143b58792527b ./bin/paths/path_config.ini
|
3be7ee6f4267e0d0cf2143b58792527b ./bin/paths/path_config.ini
|
||||||
a0e18eb30258bbab246f983b6af95d5c ./bin/unzip_gecko.py
|
fa5084cc7ee56ff2df8631b76be5be4d ./bin/unzip_gecko.py
|
||||||
c0d83f0b82a6b30de8811e69e6d95c61 ./bin/executed.txt
|
c0d83f0b82a6b30de8811e69e6d95c61 ./bin/executed.txt
|
||||||
dc1eb4ebe0f372af48b5a9c107ebc68d ./bin/drivers/geckodriver-v0.18.0-linux32.tar.gz
|
dc1eb4ebe0f372af48b5a9c107ebc68d ./bin/drivers/geckodriver-v0.18.0-linux32.tar.gz
|
||||||
be18faeea6e7db9db6990d8667e2298f ./bin/drivers/geckodriver-v0.17.0-linux64.tar.gz
|
be18faeea6e7db9db6990d8667e2298f ./bin/drivers/geckodriver-v0.17.0-linux64.tar.gz
|
||||||
|
|
@ -105,10 +106,10 @@ c5b69617f040fef1d5930948905aa8d0 ./lib/attacks/whois_lookup/whois.py
|
||||||
0114ebe3d45612ef143f2777f027374c ./lib/header_check/__init__.py
|
0114ebe3d45612ef143f2777f027374c ./lib/header_check/__init__.py
|
||||||
2a8acb2191d80da75f0e4d09c00df9f6 ./lib/core/common.py
|
2a8acb2191d80da75f0e4d09c00df9f6 ./lib/core/common.py
|
||||||
de4254c5e40f7aa4fb81e0608f758a2c ./lib/core/decorators.py
|
de4254c5e40f7aa4fb81e0608f758a2c ./lib/core/decorators.py
|
||||||
4433353fb5c55578391d8b4006191ee8 ./lib/core/errors.py
|
3f045c64ef155a517b7a3f3b66905325 ./lib/core/errors.py
|
||||||
d41d8cd98f00b204e9800998ecf8427e ./lib/core/__init__.py
|
d41d8cd98f00b204e9800998ecf8427e ./lib/core/__init__.py
|
||||||
993a8df2025cfed6c0fa96cc1107f76b ./lib/core/settings.py
|
0faeed8eac30526f3751dd67fe5c9f7e ./lib/core/settings.py
|
||||||
1db34403d9eed871a5c39baab6fe1efd ./lib/core/parse.py
|
27bce5d5d1e7d01788c5273016b19370 ./lib/core/parse.py
|
||||||
d41d8cd98f00b204e9800998ecf8427e ./var/__init__.py
|
d41d8cd98f00b204e9800998ecf8427e ./var/__init__.py
|
||||||
d41d8cd98f00b204e9800998ecf8427e ./var/auto_issue/__init__.py
|
d41d8cd98f00b204e9800998ecf8427e ./var/auto_issue/__init__.py
|
||||||
c58e73857e42a07fa6eb559433b32c1a ./var/auto_issue/github.py
|
c58e73857e42a07fa6eb559433b32c1a ./var/auto_issue/github.py
|
||||||
|
|
|
||||||
4
etc/scripts/install_xvfb.sh
Normal file
4
etc/scripts/install_xvfb.sh
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
|
||||||
|
sudo apt-get install xvfb --yes > /dev/null 2>&1
|
||||||
|
|
@ -19,4 +19,7 @@ class InvalidInputProvided(Exception): pass
|
||||||
class InvalidTamperProvided(Exception): pass
|
class InvalidTamperProvided(Exception): pass
|
||||||
|
|
||||||
|
|
||||||
class PortScanTimeOutException(Exception): pass
|
class PortScanTimeOutException(Exception): pass
|
||||||
|
|
||||||
|
|
||||||
|
class ZeusArgumentException(Exception): pass
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import sys
|
||||||
from optparse import (
|
from optparse import (
|
||||||
OptionParser,
|
OptionParser,
|
||||||
OptionGroup,
|
OptionGroup,
|
||||||
|
|
@ -6,6 +7,7 @@ from optparse import (
|
||||||
|
|
||||||
import lib.core.settings
|
import lib.core.settings
|
||||||
import lib.core.common
|
import lib.core.common
|
||||||
|
import lib.core.errors
|
||||||
import lib.attacks.nmap_scan.nmap_opts
|
import lib.attacks.nmap_scan.nmap_opts
|
||||||
import lib.attacks.sqlmap_scan.sqlmap_opts
|
import lib.attacks.sqlmap_scan.sqlmap_opts
|
||||||
|
|
||||||
|
|
@ -269,3 +271,25 @@ class ZeusParser(OptionParser):
|
||||||
))
|
))
|
||||||
lib.core.settings.update_zeus()
|
lib.core.settings.update_zeus()
|
||||||
lib.core.common.shutdown()
|
lib.core.common.shutdown()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def verify_args(args=sys.argv):
|
||||||
|
not_implemented_args = (
|
||||||
|
"-T", "--x-threads", "--force-ssl", "--thread",
|
||||||
|
"-g", "--github-search", "-u", "--url"
|
||||||
|
)
|
||||||
|
# check if any of the arguments are not implemented that have been passed
|
||||||
|
# via the command line
|
||||||
|
# TODO:/
|
||||||
|
# need to create a way to parse all arguments for compatibility with one another
|
||||||
|
for arg in args:
|
||||||
|
for nia in not_implemented_args:
|
||||||
|
if arg == nia:
|
||||||
|
raise lib.core.errors.ZeusArgumentException(
|
||||||
|
"\n\nit appears that one of the arguments you have passed ('{}'), "
|
||||||
|
"has not been implemented into Zeus production yet. This usually means "
|
||||||
|
"that the option is still in testing and is not ready for use. Arguments "
|
||||||
|
"that are still in testing are: {}\n".format(
|
||||||
|
nia, ", ".join(["'{}'".format(a) for a in not_implemented_args])
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
@ -44,7 +44,7 @@ CLONE = "https://github.com/ekultek/zeus-scanner.git"
|
||||||
ISSUE_LINK = "https://github.com/ekultek/zeus-scanner/issues"
|
ISSUE_LINK = "https://github.com/ekultek/zeus-scanner/issues"
|
||||||
|
|
||||||
# current version <major.minor.commit.patch ID>
|
# current version <major.minor.commit.patch ID>
|
||||||
VERSION = "1.5".format(PATCH_ID)
|
VERSION = "1.5.2.{}".format(PATCH_ID)
|
||||||
|
|
||||||
# colors to output depending on the version
|
# colors to output depending on the version
|
||||||
VERSION_TYPE_COLORS = {"dev": 33, "stable": 92, "other": 30}
|
VERSION_TYPE_COLORS = {"dev": 33, "stable": 92, "other": 30}
|
||||||
|
|
@ -600,28 +600,34 @@ def search_for_process(name):
|
||||||
return False if not any(name in proc for proc in list(all_process_names)) else True
|
return False if not any(name in proc for proc in list(all_process_names)) else True
|
||||||
|
|
||||||
|
|
||||||
def get_browser_version():
|
def get_browser_version(output=True):
|
||||||
"""
|
"""
|
||||||
obtain the firefox browser version, this is necessary because zeus can only handle certain versions.
|
obtain the firefox browser version, this is necessary because zeus can only handle certain versions.
|
||||||
"""
|
"""
|
||||||
logger.info(set_color(
|
if output:
|
||||||
"attempting to get firefox browser version"
|
logger.info(set_color(
|
||||||
))
|
"attempting to get firefox browser version"
|
||||||
|
))
|
||||||
try:
|
try:
|
||||||
firefox_version_command = shlex.split("firefox --version")
|
firefox_version_command = shlex.split("firefox --version")
|
||||||
output = subprocess.check_output(firefox_version_command)
|
output = subprocess.check_output(firefox_version_command)
|
||||||
except (OSError, Exception):
|
except OSError:
|
||||||
logger.error(set_color(
|
logger.error(set_color(
|
||||||
"failed to run firefox", level=50
|
"failed to run firefox", level=50
|
||||||
))
|
))
|
||||||
return "failed to start"
|
return "failed to start"
|
||||||
try:
|
try:
|
||||||
major, minor = map(int, re.search(r"(\d+).(\d+)", output).groups())
|
major, minor = map(int, re.search(r"(\d+).(\d+)", output).groups())
|
||||||
except (ValueError, Exception):
|
except ValueError:
|
||||||
logger.error(set_color(
|
logger.error(set_color(
|
||||||
"failed to parse '{}' for version number".format(output), level=50
|
"failed to parse '{}' for version number".format(output), level=50
|
||||||
))
|
))
|
||||||
return "failed to gather"
|
return output
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(set_color(
|
||||||
|
"received and exception from firefox '{}'".format(str(e), level=50)
|
||||||
|
))
|
||||||
|
return str(e)
|
||||||
return major, minor
|
return major, minor
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -410,15 +410,15 @@ def parse_search_results(query, url_to_search, verbose=False, **kwargs):
|
||||||
"provided query has a {} success rate".format(success_rate)
|
"provided query has a {} success rate".format(success_rate)
|
||||||
))
|
))
|
||||||
else:
|
else:
|
||||||
logger.fatal(set_color(
|
logger.warning(set_color(
|
||||||
"did not find any URLs with given query '{}' writing query to blacklist".format(query), level=50
|
"did not find any URLs with given query '{}' writing query to blacklist".format(query), level=50
|
||||||
))
|
))
|
||||||
write_to_log_file(query, BLACKLIST_FILE_PATH, BLACKLIST_FILENAME, blacklist=True)
|
write_to_log_file(query, BLACKLIST_FILE_PATH, BLACKLIST_FILENAME, blacklist=True)
|
||||||
shutdown()
|
|
||||||
logger.info(set_color(
|
logger.info(set_color(
|
||||||
"found a total of {} URLs with given query '{}'".format(len(true_retval), query)
|
"found a total of {} URLs with given query '{}'".format(len(true_retval), query)
|
||||||
))
|
))
|
||||||
return list(true_retval) if len(true_retval) != 0 else None
|
|
||||||
|
|
||||||
|
|
||||||
def search_multiple_pages(query, link_amount, verbose=False, **kwargs):
|
def search_multiple_pages(query, link_amount, verbose=False, **kwargs):
|
||||||
|
|
|
||||||
9
zeus.py
9
zeus.py
|
|
@ -15,7 +15,8 @@ from lib.header_check import main_header_check
|
||||||
from lib.core.parse import ZeusParser
|
from lib.core.parse import ZeusParser
|
||||||
from lib.core.errors import (
|
from lib.core.errors import (
|
||||||
InvalidInputProvided,
|
InvalidInputProvided,
|
||||||
InvalidProxyType
|
InvalidProxyType,
|
||||||
|
ZeusArgumentException
|
||||||
)
|
)
|
||||||
from lib.core.common import (
|
from lib.core.common import (
|
||||||
start_up,
|
start_up,
|
||||||
|
|
@ -53,6 +54,10 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
ZeusParser().single_show_args(opt)
|
ZeusParser().single_show_args(opt)
|
||||||
|
|
||||||
|
# verify all the arguments passed before we continue
|
||||||
|
# with the process
|
||||||
|
ZeusParser().verify_args()
|
||||||
|
|
||||||
# run the setup on the program
|
# run the setup on the program
|
||||||
setup(verbose=opt.runInVerbose)
|
setup(verbose=opt.runInVerbose)
|
||||||
|
|
||||||
|
|
@ -378,6 +383,8 @@ if __name__ == "__main__":
|
||||||
"do not interrupt the browser when selenium is running, "
|
"do not interrupt the browser when selenium is running, "
|
||||||
"it will cause Zeus to crash", level=30
|
"it will cause Zeus to crash", level=30
|
||||||
))
|
))
|
||||||
|
except ZeusArgumentException:
|
||||||
|
shutdown()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if "url did not match a true url" in str(e).lower():
|
if "url did not match a true url" in str(e).lower():
|
||||||
logger.error(set_color(
|
logger.error(set_color(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue