will now save discovered cookies to a log file

This commit is contained in:
ekultek 2017-11-11 16:02:34 -06:00
parent 77bc6dc956
commit cec5a4c7c5
3 changed files with 24 additions and 4 deletions

View file

@ -50,8 +50,8 @@ d8fab18b15d1546f6585fe926c27868f ./lib/attacks/whois_lookup/whois.py
21faf4679cdeaa731029a48f8963d6e7 ./lib/attacks/nmap_scan/nmap_opts.py
1faa2b5dfad6eb538bbfe42942d2a9da ./lib/core/errors.py
d41d8cd98f00b204e9800998ecf8427e ./lib/core/__init__.py
d7882d1d6002eef2667d10ced8e5e4f4 ./lib/core/settings.py
60d6f072cc80f08e9214131dc33fe63a ./lib/header_check/__init__.py
7dfba7fabe755c6d9946097b41426458 ./lib/core/settings.py
ad6622a5170e4ec74b5172f12ddcba9f ./lib/header_check/__init__.py
d41d8cd98f00b204e9800998ecf8427e ./var/google_search/__init__.py
049b8a1cc93dc44b12dd93efdf785412 ./var/google_search/search.py
d41d8cd98f00b204e9800998ecf8427e ./var/__init__.py

View file

@ -52,7 +52,7 @@ PATCH_ID = str(subprocess.check_output(["git", "rev-parse", "origin/master"]))[:
CLONE = "https://github.com/ekultek/zeus-scanner.git"
# current version <major.minor.commit.patch ID>
VERSION = "1.2.5".format(PATCH_ID)
VERSION = "1.2.6".format(PATCH_ID)
# colors to output depending on the version
VERSION_TYPE_COLORS = {"dev": 33, "stable": 92, "other": 30}
@ -156,6 +156,9 @@ PORT_SCAN_LOG_PATH = "{}/log/scanner-log".format(os.getcwd())
# blackwidow log path
SPIDER_LOG_PATH = "{}/log/blackwidow-log".format(os.getcwd())
# cookies log path
COOKIE_LOG_PATH = "{}/log/cookies".format(os.getcwd())
# the current log file being used
CURRENT_LOG_FILE_PATH = "{}/log".format(os.getcwd())

View file

@ -11,7 +11,8 @@ from lib.core.settings import (
write_to_log_file,
HEADER_RESULT_PATH,
replace_http,
shutdown
shutdown,
COOKIE_LOG_PATH
)
@ -52,6 +53,22 @@ def load_headers(url, **kwargs):
)
}
req = requests.get(url, params=header_value, proxies=proxy)
if len(req.cookies) > 0:
logger.info(set_color(
"found a request cookie, saving to file...", level=25
))
try:
cookie_start = req.cookies.keys()
cookie_value = req.cookies.values()
write_to_log_file(
"{}={}".format(''.join(cookie_start), ''.join(cookie_value)),
COOKIE_LOG_PATH, "{}-cookie.log".format(replace_http(url))
)
except Exception:
write_to_log_file(
[c for c in req.cookies.itervalues()], COOKIE_LOG_PATH,
"{}-cookie.log".format(replace_http(url))
)
return req.headers