mirror of
https://github.com/Ekultek/Zeus-Scanner.git
synced 2026-03-11 08:55:51 +00:00
feat: Python 3 conversion + Geckodriver improvements
This commit is contained in:
parent
536292ff2f
commit
e31ba811f3
23 changed files with 306 additions and 259 deletions
4
.github/CONTRIBUTING.md
vendored
4
.github/CONTRIBUTING.md
vendored
|
|
@ -8,7 +8,7 @@ Bug reports are welcome! Please report all bugs to the [Issue Tracker](https://g
|
|||
|
||||
- Before you create a bug report, make sure that the bug has not already been reported by checking the [open](https://github.com/Ekultek/Zeus-Scanner/issues?q=is%3Aopen+is%3Aissue) and [closed](https://github.com/Ekultek/Zeus-Scanner/issues?q=is%3Aissue+is%3Aclosed) issues.
|
||||
- You can also check if you can answer your own question by looking at the [user manual](https://github.com/Ekultek/Zeus-Scanner/wiki/User-Guide)
|
||||
- Do a `python zeus.py --update` and try to reproduce the bug with the latest version
|
||||
- Do a `python3 zeus.py --update` and try to reproduce the bug with the latest version
|
||||
- You will need to make sure that your report has detailed information, this includes (but not limited to):
|
||||
- The dork you used when you tried you received the error
|
||||
- Your running context (`clone`, `zip`, etc..)
|
||||
|
|
@ -35,4 +35,4 @@ If I consistently see that you are creating clean and great functional pull requ
|
|||
|
||||
# Licensing
|
||||
|
||||
By submitting code contributions to Zeus or via Git pull request, checking them into the Zeus's source code repository, it is understood (unless you specify otherwise) that you are offering the Zeus copyright holders the unlimited, non-exclusive right to reuse, modify, and relicense the code. This is important because the inability to relicense code has caused devastating problems for other software projects (such as KDE and NASM). If you wish to specify special license conditions of your contributions, just say so when you send them.
|
||||
By submitting code contributions to Zeus or via Git pull request, checking them into the Zeus's source code repository, it is understood (unless you specify otherwise) that you are offering the Zeus copyright holders the unlimited, non-exclusive right to reuse, modify, and relicense the code. This is important because the inability to relicense code has caused devastating problems for other software projects (such as KDE and NASM). If you wish to specify special license conditions of your contributions, just say so when you send them.
|
||||
|
|
|
|||
30
.github/translations/README-french.md
vendored
30
.github/translations/README-french.md
vendored
|
|
@ -1,6 +1,6 @@
|
|||
[](https://github.com/ekultek/zeus-scanner/stargazers)
|
||||
[](https://github.com/ekultek/zeus-scanner/network)
|
||||
[](https://github.com/ekultek/zeus-scanner/issues)
|
||||
[](https://github.com/ekultek/zeus-scanner/network)
|
||||
[](https://github.com/ekultek/zeus-scanner/issues)
|
||||
[](https://raw.githubusercontent.com/Ekultek/Zeus-Scanner/master/.github/LICENSE.md)
|
||||
[](https://twitter.com/Zeus_Scanner)
|
||||
[](https://github.com/Ekultek/Zeus-Scanner#donations)
|
||||
|
|
@ -105,20 +105,32 @@ Vous pouvez télécharger le dernière [tar.gz](https://github.com/ekultek/zeus-
|
|||
|
||||
##### Ubuntu/Debian
|
||||
|
||||
```shell
|
||||
sudo apt install libxml2-dev libxslt1-dev python-dev firefox && \
|
||||
git clone https://github.com/ekultek/zeus-scanner.git && \
|
||||
cd zeus-scanner && \
|
||||
sudo pip3 install -r requirements.txt && \
|
||||
sudo python3 zeus.py
|
||||
```
|
||||
sudo apt-get install libxml2-dev libxslt1-dev python-dev && git clone https://github.com/ekultek/zeus-scanner.git && cd zeus-scanner && sudo pip2 install -r requirements.txt && sudo python zeus.py
|
||||
```
|
||||
|
||||
|
||||
##### centOS
|
||||
|
||||
```
|
||||
sudo apt-get install gcc python-devel libxml2-dev libxslt1-dev python-dev && git clone https://github.com/ekultek/zeus-scanner.git && cd zeus-scanner && sudo pip2 install -r requirements.txt && sudo python zeus.py
|
||||
```shell
|
||||
sudo yum install gcc libxml2-dev libxslt1-dev python-devel firefox && \
|
||||
git clone https://github.com/ekultek/zeus-scanner.git && \
|
||||
cd zeus-scanner && \
|
||||
sudo pip3 install -r requirements.txt && \
|
||||
sudo python3 zeus.py
|
||||
```
|
||||
|
||||
##### Others
|
||||
|
||||
```
|
||||
sudo apt-get install libxml2-dev libxslt1-dev python-dev && git clone https://github.com/ekultek/zeus-scanner.git && cd zeus-scanner && sudo pip2 install -r requirements.txt && sudo python zeus.py
|
||||
```shell
|
||||
sudo apt install libxml2-dev libxslt1-dev python-dev firefox && \
|
||||
git clone https://github.com/ekultek/zeus-scanner.git && \
|
||||
cd zeus-scanner && \
|
||||
sudo pip3 install -r requirements.txt && \
|
||||
sudo python3 zeus.py
|
||||
```
|
||||
|
||||
Celainstallera tous les Packa exigences ge ainsi que les geckodriver
|
||||
|
|
|
|||
29
.github/translations/README-russian.md
vendored
29
.github/translations/README-russian.md
vendored
|
|
@ -1,6 +1,6 @@
|
|||
[](https://github.com/ekultek/zeus-scanner/stargazers)
|
||||
[](https://github.com/ekultek/zeus-scanner/network)
|
||||
[](https://github.com/ekultek/zeus-scanner/issues)
|
||||
[](https://github.com/ekultek/zeus-scanner/network)
|
||||
[](https://github.com/ekultek/zeus-scanner/issues)
|
||||
[](https://raw.githubusercontent.com/Ekultek/Zeus-Scanner/master/.github/LICENSE.md)
|
||||
[](https://twitter.com/Zeus_Scanner)
|
||||
[](https://github.com/Ekultek/Zeus-Scanner#donations)
|
||||
|
|
@ -105,20 +105,31 @@
|
|||
|
||||
##### Ubuntu/Debian
|
||||
|
||||
```shell
|
||||
sudo apt install libxml2-dev libxslt1-dev python-dev firefox && \
|
||||
git clone https://github.com/ekultek/zeus-scanner.git && \
|
||||
cd zeus-scanner && \
|
||||
sudo pip3 install -r requirements.txt && \
|
||||
sudo python3 zeus.py
|
||||
```
|
||||
sudo apt-get install libxml2-dev libxslt1-dev python-dev && git clone https://github.com/ekultek/zeus-scanner.git && cd zeus-scanner && sudo pip2 install -r requirements.txt && sudo python zeus.py
|
||||
```
|
||||
|
||||
##### centOS
|
||||
|
||||
```
|
||||
sudo apt-get install gcc python-devel libxml2-dev libxslt1-dev python-dev && git clone https://github.com/ekultek/zeus-scanner.git && cd zeus-scanner && sudo pip2 install -r requirements.txt && sudo python zeus.py
|
||||
```shell
|
||||
sudo yum install gcc libxml2-dev libxslt1-dev python-devel firefox && \
|
||||
git clone https://github.com/ekultek/zeus-scanner.git && \
|
||||
cd zeus-scanner && \
|
||||
sudo pip3 install -r requirements.txt && \
|
||||
sudo python3 zeus.py
|
||||
```
|
||||
|
||||
##### Others
|
||||
|
||||
```
|
||||
sudo apt-get install libxml2-dev libxslt1-dev python-dev && git clone https://github.com/ekultek/zeus-scanner.git && cd zeus-scanner && sudo pip2 install -r requirements.txt && sudo python zeus.py
|
||||
```shell
|
||||
sudo apt install libxml2-dev libxslt1-dev python-dev firefox && \
|
||||
git clone https://github.com/ekultek/zeus-scanner.git && \
|
||||
cd zeus-scanner && \
|
||||
sudo pip3 install -r requirements.txt && \
|
||||
sudo python3 zeus.py
|
||||
```
|
||||
|
||||
Этоустановит всеM. Требования GE вместе с geckodriver
|
||||
|
|
|
|||
40
.github/translations/README-spanish.md
vendored
40
.github/translations/README-spanish.md
vendored
|
|
@ -1,6 +1,6 @@
|
|||
[](https://github.com/ekultek/zeus-scanner/stargazers)
|
||||
[](https://github.com/ekultek/zeus-scanner/network)
|
||||
[](https://github.com/ekultek/zeus-scanner/issues)
|
||||
[](https://github.com/ekultek/zeus-scanner/network)
|
||||
[](https://github.com/ekultek/zeus-scanner/issues)
|
||||
[](https://raw.githubusercontent.com/Ekultek/Zeus-Scanner/master/.github/LICENSE.md)
|
||||
[](https://twitter.com/Zeus_Scanner)
|
||||
[](https://github.com/Ekultek/Zeus-Scanner#donations)
|
||||
|
|
@ -61,7 +61,7 @@ Si ejecuta sin opciones obligatorias o si ejecuta el indicador `--help`, se most
|
|||
! [zeus-help](https://user-images.githubusercontent.com/14183473/30176257-63391c62-93c7-11e7-94d7-68fde7818381.png)
|
||||
Un escaneo de dork básico con la bandera `-d`, del dork dado lanzará un navegador automatizado y extraerá los resultados de la página de Google:
|
||||
! [zeus-dork-scan](https://user-images.githubusercontent.com/14183473/30176252-618b191a-93c7-11e7-84d2-572c12994c4d.png)
|
||||
Llamar al indicador `-s` le pedirá que inicie el servidor de la API sqlmap` python sqlmapapi.py -s` desde sqlmap, luego se conectará a la API y realizará un análisis de sqlmap en la URL encontrada.
|
||||
Llamar al indicador `-s` le pedirá que inicie el servidor de la API sqlmap` python3 sqlmapapi.py -s` desde sqlmap, luego se conectará a la API y realizará un análisis de sqlmap en la URL encontrada.
|
||||
! [zeus-sqlmap-api](https://user-images.githubusercontent.com/14183473/30176259-6657b304-93c7-11e7-81f8-0ed09a6c0268.png)
|
||||
|
||||
Puede ver más capturas de pantalla [aquí](https://github.com/Ekultek/Zeus-Scanner/wiki/Screenshots)
|
||||
|
|
@ -84,7 +84,7 @@ Hay algunos requisitos para que esto se ejecute con éxito.
|
|||
- [Geckodriver](https://github.com/mozilla/geckodriver) es necesario para ejecutar el navegador web firefox y se instalará la primera vez que ejecute. Se agregará a su `/ usr / bin` para que pueda ejecutarse en su ENV PATH.
|
||||
- Debe ser `sudo` por primera vez ejecutando esto para que pueda agregar el controlador a su RUTA, también puede necesitar ejecutar como` sudo` dependiendo de sus permisos. _NOTA: _`Dependiendo de los permisos, puede que necesite sudo para cualquier ejecución que involucre al geckodriver`
|
||||
- `xvfb` es requerido por` pyvirtualdisplay`, se instalará si no está instalado en su primera ejecución
|
||||
|
||||
|
||||
##### Requisitos del paquete de Python
|
||||
|
||||
- Se requiere el paquete [selenium-webdriver](http://www.seleniumhq.org/projects/webdriver/) para automatizar el navegador web y eludir las llamadas API.
|
||||
|
|
@ -95,7 +95,7 @@ Hay algunos requisitos para que esto se ejecute con éxito.
|
|||
- [lxml](https://lxml.readthedocs.io/en/latest/) es necesario para analizar los datos XML del mapa del sitio y guardarlo como tal
|
||||
- [psutil](https://github.com/giampaolo/psutil) es necesario para buscar ejecutar sesiones API de sqlmap
|
||||
- [beautifulsoup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/) es necesario para extraer todas las etiquetas de descriptor HREF y analizar el HTML en una sintaxis fácil de usar
|
||||
|
||||
|
||||
### Instalación
|
||||
|
||||
Puede descargar la última [tar.gz](https://github.com/ekultek/zeus-scanner/tarball/master), la última [zip](https://github.com/ekultek/zeus-scanner/zipball/master), o puede encontrar la versión estable actual [aquí](https://github.com/Ekultek/Zeus-Scanner/releases). Alternativamente, puede instalar la última versión de desarrollo siguiendo las instrucciones que mejor se adapten a su sistema operativo:
|
||||
|
|
@ -104,20 +104,32 @@ Puede descargar la última [tar.gz](https://github.com/ekultek/zeus-scanner/tarb
|
|||
|
||||
##### Ubuntu / Debian
|
||||
|
||||
```shell
|
||||
sudo apt install libxml2-dev libxslt1-dev python-dev firefox && \
|
||||
git clone https://github.com/ekultek/zeus-scanner.git && \
|
||||
cd zeus-scanner && \
|
||||
sudo pip3 install -r requirements.txt && \
|
||||
sudo python3 zeus.py
|
||||
```
|
||||
sudo apt-get install libxml2-dev libxslt1-dev python-dev && git clon https://github.com/ekultek/zeus-scanner.git y& cd zeus-scanner && sudo pip2 install -r requirements.txt && sudo python zeus .py
|
||||
```
|
||||
|
||||
|
||||
##### centOS
|
||||
|
||||
```
|
||||
sudo apt-get install gcc python-devel libxml2-dev libxslt1-dev python-dev && git clon https://github.com/ekultek/zeus-scanner.git y& cd zeus-scanner && sudo pip2 install -r requirements.txt && sudo python zeus.py
|
||||
```shell
|
||||
sudo yum install gcc libxml2-dev libxslt1-dev python-devel firefox && \
|
||||
git clone https://github.com/ekultek/zeus-scanner.git && \
|
||||
cd zeus-scanner && \
|
||||
sudo pip3 install -r requirements.txt && \
|
||||
sudo python3 zeus.py
|
||||
```
|
||||
|
||||
##### Otros
|
||||
|
||||
```
|
||||
sudo apt-get install libxml2-dev libxslt1-dev python-dev && git clon https://github.com/ekultek/zeus-scanner.git y& cd zeus-scanner && sudo pip2 install -r requirements.txt && sudo python zeus .py
|
||||
```shell
|
||||
sudo apt install libxml2-dev libxslt1-dev python-dev firefox && \
|
||||
git clone https://github.com/ekultek/zeus-scanner.git && \
|
||||
cd zeus-scanner && \
|
||||
sudo pip3 install -r requirements.txt && \
|
||||
sudo python3 zeus.py
|
||||
```
|
||||
|
||||
Esto instalará todos los requisitos del paquete junto con el geckodriver
|
||||
|
|
@ -129,11 +141,11 @@ Zeus es creado por un pequeño equipo de desarrolladores que aspiran a la seguri
|
|||
- Bitcoin (BTC): `3DAQGcAQ194NGVs16Mmv75ip45CVuE8cZy`
|
||||
- [PayPal](https://www.paypal.me/ZeusScanner)
|
||||
- O puedes [Cómpranos un café](https://ko-fi.com/A28355P5)
|
||||
|
||||
|
||||
Puede estar seguro de que todas las donaciones se destinarán a la financiación de Zeus para que sea más confiable e incluso mejor, gracias del equipo de desarrollo de Zeus.
|
||||
|
||||
### Shoutsouts
|
||||
|
||||
##### [Proyectos de OpenSource](https://www.facebook.com/opensourceprojects/)
|
||||
|
||||
OpenSource Projects es una página de la comunidad de Facebook cuyo objetivo es brindar a los desarrolladores, nuevos y antiguos, un lugar fácil y simple para compartir sus contribuciones y proyectos de código abierto. Personalmente creo que esta es una idea increíble, sé lo difícil que es hacer que la gente note su código y apoyar a estos tipos al 100%. Continúa y dales un me gusta [aquí](https://www.facebook.com/opensourceprojects/). Compartirán cualquier proyecto de código abierto que les envíe de forma gratuita. ¡Gracias OpenSource Projects por darles a los desarrolladores un lugar para compartir el trabajo entre ellos!
|
||||
OpenSource Projects es una página de la comunidad de Facebook cuyo objetivo es brindar a los desarrolladores, nuevos y antiguos, un lugar fácil y simple para compartir sus contribuciones y proyectos de código abierto. Personalmente creo que esta es una idea increíble, sé lo difícil que es hacer que la gente note su código y apoyar a estos tipos al 100%. Continúa y dales un me gusta [aquí](https://www.facebook.com/opensourceprojects/). Compartirán cualquier proyecto de código abierto que les envíe de forma gratuita. ¡Gracias OpenSource Projects por darles a los desarrolladores un lugar para compartir el trabajo entre ellos!
|
||||
|
|
|
|||
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -3,6 +3,7 @@ log/
|
|||
geckodriver.log
|
||||
*.pyc
|
||||
.idea/
|
||||
bin/drivers
|
||||
bin/executed.txt
|
||||
bin/paths
|
||||
bin/version_info
|
||||
|
|
@ -19,4 +20,4 @@ lib/core/__pycache__/
|
|||
var/__pycache__/
|
||||
var/auto_issue/__pycache__/
|
||||
var/blackwidow/__pycache__/
|
||||
var/search/__pycache__/
|
||||
var/search/__pycache__/
|
||||
|
|
|
|||
35
README.md
35
README.md
|
|
@ -71,7 +71,7 @@ A basic dork scan with the `-d` flag, from the given dork will launch an automat
|
|||
|
||||

|
||||
|
||||
Calling the `-s` flag will prompt for you to start the sqlmap API server `python sqlmapapi.py -s` from sqlmap, it will then connect to the API and perform a sqlmap scan on the found URLs:
|
||||
Calling the `-s` flag will prompt for you to start the sqlmap API server `python3 sqlmapapi.py -s` from sqlmap, it will then connect to the API and perform a sqlmap scan on the found URLs:
|
||||
|
||||

|
||||
|
||||
|
|
@ -90,11 +90,12 @@ There are some requirements for this to be run successfully.
|
|||
|
||||
- `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 `<=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 URLs, 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.
|
||||
- [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.
|
||||
- You must be `sudo` for the first time running this so that you can add the driver to your PATH, you also may need to run as `sudo` depending on your permissions. _NOTE:_ `Depending on permissions you may need to be sudo for any run involving the geckodriver`
|
||||
- [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.
|
||||
- You must be `sudo` to run this program with the required permissions
|
||||
- `xvfb` is required by `pyvirtualdisplay`, it will be installed if not installed on your first run
|
||||
- Python 3 or higher is required to run this program
|
||||
|
||||
##### Python package requirements
|
||||
|
||||
|
|
@ -116,13 +117,21 @@ You can download the latest [tar.gz](https://github.com/ekultek/zeus-scanner/tar
|
|||
##### Ubuntu/Debian
|
||||
|
||||
```shell
|
||||
sudo apt-get install libxml2-dev libxslt1-dev python-dev && git clone https://github.com/ekultek/zeus-scanner.git && cd zeus-scanner && sudo pip2 install -r requirements.txt && sudo python zeus.py
|
||||
sudo apt install libxml2-dev libxslt1-dev python-dev firefox && \
|
||||
git clone https://github.com/ekultek/zeus-scanner.git && \
|
||||
cd zeus-scanner && \
|
||||
sudo pip3 install -r requirements.txt && \
|
||||
sudo python3 zeus.py
|
||||
```
|
||||
|
||||
##### centOS
|
||||
|
||||
```shell
|
||||
sudo apt-get install gcc python-devel libxml2-dev libxslt1-dev python-dev && git clone https://github.com/ekultek/zeus-scanner.git && cd zeus-scanner && sudo pip2 install -r requirements.txt && sudo python zeus.py
|
||||
sudo yum install gcc libxml2-dev libxslt1-dev python-devel firefox && \
|
||||
git clone https://github.com/ekultek/zeus-scanner.git && \
|
||||
cd zeus-scanner && \
|
||||
sudo pip3 install -r requirements.txt && \
|
||||
sudo python3 zeus.py
|
||||
```
|
||||
|
||||
#### Backbox
|
||||
|
|
@ -138,7 +147,7 @@ rm -rf /opt/firefox*
|
|||
mv firefox /opt/firefox57
|
||||
mv /usr/bin/firefox /usr/bin/firefoxold
|
||||
ln -s /opt/firefox57/firefox-bin /usr/bin/firefox
|
||||
apt-get install libxml2-dev libxslt1-dev python-dev && git clone https://github.com/ekultek/zeus-scanner.git && cd zeus-scanner && pip2 install -r requirements.txt && python zeus.py
|
||||
apt install libxml2-dev libxslt1-dev python-dev && git clone https://github.com/ekultek/zeus-scanner.git && cd zeus-scanner && pip3 install -r requirements.txt && python3 zeus.py
|
||||
EOF
|
||||
```
|
||||
|
||||
|
|
@ -153,17 +162,21 @@ rm -rf /opt/firefox*
|
|||
mv firefox /opt/firefox57
|
||||
mv /usr/bin/firefox /usr/bin/firefoxold
|
||||
ln -s /opt/firefox57/firefox-bin /usr/bin/firefox
|
||||
apt-get install libxml2-dev libxslt1-dev python-dev && git clone https://github.com/ekultek/zeus-scanner.git && cd zeus-scanner && pip2 install -r requirements.txt && python zeus.py
|
||||
apt install libxml2-dev libxslt1-dev python-dev && git clone https://github.com/ekultek/zeus-scanner.git && cd zeus-scanner && pip3 install -r requirements.txt && python3 zeus.py
|
||||
EOF
|
||||
```
|
||||
|
||||
##### Others
|
||||
|
||||
```shell
|
||||
sudo apt-get install libxml2-dev libxslt1-dev python-dev && git clone https://github.com/ekultek/zeus-scanner.git && cd zeus-scanner && sudo pip2 install -r requirements.txt && sudo python zeus.py
|
||||
sudo apt install libxml2-dev libxslt1-dev python-dev firefox && \
|
||||
git clone https://github.com/ekultek/zeus-scanner.git && \
|
||||
cd zeus-scanner && \
|
||||
sudo pip3 install -r requirements.txt && \
|
||||
sudo python3 zeus.py
|
||||
```
|
||||
|
||||
This will install all the package requirements along with the geckodriver
|
||||
This will install all the package requirements along with the geckodriver.
|
||||
|
||||
|
||||
### Donations
|
||||
|
|
@ -174,7 +187,7 @@ Zeus is created by a small team of developers that have an aspiration for inform
|
|||
- [PayPal](https://www.paypal.me/ZeusScanner)
|
||||
- Or you can [Buy us a coffee](https://ko-fi.com/A28355P5)
|
||||
|
||||
You can be assured that all donations will go towards Zeus funding to make it more reliable and even better, thank you from the Zeus development team
|
||||
You can be assured that all donations will go towards Zeus funding to make it more reliable and even better, thank you from the Zeus development team.
|
||||
|
||||
### Shoutouts
|
||||
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,16 +1,13 @@
|
|||
import os
|
||||
import sys
|
||||
import requests
|
||||
import time
|
||||
import shlex
|
||||
import platform
|
||||
import threading
|
||||
import subprocess
|
||||
import tarfile
|
||||
try:
|
||||
import ConfigParser # python 2
|
||||
except ImportError:
|
||||
import configparser as ConfigParser # python 3
|
||||
|
||||
import configparser as ConfigParser
|
||||
import whichcraft
|
||||
|
||||
import lib.core.common
|
||||
|
|
@ -39,21 +36,22 @@ def animation(text):
|
|||
|
||||
|
||||
def disclaimer():
|
||||
question = raw_input(
|
||||
print(
|
||||
"\033[91mAttacking targets without consent is not only illegal, but it "
|
||||
"is unethical and frowned upon in most countries. By installing this "
|
||||
"program you are agreeing that you are responsible for your own actions, "
|
||||
"you are over the age of 18 or legally considered an adult in your "
|
||||
"place of origin, and that you will obey all laws, regulations, and "
|
||||
"rules set forth by your place of origin. You will only see this disclaimer "
|
||||
"once. If you agree to the conditions type 'yes'...\033[0m"
|
||||
"once. If you agree to the conditions, type 'yes'...\033[0m"
|
||||
)
|
||||
question = input("")
|
||||
if question.upper() == "YES":
|
||||
return True
|
||||
else:
|
||||
lib.core.settings.logger.fatal(lib.core.settings.set_color(
|
||||
"you have not agreed with the terms of service, so "
|
||||
"Zeus will shut down now", level=50
|
||||
"You have not agreed with the terms of service, so "
|
||||
"Zeus will now shut down.", level=50
|
||||
))
|
||||
return False
|
||||
|
||||
|
|
@ -61,13 +59,25 @@ def disclaimer():
|
|||
def parse_hosts(filepath="/etc/hosts"):
|
||||
to_append = "127.0.0.1\tlocalhost"
|
||||
appened = False
|
||||
with open(filepath, "a+") as etc:
|
||||
for line in etc:
|
||||
if line.strip() == to_append:
|
||||
appened = True
|
||||
if not appened:
|
||||
etc.seek(0)
|
||||
etc.write(to_append + "\n")
|
||||
|
||||
try:
|
||||
with open(filepath, "a+") as etc:
|
||||
for line in etc:
|
||||
if line.strip() == to_append:
|
||||
appened = True
|
||||
if not appened:
|
||||
etc.seek(0)
|
||||
etc.write(to_append + "\n")
|
||||
except Exception as e:
|
||||
if "[Errno 13] Permission denied: '/etc/hosts'" in str(e):
|
||||
lib.core.settings.logger.exception(lib.core.settings.set_color(
|
||||
"First run must be as root ('sudo python3 zeus.py')!", level=50
|
||||
))
|
||||
else:
|
||||
lib.core.settings.logger.exception(lib.core.settings.set_color(
|
||||
"Ran into exception '{}', logged to current log file".format(e), level=50
|
||||
))
|
||||
exit(-1)
|
||||
|
||||
|
||||
def find_tools(to_search=("sqlmap", "nmap"), directory="{}/bin/paths", filename="path_config.ini"):
|
||||
|
|
@ -87,15 +97,15 @@ def find_tools(to_search=("sqlmap", "nmap"), directory="{}/bin/paths", filename=
|
|||
path_schema[item] = path_obj
|
||||
else:
|
||||
path_schema[item] = None
|
||||
for key, value in path_schema.iteritems():
|
||||
for key, value in path_schema.items():
|
||||
if value is None:
|
||||
stop_animation = True
|
||||
print("\n")
|
||||
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)
|
||||
)
|
||||
path_schema[key] = provided_path
|
||||
for program, path in path_schema.iteritems():
|
||||
for program, path in path_schema.items():
|
||||
parser.add_section(program)
|
||||
parser.set(program, "path", path)
|
||||
parser.write(cfgfile)
|
||||
|
|
@ -104,33 +114,43 @@ def find_tools(to_search=("sqlmap", "nmap"), directory="{}/bin/paths", filename=
|
|||
|
||||
def config_gecko_version(browser_version):
|
||||
"""
|
||||
figure out which gecko version you need
|
||||
Figure out which gecko version is needed
|
||||
"""
|
||||
|
||||
# Mapping of minimum Firefox version required for each geckodriver version;
|
||||
# https://firefox-source-docs.mozilla.org/testing/geckodriver/Support.html
|
||||
version_specs = {
|
||||
(57, 58): 19,
|
||||
(56, 55, 54): 18,
|
||||
(53, 52): 17
|
||||
(102): 32.2,
|
||||
(91): 31.0,
|
||||
(78, 90): 30.0,
|
||||
(60, 90): 29.1,
|
||||
(57, 90): 25.0,
|
||||
(55, 62): 20.0,
|
||||
(53, 62): 18.0,
|
||||
(52, 62): 17.0
|
||||
}
|
||||
if isinstance(browser_version, (tuple, list, set)):
|
||||
major = browser_version[0]
|
||||
for key in version_specs.keys():
|
||||
for num in key:
|
||||
if num == major:
|
||||
return version_specs[key]
|
||||
else:
|
||||
if "." in browser_version:
|
||||
major = browser_version.split(".")[0]
|
||||
else:
|
||||
major = browser_version
|
||||
for key in version_specs.keys():
|
||||
for num in key:
|
||||
|
||||
for key in version_specs.keys():
|
||||
max = key[-1] if type(key) is not int and len(key) > 1 else None
|
||||
if max:
|
||||
for num in range(key[0], max + 1):
|
||||
if num == int(major):
|
||||
return version_specs[key]
|
||||
else:
|
||||
if int(major) >= key:
|
||||
return version_specs[key]
|
||||
|
||||
|
||||
def check_os(current=platform.platform()):
|
||||
"""
|
||||
check the users operating system..
|
||||
Check the user's operating system
|
||||
"""
|
||||
if "linux" in str(current).lower():
|
||||
return True
|
||||
|
|
@ -139,7 +159,7 @@ def check_os(current=platform.platform()):
|
|||
|
||||
def check_xvfb(exc="Xvfb"):
|
||||
"""
|
||||
test for xvfb on the users system
|
||||
Test for 'xvfb' on the user's system
|
||||
"""
|
||||
global xvfb_path
|
||||
global stop_animation
|
||||
|
|
@ -154,7 +174,7 @@ def check_xvfb(exc="Xvfb"):
|
|||
|
||||
def check_if_run(file_check="{}/bin/executed.txt"):
|
||||
"""
|
||||
check if the application has been run before by reading the executed.txt file
|
||||
Check if the application has been run before by reading the executed.txt file
|
||||
"""
|
||||
if os.path.isfile(file_check.format(os.getcwd())):
|
||||
with open(file_check.format(os.getcwd())) as exc:
|
||||
|
|
@ -167,9 +187,9 @@ def check_if_run(file_check="{}/bin/executed.txt"):
|
|||
return True
|
||||
|
||||
|
||||
def untar_gecko(filename="{}/bin/drivers/geckodriver-v0.{}.0-linux{}.tar.gz"):
|
||||
def untar_gecko(filelink="https://github.com/mozilla/geckodriver/releases/download/v0.{}/geckodriver-v0.{}-linux{}.tar.gz"):
|
||||
"""
|
||||
untar the correct gecko driver for your computer architecture
|
||||
Untar the correct gecko driver for your computer architecture
|
||||
"""
|
||||
global stop_animation
|
||||
|
||||
|
|
@ -179,19 +199,36 @@ def untar_gecko(filename="{}/bin/drivers/geckodriver-v0.{}.0-linux{}.tar.gz"):
|
|||
if isinstance(ff_version, str) or ff_version is None:
|
||||
stop_animation = True
|
||||
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 (can be found with 'firefox --version'):"
|
||||
)
|
||||
gecko_version = config_gecko_version(ff_version)
|
||||
if gecko_version is None:
|
||||
stop_animation = True
|
||||
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
|
||||
))
|
||||
lib.core.common.shutdown()
|
||||
gecko_full_filename = filename.format(os.getcwd(), gecko_version, file_arch)
|
||||
|
||||
gecko_full_filelink = filelink.format(gecko_version, gecko_version, file_arch)
|
||||
with open(lib.core.settings.GECKO_VERSION_INFO_PATH, "a+") as log:
|
||||
log.write(gecko_full_filename.split("/")[-1])
|
||||
tar = tarfile.open(filename.format(os.getcwd(), gecko_version, file_arch), "r:gz")
|
||||
log.write(gecko_full_filelink.split("/")[-1])
|
||||
|
||||
target_file = os.path.join(os.getcwd() + "/bin/drivers", gecko_full_filelink.split("/")[-1])
|
||||
if not os.path.exists("bin/drivers"):
|
||||
os.makedirs("bin/drivers")
|
||||
elif not os.path.isfile(target_file) or os.stat(target_file).st_size == 0:
|
||||
# Download the file if it hasn't been downloaded yet or if it's empty
|
||||
response = requests.get(gecko_full_filelink, stream=True)
|
||||
if response.status_code == 200:
|
||||
with open(target_file, "wb") as f:
|
||||
f.write(response.raw.read())
|
||||
else:
|
||||
lib.core.settings.logger.fatal(lib.core.settings.set_color(
|
||||
"Failed to download geckodriver, please try again later!", level=50
|
||||
))
|
||||
lib.core.common.shutdown()
|
||||
|
||||
tar = tarfile.open(target_file, "r:gz")
|
||||
try:
|
||||
tar.extractall("/usr/bin")
|
||||
except IOError as e:
|
||||
|
|
@ -201,11 +238,11 @@ def untar_gecko(filename="{}/bin/drivers/geckodriver-v0.{}.0-linux{}.tar.gz"):
|
|||
except Exception as e:
|
||||
if "[Errno 13] Permission denied: '/usr/bin/geckodriver'" in str(e):
|
||||
lib.core.settings.logger.exception(lib.core.settings.set_color(
|
||||
"first run must be ran as root (sudo python zeus.py)", level=50
|
||||
"First run must be as root ('sudo python3 zeus.py')!", level=50
|
||||
))
|
||||
else:
|
||||
lib.core.settings.logger.exception(lib.core.settings.set_color(
|
||||
"ran into exception '{}', logged to current log file".format(e), level=50
|
||||
"Ran into exception '{}', logged to current log file".format(e), level=50
|
||||
))
|
||||
exit(-1)
|
||||
tar.close()
|
||||
|
|
@ -213,11 +250,11 @@ def untar_gecko(filename="{}/bin/drivers/geckodriver-v0.{}.0-linux{}.tar.gz"):
|
|||
|
||||
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 not whichcraft.which(item):
|
||||
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. "
|
||||
"please untar the correct geckodriver (if not already done) and move "
|
||||
"it to /usr/bin.".format(item), level=50
|
||||
))
|
||||
|
|
@ -232,15 +269,15 @@ def main(rewrite="{}/bin/executed.txt", verbose=False):
|
|||
"""
|
||||
if not check_os():
|
||||
raise NotImplementedError(lib.core.settings.set_color(
|
||||
"as of now, Zeus requires Linux to run successfully "
|
||||
"your current operating system '{}' is not implemented "
|
||||
"As of now, Zeus requires Linux to run successfully. "
|
||||
"Your current operating system '{}' is not implemented "
|
||||
"yet".format(platform.platform()), level=50
|
||||
))
|
||||
if check_if_run():
|
||||
if not disclaimer():
|
||||
exit(1)
|
||||
t = threading.Thread(target=animation, args=(
|
||||
"seems this is your first time running the application, doing setup please wait..",))
|
||||
"seems this is your first time running the application! Performing setup, please wait...",))
|
||||
t.daemon = True
|
||||
t.start()
|
||||
find_tools()
|
||||
|
|
@ -251,7 +288,7 @@ def main(rewrite="{}/bin/executed.txt", verbose=False):
|
|||
with open(rewrite.format(os.getcwd()), "w") as rw:
|
||||
rw.write("TRUE")
|
||||
lib.core.settings.logger.info(lib.core.settings.set_color(
|
||||
"done, continuing process"
|
||||
"Done, continuing process..."
|
||||
))
|
||||
else:
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
USR_PATH=$2
|
||||
|
||||
python "$USR_PATH/sqlmapapi.py" -s
|
||||
python3 "$USR_PATH/sqlmapapi.py" -s
|
||||
|
|
|
|||
|
|
@ -1,11 +1,6 @@
|
|||
import os
|
||||
import threading
|
||||
|
||||
try: # Python 2
|
||||
from urllib.request import urlopen
|
||||
from urllib.error import HTTPError
|
||||
except ImportError: # Python 3
|
||||
from urllib2 import urlopen, HTTPError
|
||||
from urllib2 import urlopen, HTTPError
|
||||
|
||||
from requests.exceptions import (
|
||||
ConnectionError,
|
||||
|
|
@ -253,4 +248,4 @@ def main(url, show=False, verbose=False, **kwargs):
|
|||
check_for_admin_page(url, extensions, show_possibles=show, verbose=verbose)
|
||||
except KeyboardInterrupt:
|
||||
if not lib.core.common.pause():
|
||||
lib.core.common.shutdown()
|
||||
lib.core.common.shutdown()
|
||||
|
|
|
|||
|
|
@ -2,12 +2,7 @@ import json
|
|||
import re
|
||||
import subprocess
|
||||
import shlex
|
||||
|
||||
try:
|
||||
import urllib2 # python 2
|
||||
except ImportError:
|
||||
import urllib as urllib2 # python 3
|
||||
|
||||
import urllib as urllib2
|
||||
import requests
|
||||
|
||||
import lib.core.common
|
||||
|
|
@ -235,7 +230,7 @@ def sqlmap_scan_main(url, port=None, verbose=None, opts=None, auto_start=False):
|
|||
lib.core.settings.logger.error(lib.core.settings.set_color(
|
||||
"sqlmap API is not started, did you forget to start it? "
|
||||
"You will need to open a new terminal, cd into sqlmap, and "
|
||||
"run `python sqlmapapi.py -s` otherwise pass the correct flags "
|
||||
"run `python3 sqlmapapi.py -s` otherwise pass the correct flags "
|
||||
"to auto start the API", level=40
|
||||
))
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -2,11 +2,7 @@ import os
|
|||
import re
|
||||
import tempfile
|
||||
import importlib
|
||||
try:
|
||||
import urlparse # python 2
|
||||
except ImportError:
|
||||
import urllib.parse as urlparse # python 3
|
||||
|
||||
import urllib.parse as urlparse
|
||||
import requests
|
||||
|
||||
import lib.core.common
|
||||
|
|
@ -263,4 +259,4 @@ def main_xss(start_url, proxy=None, agent=None, **kwargs):
|
|||
os.remove(filename)
|
||||
except KeyboardInterrupt:
|
||||
if not lib.core.common.pause():
|
||||
lib.core.common.shutdown()
|
||||
lib.core.common.shutdown()
|
||||
|
|
|
|||
|
|
@ -4,15 +4,7 @@ import json
|
|||
import time
|
||||
import shlex
|
||||
import subprocess
|
||||
try:
|
||||
from urllib import ( # python 2
|
||||
unquote
|
||||
)
|
||||
except ImportError:
|
||||
from urllib.parse import ( # python 3
|
||||
unquote
|
||||
)
|
||||
|
||||
from urllib.parse import (unquote)
|
||||
import requests
|
||||
from lxml import etree
|
||||
|
||||
|
|
@ -211,7 +203,7 @@ def prompt(question, opts=None, default=None, paused=False):
|
|||
"""
|
||||
if opts is not None and default is None:
|
||||
options = '/'.join(opts)
|
||||
return raw_input(
|
||||
return input(
|
||||
"[{} {}] {}[{}]: ".format(
|
||||
time.strftime("%H:%M:%S"),
|
||||
"PROMPT", question, options
|
||||
|
|
@ -237,7 +229,7 @@ def prompt(question, opts=None, default=None, paused=False):
|
|||
return default
|
||||
elif opts is None and default is None and paused:
|
||||
opts = "[(s)kip (e)xit]"
|
||||
question_ = raw_input(
|
||||
question_ = input(
|
||||
"[{} {}] {} {}: ".format(
|
||||
time.strftime("%H:%M:%S"), "PROMPT", question, opts
|
||||
)
|
||||
|
|
@ -246,7 +238,7 @@ def prompt(question, opts=None, default=None, paused=False):
|
|||
return True
|
||||
return False
|
||||
else:
|
||||
return raw_input(
|
||||
return input(
|
||||
"[{} {}] {} ".format(
|
||||
time.strftime("%H:%M:%S"), "PROMPT", question
|
||||
)
|
||||
|
|
|
|||
|
|
@ -13,10 +13,7 @@ import socket
|
|||
import struct
|
||||
import platform
|
||||
import subprocess
|
||||
try:
|
||||
import ConfigParser # python 2
|
||||
except ImportError:
|
||||
import configparser as ConfigParser # python 3
|
||||
import configparser as ConfigParser
|
||||
|
||||
import psutil
|
||||
import requests
|
||||
|
|
@ -29,11 +26,6 @@ import lib.core.common
|
|||
from lib.attacks.sqlmap_scan.sqlmap_opts import SQLMAP_API_OPTIONS
|
||||
from lib.attacks.nmap_scan.nmap_opts import NMAP_API_OPTS
|
||||
|
||||
try:
|
||||
raw_input # Python 2
|
||||
except NameError:
|
||||
raw_input = input # Python 3
|
||||
|
||||
# get the master patch ID when a patch is pushed to the program
|
||||
PATCH_ID = str(subprocess.check_output(["git", "rev-parse", "origin/master"]))[:6]
|
||||
|
||||
|
|
@ -62,7 +54,7 @@ SAYING = "Advanced Reconnaissance..."
|
|||
|
||||
# i had to create a banner because something not so good happened...
|
||||
DISCLAIMER = (
|
||||
"[!] legal disclaimer: Usage of Zeus for attacking targets without prior mutual consent is illegal. "
|
||||
"[!] Legal disclaimer: Usage of Zeus for attacking targets without prior mutual consent is illegal. "
|
||||
"It is the end user's responsibility to obey all applicable local, state and federal laws. "
|
||||
"Developers assume no liability and are not responsible for any misuse or damage caused by this program."
|
||||
)
|
||||
|
|
@ -337,7 +329,7 @@ DBMS_ERRORS = {
|
|||
# this has to be the first function so that I can use it in the logger settings below
|
||||
def create_log_name(log_path="{}/log", filename="zeus-log-{}.log", matcher="zeus"):
|
||||
"""
|
||||
create the current log file name by figuring out how many files are there
|
||||
Create the current log file name by figuring out how many files are there
|
||||
"""
|
||||
if not os.path.exists(log_path.format(os.getcwd())):
|
||||
os.mkdir(log_path.format(os.getcwd()))
|
||||
|
|
@ -371,7 +363,7 @@ logger.addHandler(file_handler)
|
|||
|
||||
def create_dir(dirpath):
|
||||
"""
|
||||
create a directory if it doesn't exist
|
||||
Create a directory if it doesn't exist
|
||||
"""
|
||||
if not os.path.exists(dirpath):
|
||||
os.mkdir(dirpath)
|
||||
|
|
@ -379,10 +371,10 @@ def create_dir(dirpath):
|
|||
|
||||
def find_running_opts(options):
|
||||
"""
|
||||
display the running options if verbose is used
|
||||
Display the running options if verbose is used
|
||||
"""
|
||||
opts_being_used = []
|
||||
for o, v in options.__dict__.iteritems():
|
||||
for o, v in options.__dict__.items():
|
||||
if v is not None:
|
||||
opts_being_used.append((o, v))
|
||||
return dict(opts_being_used)
|
||||
|
|
@ -390,7 +382,7 @@ def find_running_opts(options):
|
|||
|
||||
def parse_conf_file(config_path):
|
||||
"""
|
||||
parse a sqlmap configuration file
|
||||
Parse a sqlmap configuration file
|
||||
"""
|
||||
set_options = []
|
||||
skip_opt_schema = ("", "False", "0")
|
||||
|
|
@ -407,7 +399,8 @@ def parse_conf_file(config_path):
|
|||
|
||||
def set_color(org_string, level=None):
|
||||
"""
|
||||
set the console log color, this will kinda mess with the file log but whatever
|
||||
Set the console log color. This will mess with the log file, but the trade-off
|
||||
for usability is worth it.
|
||||
"""
|
||||
color_levels = {
|
||||
10: "\033[36m{}\033[0m", # DEBUG
|
||||
|
|
@ -427,7 +420,7 @@ def set_color(org_string, level=None):
|
|||
|
||||
def get_proxy_type(proxy_string):
|
||||
"""
|
||||
get the type of proxy that is being used or output possible proxy types you're trying to use
|
||||
Get the type of proxy that is being used, or output possible proxy types you're trying to use
|
||||
"""
|
||||
acceptable = ("http", "https", "socks5", "socks4")
|
||||
prox_list = proxy_string.split("://")
|
||||
|
|
@ -442,7 +435,7 @@ def get_proxy_type(proxy_string):
|
|||
|
||||
def proxy_string_to_dict(proxy_string):
|
||||
"""
|
||||
send the proxy string to a dict -> http://127.0.0.1:8080 -> {'http': '127.0.0.1:8080'}
|
||||
Send the proxy string to a dict -> http://127.0.0.1:8080 -> {'http': '127.0.0.1:8080'}
|
||||
"""
|
||||
if proxy_string is None:
|
||||
return None
|
||||
|
|
@ -453,7 +446,7 @@ def proxy_string_to_dict(proxy_string):
|
|||
|
||||
def setup(verbose=False):
|
||||
"""
|
||||
setup the application if it has not been setup yet
|
||||
Setup the application if it has not been setup yet
|
||||
"""
|
||||
if verbose:
|
||||
logger.debug(set_color(
|
||||
|
|
@ -464,7 +457,7 @@ def setup(verbose=False):
|
|||
|
||||
def get_latest_log_file(log_path):
|
||||
"""
|
||||
get the latest log file being used from the given path
|
||||
Get the latest log file being used from the given path
|
||||
"""
|
||||
file_list = glob.glob(log_path + "/*")
|
||||
try:
|
||||
|
|
@ -476,12 +469,12 @@ def get_latest_log_file(log_path):
|
|||
|
||||
def replace_http(url, queries=True, complete=False):
|
||||
"""
|
||||
replace the http in the url so we can get the IP address
|
||||
Replace the protocol ('http') in the URL so we can get the IP address
|
||||
"""
|
||||
|
||||
def __remove_queries(data):
|
||||
"""
|
||||
delete the queries from the URL
|
||||
Delete the queries from the URL
|
||||
"""
|
||||
return data.split("/")[0]
|
||||
|
||||
|
|
@ -501,23 +494,23 @@ def replace_http(url, queries=True, complete=False):
|
|||
|
||||
def grab_random_agent(agent_path="{}/etc/text_files/agents.txt", verbose=False):
|
||||
"""
|
||||
grab a random user agent from the agent file
|
||||
Grab a random user agent from the agent file
|
||||
"""
|
||||
if verbose:
|
||||
logger.debug(set_color(
|
||||
"grabbing random user-agent from '{}'".format(agent_path.format(os.getcwd())), level=10
|
||||
"Grabbing random user agent from '{}'".format(agent_path.format(os.getcwd())), level=10
|
||||
))
|
||||
with open(agent_path.format(os.getcwd())) as agents:
|
||||
retval = random.choice(agents.readlines())
|
||||
logger.info(set_color(
|
||||
"random agent being used '{}'".format(retval.strip())
|
||||
"Random user agent being used: '{}'".format(retval.strip())
|
||||
))
|
||||
return retval.strip()
|
||||
|
||||
|
||||
def find_application(application, opt="path"):
|
||||
"""
|
||||
find the given application on the users system by parsing the given configuration file
|
||||
Find the given application on the users system by parsing the given configuration file
|
||||
"""
|
||||
retval = []
|
||||
with open(TOOL_PATHS) as config:
|
||||
|
|
@ -532,7 +525,7 @@ def find_application(application, opt="path"):
|
|||
|
||||
def get_random_dork(filename="{}/etc/text_files/dorks.txt"):
|
||||
"""
|
||||
grab a random dork from the file
|
||||
Grab a random dork from the file
|
||||
"""
|
||||
with open(filename.format(os.getcwd())) as dorks:
|
||||
return random.choice(dorks.readlines())
|
||||
|
|
@ -540,7 +533,7 @@ def get_random_dork(filename="{}/etc/text_files/dorks.txt"):
|
|||
|
||||
def update_zeus():
|
||||
"""
|
||||
update zeus to the newest version
|
||||
Update zeus to the newest version
|
||||
"""
|
||||
can_update = True if ".git" in os.listdir(os.getcwd()) else False
|
||||
if can_update:
|
||||
|
|
@ -553,7 +546,7 @@ def update_zeus():
|
|||
|
||||
def create_tree(start, conns, down="|", over="-", sep="-" * 40):
|
||||
"""
|
||||
create a tree of connections made, will be used for things like XSS and admin pages
|
||||
Create a tree of connections made, will be used for things like XSS and admin pages
|
||||
"""
|
||||
print("{}\nStarting URL: {}\n\nConnections:".format(sep, start))
|
||||
for con in conns:
|
||||
|
|
@ -567,7 +560,7 @@ def create_tree(start, conns, down="|", over="-", sep="-" * 40):
|
|||
|
||||
def get_true_url(url):
|
||||
"""
|
||||
get the true URL of an otherwise messy URL
|
||||
Get the true URL of an otherwise messy URL
|
||||
"""
|
||||
data = url.split("/")
|
||||
return "{}//{}".format(data[0], data[2])
|
||||
|
|
@ -591,7 +584,7 @@ def fix_log_file(logfile=get_latest_log_file(CURRENT_LOG_FILE_PATH)):
|
|||
|
||||
def search_for_process(name):
|
||||
"""
|
||||
search for a given process to see if it's started or not
|
||||
Search for a given process to see if it's started or not
|
||||
"""
|
||||
all_process_names = set()
|
||||
for pid in psutil.pids():
|
||||
|
|
@ -602,30 +595,32 @@ def search_for_process(name):
|
|||
|
||||
def get_browser_version(output=True):
|
||||
"""
|
||||
obtain the firefox browser version, this is necessary because zeus can only handle certain versions.
|
||||
Obtains the Firefox browser version.
|
||||
"""
|
||||
if output:
|
||||
logger.info(set_color(
|
||||
"attempting to get firefox browser version"
|
||||
"Attempting to get firefox browser version..."
|
||||
))
|
||||
try:
|
||||
firefox_version_command = shlex.split("firefox --version")
|
||||
# Run Firefox as non-root user
|
||||
username = os.getlogin()
|
||||
firefox_version_command = shlex.split("sudo -u {} firefox --version".format(username))
|
||||
output = subprocess.check_output(firefox_version_command)
|
||||
except OSError:
|
||||
logger.error(set_color(
|
||||
"failed to run firefox", level=50
|
||||
"Failed to run Firefox!", level=40
|
||||
))
|
||||
return "failed to start"
|
||||
try:
|
||||
major, minor = map(int, re.search(r"(\d+).(\d+)", output).groups())
|
||||
except ValueError:
|
||||
logger.error(set_color(
|
||||
"failed to parse '{}' for version number".format(output), level=50
|
||||
"Failed to parse '{}' for version number".format(output), level=40
|
||||
))
|
||||
return output
|
||||
except Exception as e:
|
||||
logger.error(set_color(
|
||||
"received and exception from firefox '{}'".format(str(e), level=50)
|
||||
"Received an exception from Firefox: '{}'".format(str(e), level=40)
|
||||
))
|
||||
return str(e)
|
||||
return major, minor
|
||||
|
|
@ -633,7 +628,7 @@ def get_browser_version(output=True):
|
|||
|
||||
def config_headers(**kwargs):
|
||||
"""
|
||||
configure the request headers, this will configure user agents and proxies
|
||||
Configure the request headers, this will configure user agents and proxies
|
||||
"""
|
||||
proxy = kwargs.get("proxy", None)
|
||||
rand_proxy = kwargs.get("proxy_file", None)
|
||||
|
|
@ -643,13 +638,13 @@ def config_headers(**kwargs):
|
|||
if proxy is not None:
|
||||
if "127.0.0.1" in proxy:
|
||||
logger.warning(set_color(
|
||||
"timeout will be increased to 40s due to Tor being used", level=30
|
||||
"Timeout will be increased to 40s due to Tor being used", level=30
|
||||
))
|
||||
proxy_retval = proxy
|
||||
elif rand_proxy is not None:
|
||||
if verbose:
|
||||
logger.debug(set_color(
|
||||
"loading random proxy from '{}'".format(rand_proxy), level=10
|
||||
"Loading random proxy from '{}'".format(rand_proxy), level=10
|
||||
))
|
||||
with open(rand_proxy) as proxies:
|
||||
possible = proxies.readlines()
|
||||
|
|
@ -667,7 +662,7 @@ def config_headers(**kwargs):
|
|||
|
||||
def get_md5sum(url="https://raw.githubusercontent.com/Ekultek/Zeus-Scanner/master/etc/checksum/md5sum.md5"):
|
||||
"""
|
||||
compare the checksums to post an issue
|
||||
Compare the checksums to post an issue
|
||||
"""
|
||||
current_checksum = open(CHECKSUM_PATH).read()
|
||||
posted_checksum = requests.get(url).content
|
||||
|
|
@ -677,7 +672,7 @@ def get_md5sum(url="https://raw.githubusercontent.com/Ekultek/Zeus-Scanner/maste
|
|||
|
||||
def create_identifier(st):
|
||||
"""
|
||||
create the identifier for your Github issue
|
||||
Create the identifier for your Github issue
|
||||
"""
|
||||
import hashlib
|
||||
obj = hashlib.md5()
|
||||
|
|
@ -687,7 +682,7 @@ def create_identifier(st):
|
|||
|
||||
def config_search_engine(**kwargs):
|
||||
"""
|
||||
configure the search engine if a one different from google is given
|
||||
Configure the search engine if a one different from Google is given
|
||||
"""
|
||||
verbose = kwargs.get("verbose", False)
|
||||
aol = kwargs.get("aol", False)
|
||||
|
|
@ -696,7 +691,7 @@ def config_search_engine(**kwargs):
|
|||
enum = kwargs.get("enum", None)
|
||||
|
||||
non_default_msg = "specified to use non-default search engine"
|
||||
se_message = "using '{}' as the search engine"
|
||||
se_message = "Using '{}' as the search engine"
|
||||
if ddg:
|
||||
if verbose:
|
||||
logger.debug(set_color(
|
||||
|
|
@ -729,16 +724,16 @@ def config_search_engine(**kwargs):
|
|||
se = AUTHORIZED_SEARCH_ENGINES["bing"]
|
||||
elif enum is not None:
|
||||
logger.info(set_color(
|
||||
"running enumeration on given file '{}'".format(enum)
|
||||
"Running enumeration on given file '{}'".format(enum)
|
||||
))
|
||||
se = None
|
||||
else:
|
||||
if verbose:
|
||||
logger.debug(set_color(
|
||||
"using default search engine (Google)", level=10
|
||||
"Using default search engine (Google)", level=10
|
||||
))
|
||||
logger.info(set_color(
|
||||
"using default search engine"
|
||||
"Using default search engine"
|
||||
))
|
||||
se = AUTHORIZED_SEARCH_ENGINES["google"]
|
||||
return se
|
||||
|
|
@ -746,7 +741,7 @@ def config_search_engine(**kwargs):
|
|||
|
||||
def create_arguments(**kwargs):
|
||||
"""
|
||||
create the arguments for sqlmap and nmap if arguments are passed
|
||||
Create the arguments for sqlmap and nmap if arguments are passed
|
||||
"""
|
||||
nmap = kwargs.get("nmap", False)
|
||||
sqlmap = kwargs.get("sqlmap", False)
|
||||
|
|
@ -755,7 +750,7 @@ def create_arguments(**kwargs):
|
|||
conf_file = kwargs.get("conf", None)
|
||||
|
||||
logger.info(set_color(
|
||||
"creating arguments for {}".format("sqlmap" if sqlmap else "nmap")
|
||||
"Creating arguments for {}".format("sqlmap" if sqlmap else "nmap")
|
||||
))
|
||||
retval = []
|
||||
splitter = {"sqlmap": ",", "nmap": "|"}
|
||||
|
|
@ -767,7 +762,7 @@ def create_arguments(**kwargs):
|
|||
if o.lower() == opt[0]:
|
||||
retval.append((o, opt[1]))
|
||||
elif sqlmap:
|
||||
warn_msg = "option '{}' is not recognized by sqlmap API, skipping"
|
||||
warn_msg = "Option '{}' is not recognized by sqlmap API, skipping"
|
||||
if sqlmap_args is not None:
|
||||
for line in sqlmap_args.split(splitter["sqlmap"]):
|
||||
try:
|
||||
|
|
@ -790,7 +785,7 @@ def create_arguments(**kwargs):
|
|||
))
|
||||
|
||||
elif nmap:
|
||||
warning_msg = "option {} is not known by the nmap api, skipping"
|
||||
warning_msg = "Option {} is not known by the nmap api, skipping"
|
||||
if nmap_args is not None:
|
||||
for line in nmap_args.split(splitter["nmap"]):
|
||||
try:
|
||||
|
|
@ -818,7 +813,7 @@ def create_arguments(**kwargs):
|
|||
|
||||
def create_random_ip():
|
||||
"""
|
||||
create a random IP address, no testing if it is valid or not
|
||||
Create a random IP address without testing for validity
|
||||
"""
|
||||
|
||||
def __get_nodes():
|
||||
|
|
@ -828,15 +823,15 @@ def create_random_ip():
|
|||
if generated == "0.0.0.0" or "255.255.255.255":
|
||||
generated = __get_nodes() # if it isn't a real IP regenerate it
|
||||
logger.info(set_color(
|
||||
"random IP address generated for header '{}'".format(generated)
|
||||
"Random IP address generated for header '{}'".format(generated)
|
||||
))
|
||||
return generated
|
||||
|
||||
|
||||
def rewrite_all_paths():
|
||||
"""
|
||||
rewrite all the paths in case we hit a certain error, this will force a reinstall of the
|
||||
geckodriver
|
||||
Rewrite all the paths in case we hit a certain error. Rhis will force a reinstall of the
|
||||
geckodriver.
|
||||
"""
|
||||
gecko_path = whichcraft.which("geckodriver")
|
||||
os.remove(gecko_path)
|
||||
|
|
@ -849,14 +844,14 @@ def rewrite_all_paths():
|
|||
|
||||
def check_for_protection(protected, attack_type):
|
||||
"""
|
||||
check if the provided target URL has header protection against an attack type
|
||||
Check if the provided target URL has header protection against an attack type
|
||||
"""
|
||||
if protected is not None:
|
||||
items = [item.lower() for item in protected]
|
||||
|
||||
if attack_type in items or "all" in items:
|
||||
logger.warning(set_color(
|
||||
"provided target seems to have protection against this attack type", level=30
|
||||
"Provided target seems to have protection against this attack type", level=30
|
||||
))
|
||||
protected.clear() # clear the set
|
||||
return True
|
||||
|
|
@ -864,7 +859,7 @@ def check_for_protection(protected, attack_type):
|
|||
|
||||
def deprecation(target_version, method, connect=True, *args, **kwargs):
|
||||
"""
|
||||
show a deprecation warning and return the function with the correct given arguments
|
||||
Show a deprecation warning and return the function with the correct arguments given
|
||||
"""
|
||||
if connect:
|
||||
print(
|
||||
|
|
@ -893,15 +888,15 @@ def deprecation(target_version, method, connect=True, *args, **kwargs):
|
|||
|
||||
def check_thread_num(number, batch=False, default=5):
|
||||
"""
|
||||
if you specify more threads then the max number you will be prompted if not running batch
|
||||
If you specify more threads than the max, you will be prompted if not running batch
|
||||
"""
|
||||
logger.warning(set_color(
|
||||
"you have specified {} threads, it is highly advised to not go over {} threads, "
|
||||
"You have specified {} threads, it is highly advised to not go over {} threads, "
|
||||
"doing so will most likely not give a significant performance increase and also "
|
||||
"will most likely cause unforeseen issues".format(number, MAX_THREADS), level=30
|
||||
))
|
||||
question_msg = "would you like to continue anyways"
|
||||
default_msg = "defaulting to 5 threads"
|
||||
question_msg = "Would you like to continue anyways"
|
||||
default_msg = "Defaulting to 5 threads"
|
||||
if not batch:
|
||||
question = lib.core.common.prompt(
|
||||
question_msg, opts="yN"
|
||||
|
|
@ -924,7 +919,7 @@ def check_thread_num(number, batch=False, default=5):
|
|||
|
||||
def run_attacks(url, **kwargs):
|
||||
"""
|
||||
run the attacks if any are requested
|
||||
Run the requested attacks (if any)
|
||||
"""
|
||||
nmap = kwargs.get("nmap", False)
|
||||
sqlmap = kwargs.get("sqlmap", False)
|
||||
|
|
@ -968,7 +963,7 @@ def run_attacks(url, **kwargs):
|
|||
enabled.add(key)
|
||||
if len(enabled) > 1:
|
||||
logger.error(set_color(
|
||||
"it appears that you have enabled multiple attack types, "
|
||||
"It appears that you have enabled multiple attack types, "
|
||||
"as of now only 1 attack is supported at a time, choose "
|
||||
"your attack and try again. You can use the -f flag if "
|
||||
"you do not want to complete an entire search again "
|
||||
|
|
@ -1040,13 +1035,13 @@ def run_attacks(url, **kwargs):
|
|||
|
||||
def parse_blacklist(dork, path, batch=False):
|
||||
"""
|
||||
parse the built-in blacklist to see if your dork is already in there or not
|
||||
Parse the built-in blacklist to see if your dork is already in there or not
|
||||
"""
|
||||
create_dir(path)
|
||||
dork = dork.strip()
|
||||
full_path = "{}/.blacklist".format(path)
|
||||
prompt_msg = (
|
||||
"it appears your query '{}' is blacklisted (no usable sites found with it) "
|
||||
"It appears your query '{}' is blacklisted (no usable sites found with it) "
|
||||
"continuing will most likely result in finding no URL's, would you like to "
|
||||
"continue anyways".format(dork)
|
||||
)
|
||||
|
|
@ -1066,7 +1061,7 @@ def parse_blacklist(dork, path, batch=False):
|
|||
|
||||
def calculate_success(amount_of_urls):
|
||||
"""
|
||||
calculate the success rate of the found links
|
||||
Calculate the success rate of the found links
|
||||
"""
|
||||
success_percentage = ((amount_of_urls // 10) + 1) * 10
|
||||
if success_percentage < 25:
|
||||
|
|
@ -1084,7 +1079,7 @@ def calculate_success(amount_of_urls):
|
|||
|
||||
def __get_encoded_string(path):
|
||||
"""
|
||||
get the encoded authorization string
|
||||
Get the encoded authorization string
|
||||
"""
|
||||
with open(path.format(os.getcwd())) as log:
|
||||
return log.read()
|
||||
|
|
@ -1092,14 +1087,14 @@ def __get_encoded_string(path):
|
|||
|
||||
def __get_n(encoded):
|
||||
"""
|
||||
get the n'th number for decoding
|
||||
Get the nth number for decoding
|
||||
"""
|
||||
return encoded.split(":")[-1]
|
||||
|
||||
|
||||
def __decode(encoded, n):
|
||||
"""
|
||||
decode the string
|
||||
Decode the string
|
||||
"""
|
||||
token = encoded.split(":")[0]
|
||||
for _ in range(0, n):
|
||||
|
|
@ -1109,7 +1104,7 @@ def __decode(encoded, n):
|
|||
|
||||
def get_token(path):
|
||||
"""
|
||||
get the authorization token
|
||||
Get the authorization token
|
||||
"""
|
||||
encoded = __get_encoded_string(path)
|
||||
n = __get_n(encoded)
|
||||
|
|
@ -1119,8 +1114,7 @@ def get_token(path):
|
|||
|
||||
def tails(file_object, last_lines=50):
|
||||
"""
|
||||
return the last `n` lines of a file, much like the Unix
|
||||
tails command
|
||||
Return the last `n` lines of a file, much like the Unix `tails` command
|
||||
"""
|
||||
with open(file_object) as file_object:
|
||||
assert last_lines >= 0
|
||||
|
|
@ -1139,7 +1133,7 @@ def tails(file_object, last_lines=50):
|
|||
|
||||
def convert_to_minutes(seconds):
|
||||
"""
|
||||
convert an amount of seconds to minutes and seconds
|
||||
Convert an amount of seconds to minutes and seconds
|
||||
"""
|
||||
import time
|
||||
return time.strftime("%M:%S", time.gmtime(seconds))
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
selenium==3.5.0
|
||||
requests==2.12.2
|
||||
python-nmap==0.6.1
|
||||
whichcraft==0.4.1
|
||||
pyvirtualdisplay==0.2.1
|
||||
lxml==3.7.3
|
||||
psutil==5.0.1
|
||||
beautifulsoup4==4.6.0
|
||||
selenium
|
||||
requests
|
||||
python-nmap
|
||||
whichcraft
|
||||
pyvirtualdisplay
|
||||
lxml
|
||||
psutil
|
||||
beautifulsoup4
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
import re
|
||||
import sys
|
||||
try:
|
||||
import urllib2 # python 2
|
||||
except ImportError:
|
||||
import urllib.request as urllib2 # python 3
|
||||
import urllib.request as urllib2
|
||||
import json
|
||||
import platform
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,6 @@
|
|||
import os
|
||||
import time
|
||||
|
||||
try:
|
||||
from urllib import ( # python 2
|
||||
unquote
|
||||
)
|
||||
except ImportError:
|
||||
from urllib.parse import ( # python 3
|
||||
unquote
|
||||
)
|
||||
from urllib.parse import (unquote)
|
||||
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
|
|
@ -414,11 +406,11 @@ def parse_search_results(query, url_to_search, verbose=False, **kwargs):
|
|||
"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)
|
||||
|
||||
|
||||
logger.info(set_color(
|
||||
"found a total of {} URLs with given query '{}'".format(len(true_retval), query)
|
||||
))
|
||||
|
||||
|
||||
|
||||
|
||||
def search_multiple_pages(query, link_amount, verbose=False, **kwargs):
|
||||
|
|
|
|||
72
zeus.py
72
zeus.py
|
|
@ -6,6 +6,7 @@ import time
|
|||
import shlex
|
||||
import warnings
|
||||
import subprocess
|
||||
from importlib import reload
|
||||
|
||||
from var import blackwidow
|
||||
from var.search import selenium_search
|
||||
|
|
@ -47,7 +48,6 @@ if __name__ == "__main__":
|
|||
|
||||
# this will take care of most of the Unicode errors.
|
||||
reload(sys)
|
||||
sys.setdefaultencoding("utf-8")
|
||||
sys.setrecursionlimit(1500)
|
||||
|
||||
opt = ZeusParser.cmd_parser()
|
||||
|
|
@ -69,17 +69,17 @@ if __name__ == "__main__":
|
|||
if opt.runInVerbose:
|
||||
being_run = find_running_opts(opt)
|
||||
logger.debug(set_color(
|
||||
"running with options '{}'".format(being_run), level=10
|
||||
"Running with options '{}'".format(being_run), level=10
|
||||
))
|
||||
|
||||
logger.info(set_color(
|
||||
"log file being saved to '{}'".format(get_latest_log_file(CURRENT_LOG_FILE_PATH))
|
||||
"Log file being saved to '{}'".format(get_latest_log_file(CURRENT_LOG_FILE_PATH))
|
||||
))
|
||||
|
||||
|
||||
def __run_attacks_main(**kwargs):
|
||||
"""
|
||||
main method to run the attacks
|
||||
Main method to run the attacks
|
||||
"""
|
||||
log_to_use = kwargs.get("log", None)
|
||||
if log_to_use is None:
|
||||
|
|
@ -109,18 +109,18 @@ if __name__ == "__main__":
|
|||
current = i
|
||||
if "webcache" in url:
|
||||
logger.warning(set_color(
|
||||
"ran into unexpected webcache URL skipping", level=30
|
||||
"Ran into unexpected webcache URL skipping", level=30
|
||||
))
|
||||
current -= 1
|
||||
else:
|
||||
if not url.strip() == "http://" or url == "https://":
|
||||
logger.info(set_color(
|
||||
"currently running on '{}' (target #{})".format(
|
||||
"Currently running on '{}' (target #{})".format(
|
||||
url.strip(), current
|
||||
), level=25
|
||||
))
|
||||
logger.info(set_color(
|
||||
"fetching target meta-data"
|
||||
"Fetching target meta-data"
|
||||
))
|
||||
identified = main_header_check(
|
||||
url, verbose=opt.runInVerbose, agent=agent_to_use,
|
||||
|
|
@ -130,7 +130,7 @@ if __name__ == "__main__":
|
|||
)
|
||||
if not identified:
|
||||
logger.error(set_color(
|
||||
"target is refusing to allow meta-data dumping, skipping", level=40
|
||||
"Target is refusing to allow meta-data dumping, skipping", level=40
|
||||
))
|
||||
run_attacks(
|
||||
url.strip(),
|
||||
|
|
@ -148,7 +148,7 @@ if __name__ == "__main__":
|
|||
print("\n")
|
||||
else:
|
||||
logger.warning(set_color(
|
||||
"malformed URL discovered, skipping", level=30
|
||||
"Malformed URL discovered, skipping", level=30
|
||||
))
|
||||
|
||||
|
||||
|
|
@ -166,7 +166,7 @@ if __name__ == "__main__":
|
|||
# use a personal dork as the query
|
||||
if opt.dorkToUse is not None and not opt.searchMultiplePages:
|
||||
logger.info(set_color(
|
||||
"starting dork scan with query '{}'".format(opt.dorkToUse)
|
||||
"Starting dork scan with query '{}'".format(opt.dorkToUse)
|
||||
))
|
||||
try:
|
||||
selenium_search.parse_search_results(
|
||||
|
|
@ -178,20 +178,20 @@ if __name__ == "__main__":
|
|||
except InvalidProxyType:
|
||||
supported_proxy_types = ("socks5", "socks4", "https", "http")
|
||||
logger.fatal(set_color(
|
||||
"the provided proxy is not valid, specify the protocol and try again, supported "
|
||||
"proxy protocols are {} (IE socks5://127.0.0.1:9050)".format(
|
||||
"The provided proxy is not valid, please specify the protocol and try again. "
|
||||
"Supported proxy protocols are {} (IE socks5://127.0.0.1:9050)".format(
|
||||
", ".join(list(supported_proxy_types))), level=50
|
||||
))
|
||||
except Exception as e:
|
||||
if "Permission denied:" in str(e):
|
||||
logger.fatal(set_color(
|
||||
"your permissions are not allowing Zeus to run, "
|
||||
"Your permissions are not allowing Zeus to run, "
|
||||
"try running Zeus with sudo", level=50
|
||||
))
|
||||
shutdown()
|
||||
else:
|
||||
logger.exception(set_color(
|
||||
"ran into exception '{}'".format(e), level=50
|
||||
"Ran into exception '{}'".format(e), level=50
|
||||
))
|
||||
request_issue_creation()
|
||||
pass
|
||||
|
|
@ -209,7 +209,7 @@ if __name__ == "__main__":
|
|||
|
||||
if dork_to_use is None:
|
||||
logger.warning(set_color(
|
||||
"there has been no dork to specified to do the searching, defaulting to random dork", level=30
|
||||
"There has been no dork specified to do the searching, defaulting to random dork", level=30
|
||||
))
|
||||
dork_to_use = get_random_dork()
|
||||
|
||||
|
|
@ -217,14 +217,14 @@ if __name__ == "__main__":
|
|||
|
||||
if opt.amountToSearch is None:
|
||||
logger.warning(set_color(
|
||||
"did not specify amount of links to find defaulting to 75", level=30
|
||||
"Did not specify amount of links to find, defaulting to 75", level=30
|
||||
))
|
||||
link_amount_to_search = 75
|
||||
else:
|
||||
link_amount_to_search = opt.amountToSearch
|
||||
|
||||
logger.info(set_color(
|
||||
"searching Google using dork '{}' for a total of {} links".format(
|
||||
"Searching Google using dork '{}' for a total of {} links".format(
|
||||
dork_to_use, link_amount_to_search
|
||||
)
|
||||
))
|
||||
|
|
@ -238,11 +238,11 @@ if __name__ == "__main__":
|
|||
except Exception as e:
|
||||
if "Error 400" in str(e):
|
||||
logger.fatal(set_color(
|
||||
"failed to connect to search engine".format(e), level=50
|
||||
"Failed to connect to search engine".format(e), level=50
|
||||
))
|
||||
else:
|
||||
logger.exception(set_color(
|
||||
"failed with unexpected error '{}'".format(e), level=50
|
||||
"Failed with unexpected error '{}'".format(e), level=50
|
||||
))
|
||||
shutdown()
|
||||
|
||||
|
|
@ -254,7 +254,7 @@ if __name__ == "__main__":
|
|||
for dork in dorks.readlines():
|
||||
dork = dork.strip()
|
||||
logger.info(set_color(
|
||||
"starting dork scan with query '{}'".format(dork)
|
||||
"Starting dork scan with query '{}'".format(dork)
|
||||
))
|
||||
try:
|
||||
selenium_search.parse_search_results(
|
||||
|
|
@ -264,7 +264,7 @@ if __name__ == "__main__":
|
|||
)
|
||||
except Exception as e:
|
||||
logger.exception(set_color(
|
||||
"ran into exception '{}'".format(e), level=50
|
||||
"Ran into exception '{}'".format(e), level=50
|
||||
))
|
||||
request_issue_creation()
|
||||
pass
|
||||
|
|
@ -276,10 +276,10 @@ if __name__ == "__main__":
|
|||
random_dork = get_random_dork().strip()
|
||||
if opt.runInVerbose:
|
||||
logger.debug(set_color(
|
||||
"choosing random dork from etc/dorks.txt", level=10
|
||||
"Choosing random dork from etc/dorks.txt", level=10
|
||||
))
|
||||
logger.info(set_color(
|
||||
"using random dork '{}' as the search query".format(random_dork)
|
||||
"Using random dork '{}' as the search query".format(random_dork)
|
||||
))
|
||||
try:
|
||||
selenium_search.parse_search_results(
|
||||
|
|
@ -291,7 +291,7 @@ if __name__ == "__main__":
|
|||
|
||||
except Exception as e:
|
||||
logger.exception(set_color(
|
||||
"ran into exception '{}' and cannot continue, saved to current log file".format(e),
|
||||
"Ran into exception '{}' and cannot continue, saved to current log file".format(e),
|
||||
level=50
|
||||
))
|
||||
request_issue_creation()
|
||||
|
|
@ -313,7 +313,7 @@ if __name__ == "__main__":
|
|||
else:
|
||||
if URL_QUERY_REGEX.match(opt.spiderWebSite):
|
||||
question_msg = (
|
||||
"it is recommended to not use a URL that has a GET(query) parameter in it, "
|
||||
"It is recommended to not use a URL that has a GET(query) parameter in it, "
|
||||
"would you like to continue"
|
||||
)
|
||||
if not opt.runInBatch:
|
||||
|
|
@ -337,18 +337,18 @@ if __name__ == "__main__":
|
|||
# enumerate a file and run attacks on the URL's provided
|
||||
elif opt.fileToEnumerate is not None:
|
||||
logger.info(set_color(
|
||||
"found a total of {} URL's to enumerate in given file".format(
|
||||
"Found a total of {} URLs to enumerate in given file".format(
|
||||
len(open(opt.fileToEnumerate).readlines())
|
||||
)
|
||||
))
|
||||
__run_attacks_main(log=opt.fileToEnumerate)
|
||||
|
||||
else:
|
||||
logger.critical(set_color(
|
||||
"failed to provide a mandatory argument, you will be redirected to the help menu", level=50
|
||||
logger.warning(set_color(
|
||||
"Failed to provide a mandatory argument, you will be redirected to the help menu\n", level=30
|
||||
))
|
||||
time.sleep(2)
|
||||
zeus_help_menu_command = shlex.split("python zeus.py --help")
|
||||
zeus_help_menu_command = shlex.split("python3 zeus.py --help")
|
||||
subprocess.call(zeus_help_menu_command)
|
||||
except IOError as e:
|
||||
if "Invalid URL" in str(e):
|
||||
|
|
@ -365,7 +365,7 @@ if __name__ == "__main__":
|
|||
shutdown()
|
||||
elif "No such file or directory" in str(e):
|
||||
logger.fatal(set_color(
|
||||
"provided file does not exist, make sure you have the full path", level=50
|
||||
"Provided file does not exist, make sure you have the full path", level=50
|
||||
))
|
||||
shutdown()
|
||||
else:
|
||||
|
|
@ -375,12 +375,12 @@ if __name__ == "__main__":
|
|||
request_issue_creation()
|
||||
except KeyboardInterrupt:
|
||||
logger.fatal(set_color(
|
||||
"user aborted process", level=50
|
||||
"User aborted process", level=50
|
||||
))
|
||||
shutdown()
|
||||
except UnboundLocalError:
|
||||
logger.warning(set_color(
|
||||
"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
|
||||
))
|
||||
except ZeusArgumentException:
|
||||
|
|
@ -388,7 +388,7 @@ if __name__ == "__main__":
|
|||
except Exception as e:
|
||||
if "url did not match a true url" in str(e).lower():
|
||||
logger.error(set_color(
|
||||
"you did not provide a URL that is capable of being processed, "
|
||||
"You did not provide a URL that is capable of being processed, "
|
||||
"the URL provided to the spider needs to contain protocol as well "
|
||||
"ie. 'http://google.com' (it is advised not to add the GET parameter), "
|
||||
"fix the URL you want to scan and try again", level=40
|
||||
|
|
@ -402,17 +402,17 @@ if __name__ == "__main__":
|
|||
shutdown()
|
||||
elif "Max retries exceeded with url" in str(e):
|
||||
logger.fatal(set_color(
|
||||
"you have hit the max retries, to continue using Zeus "
|
||||
"You have hit the max retries, to continue using Zeus "
|
||||
"it is recommended to use a proxy (--proxy/--proxy-file) "
|
||||
"along with a new user-agent (--random-agent/--agent).", level=50
|
||||
))
|
||||
shutdown()
|
||||
else:
|
||||
logger.exception(set_color(
|
||||
"ran into exception '{}' exception has been saved to log file".format(e), level=50
|
||||
"Ran into exception '{}' exception has been saved to log file".format(e), level=50
|
||||
))
|
||||
request_issue_creation()
|
||||
|
||||
# fix the log file before shutting down incase you want to look at it
|
||||
fix_log_file()
|
||||
shutdown()
|
||||
shutdown()
|
||||
|
|
|
|||
Loading…
Reference in a new issue