mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-09 08:00:36 +03:00
Fix for Issue #42
This commit is contained in:
parent
f495cfa139
commit
2a72fcce2b
|
@ -1154,14 +1154,14 @@ def __setHTTPUserAgent():
|
||||||
conf.httpHeaders.append(("User-Agent", conf.agent))
|
conf.httpHeaders.append(("User-Agent", conf.agent))
|
||||||
|
|
||||||
elif not conf.randomAgent:
|
elif not conf.randomAgent:
|
||||||
addDefaultUserAgent = True
|
_ = True
|
||||||
|
|
||||||
for header, _ in conf.httpHeaders:
|
for header, _ in conf.httpHeaders:
|
||||||
if header == "User-Agent":
|
if header == "User-Agent":
|
||||||
addDefaultUserAgent = False
|
_ = False
|
||||||
break
|
break
|
||||||
|
|
||||||
if addDefaultUserAgent:
|
if _:
|
||||||
conf.httpHeaders.append(("User-Agent", __defaultHTTPUserAgent()))
|
conf.httpHeaders.append(("User-Agent", __defaultHTTPUserAgent()))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -63,7 +63,7 @@ CHAR_INFERENCE_MARK = "%c"
|
||||||
PRINTABLE_CHAR_REGEX = r"[^\x00-\x1f\x7e-\xff]"
|
PRINTABLE_CHAR_REGEX = r"[^\x00-\x1f\x7e-\xff]"
|
||||||
|
|
||||||
# regular expression used for extracting results from google search
|
# regular expression used for extracting results from google search
|
||||||
GOOGLE_REGEX = r"url\?q=(http[^>]+)&sa=U&"
|
GOOGLE_REGEX = r"url\?\w+=(http[^>]+)&(sa=U|rct=j)"
|
||||||
|
|
||||||
# regular expression used for extracting content from "textual" tags
|
# regular expression used for extracting content from "textual" tags
|
||||||
TEXT_TAG_REGEX = r"(?si)<(abbr|acronym|b|blockquote|br|center|cite|code|dt|em|font|h\d|i|li|p|pre|q|strong|sub|sup|td|th|title|tt|u)(?!\w).*?>(?P<result>[^<]+)"
|
TEXT_TAG_REGEX = r"(?si)<(abbr|acronym|b|blockquote|br|center|cite|code|dt|em|font|h\d|i|li|p|pre|q|strong|sub|sup|td|th|title|tt|u)(?!\w).*?>(?P<result>[^<]+)"
|
||||||
|
|
|
@ -46,7 +46,7 @@ class Google:
|
||||||
HTTP addresses
|
HTTP addresses
|
||||||
"""
|
"""
|
||||||
|
|
||||||
retVal = re.findall(GOOGLE_REGEX, page, re.I | re.S)
|
retVal = [match.group(1) for match in re.finditer(GOOGLE_REGEX, page, re.I | re.S)]
|
||||||
|
|
||||||
return retVal
|
return retVal
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user