From cfa7b3c3bd9b59f00680eaf275c5f46127321085 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 28 Apr 2021 18:06:15 +0200 Subject: [PATCH] Implements #4656 --- lib/core/settings.py | 6 +++++- lib/utils/search.py | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index c3a3e72a0..3d422ef85 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -11,6 +11,7 @@ import random import re import string import sys +import time from lib.core.enums import DBMS from lib.core.enums import DBMS_DIRECTORY_NAME @@ -18,7 +19,7 @@ from lib.core.enums import OS from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.5.4.8" +VERSION = "1.5.4.9" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) @@ -125,6 +126,9 @@ MAX_MURPHY_SLEEP_TIME = 3 # Regular expression used for extracting results from Google search GOOGLE_REGEX = r"webcache\.googleusercontent\.com/search\?q=cache:[^:]+:([^+]+)\+&cd=|url\?\w+=((?![^>]+webcache\.googleusercontent\.com)http[^>]+)&(sa=U|rct=j)" +# Google Search consent cookie +GOOGLE_CONSENT_COOKIE = "CONSENT=YES+shp.gws-%s-0-RC1.%s+FX+740" % (time.strftime("%Y%m%d"), "".join(random.sample(string.ascii_lowercase, 2))) + # Regular expression used for extracting results from DuckDuckGo search DUCKDUCKGO_REGEX = r' 1 else 1 logger.info("using search result page #%d" % gpage) - url = "http://www.google.com/search?" # NOTE: https version goes to the consent + url = "https://www.google.com/search?" # NOTE: if consent fails, try to use the "http://" url += "q=%s&" % urlencode(dork, convall=True) url += "num=100&hl=en&complete=0&safe=off&filter=0&btnG=Search" url += "&start=%d" % ((gpage - 1) * 100)