mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-07-27 00:20:07 +03:00
https search with --random-agent or --user-agent having no effects (desired behaviour).
This commit is contained in:
parent
2975c65f2e
commit
be5634b031
|
@ -27,7 +27,7 @@ from lib.core.exception import SqlmapConnectionException
|
||||||
from lib.core.exception import SqlmapUserQuitException
|
from lib.core.exception import SqlmapUserQuitException
|
||||||
from lib.core.settings import BING_REGEX
|
from lib.core.settings import BING_REGEX
|
||||||
from lib.core.settings import DUCKDUCKGO_REGEX
|
from lib.core.settings import DUCKDUCKGO_REGEX
|
||||||
from lib.core.settings import DUMMY_SEARCH_USER_AGENT
|
from lib.core.settings import DEFAULT_USER_AGENT
|
||||||
from lib.core.settings import GOOGLE_REGEX
|
from lib.core.settings import GOOGLE_REGEX
|
||||||
from lib.core.settings import HTTP_ACCEPT_ENCODING_HEADER_VALUE
|
from lib.core.settings import HTTP_ACCEPT_ENCODING_HEADER_VALUE
|
||||||
from lib.core.settings import UNICODE_ENCODING
|
from lib.core.settings import UNICODE_ENCODING
|
||||||
|
@ -50,7 +50,7 @@ def _search(dork):
|
||||||
requestHeaders = {}
|
requestHeaders = {}
|
||||||
responseHeaders = {}
|
responseHeaders = {}
|
||||||
|
|
||||||
requestHeaders[HTTP_HEADER.USER_AGENT] = dict(conf.httpHeaders).get(HTTP_HEADER.USER_AGENT, DUMMY_SEARCH_USER_AGENT)
|
requestHeaders[HTTP_HEADER.USER_AGENT] = DEFAULT_USER_AGENT
|
||||||
requestHeaders[HTTP_HEADER.ACCEPT_ENCODING] = HTTP_ACCEPT_ENCODING_HEADER_VALUE
|
requestHeaders[HTTP_HEADER.ACCEPT_ENCODING] = HTTP_ACCEPT_ENCODING_HEADER_VALUE
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -63,7 +63,7 @@ def _search(dork):
|
||||||
gpage = conf.googlePage if conf.googlePage > 1 else 1
|
gpage = conf.googlePage if conf.googlePage > 1 else 1
|
||||||
logger.info("using search result page #%d" % gpage)
|
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: https version goes to the consent
|
||||||
url += "q=%s&" % urlencode(dork, convall=True)
|
url += "q=%s&" % urlencode(dork, convall=True)
|
||||||
url += "num=100&hl=en&complete=0&safe=off&filter=0&btnG=Search"
|
url += "num=100&hl=en&complete=0&safe=off&filter=0&btnG=Search"
|
||||||
url += "&start=%d" % ((gpage - 1) * 100)
|
url += "&start=%d" % ((gpage - 1) * 100)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user