mirror of
https://github.com/Ekultek/Zeus-Scanner.git
synced 2026-03-11 08:55:51 +00:00
skips google play and google maps, also extracts correctly from webcache with out error (issue #55)
This commit is contained in:
parent
a10d8d5825
commit
e43ee8a0ca
2 changed files with 41 additions and 28 deletions
|
|
@ -22,7 +22,7 @@ except NameError:
|
||||||
# clone link
|
# clone link
|
||||||
CLONE = "https://github.com/ekultek/zeus-scanner.git"
|
CLONE = "https://github.com/ekultek/zeus-scanner.git"
|
||||||
# current version <major.minor.commit.patch ID>
|
# current version <major.minor.commit.patch ID>
|
||||||
VERSION = "1.0.32"
|
VERSION = "1.0.33.1770"
|
||||||
# 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}
|
||||||
# version string formatting
|
# version string formatting
|
||||||
|
|
|
||||||
|
|
@ -68,12 +68,15 @@ def bypass_ip_block(url, content_sep=("continue=", "Fid", "%")):
|
||||||
return __add_https(url[0:content_list_end[-1][-1] - 1])
|
return __add_https(url[0:content_list_end[-1][-1] - 1])
|
||||||
|
|
||||||
|
|
||||||
def extract_webcache_url(webcache_url, splitter=("%2Bext", ":")):
|
def extract_webcache_url(webcache_url, splitter="+"):
|
||||||
webcache_regex = re.compile(r"(?<=q=).*?(?=[&\"])")
|
webcache_url = unquote(webcache_url)
|
||||||
data = "".join(webcache_regex.findall(webcache_url))
|
webcache_regex = re.compile(r":\w+:")
|
||||||
to_extract = data.split(splitter[0])[0]
|
data = webcache_regex.split(webcache_url)
|
||||||
found = "http:" + to_extract.split(splitter[1])[3]
|
to_extract = data[1].split(splitter)
|
||||||
return unquote(found)
|
extracted_to_test = to_extract[0]
|
||||||
|
if URL_REGEX.match(extracted_to_test):
|
||||||
|
return extracted_to_test
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def get_urls(query, url, verbose=False, warning=True, user_agent=None, proxy=None, **kwargs):
|
def get_urls(query, url, verbose=False, warning=True, user_agent=None, proxy=None, **kwargs):
|
||||||
|
|
@ -270,31 +273,41 @@ def parse_search_results(
|
||||||
logger.info(set_color(user_agent_info))
|
logger.info(set_color(user_agent_info))
|
||||||
req.headers.update(headers)
|
req.headers.update(headers)
|
||||||
found_urls = URL_REGEX.findall(req.text)
|
found_urls = URL_REGEX.findall(req.text)
|
||||||
|
url_skip_schema = ("maps.google", "play.google", "youtube")
|
||||||
for urls in list(found_urls):
|
for urls in list(found_urls):
|
||||||
for url in list(urls):
|
for url in list(urls):
|
||||||
url = unquote(url)
|
url = unquote(url)
|
||||||
if URL_QUERY_REGEX.match(url) and not any(l in url for l in exclude):
|
if not any(u in url for u in url_skip_schema):
|
||||||
if isinstance(url, unicode):
|
if URL_QUERY_REGEX.match(url) and not any(l in url for l in exclude):
|
||||||
url = str(url).encode("utf-8")
|
if isinstance(url, unicode):
|
||||||
if "webcache" in url:
|
url = str(url).encode("utf-8")
|
||||||
logger.info(set_color(
|
if "webcache" in url:
|
||||||
"received webcache URL, extracting URL from webcache..."
|
logger.info(set_color(
|
||||||
))
|
"received webcache URL, extracting URL from webcache..."
|
||||||
url = extract_webcache_url(url)
|
|
||||||
if verbose:
|
|
||||||
try:
|
|
||||||
logger.debug(set_color(
|
|
||||||
"found '{}'...".format(url.split(splitter)[0]), level=10
|
|
||||||
))
|
))
|
||||||
except TypeError:
|
webcache_url = url
|
||||||
logger.debug(set_color(
|
url = extract_webcache_url(webcache_url)
|
||||||
"found '{}'...".format(str(url).split(splitter)[0]), level=10
|
if url is None:
|
||||||
))
|
logger.warning(set_color(
|
||||||
except AttributeError:
|
"unable to extract url from given webcache URL '{}'...".format(
|
||||||
logger.debug(set_color(
|
webcache_url
|
||||||
"found '{}...".format(str(url)), level=10
|
), level=30
|
||||||
))
|
))
|
||||||
retval.add(url.split("&")[0])
|
if verbose:
|
||||||
|
try:
|
||||||
|
logger.debug(set_color(
|
||||||
|
"found '{}'...".format(url.split(splitter)[0]), level=10
|
||||||
|
))
|
||||||
|
except TypeError:
|
||||||
|
logger.debug(set_color(
|
||||||
|
"found '{}'...".format(str(url).split(splitter)[0]), level=10
|
||||||
|
))
|
||||||
|
except AttributeError:
|
||||||
|
logger.debug(set_color(
|
||||||
|
"found '{}...".format(str(url)), level=10
|
||||||
|
))
|
||||||
|
if url is not None:
|
||||||
|
retval.add(url.split("&")[0])
|
||||||
logger.info(set_color(
|
logger.info(set_color(
|
||||||
"found a total of {} URL's with a GET parameter...".format(len(retval))
|
"found a total of {} URL's with a GET parameter...".format(len(retval))
|
||||||
))
|
))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue