mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-03 05:04:11 +03:00
Minor refactoring
This commit is contained in:
parent
a8aecaa036
commit
763dc98311
|
@ -45,6 +45,12 @@ PAYLOAD_DELIMITER = "\x00"
|
|||
CHAR_INFERENCE_MARK = "%c"
|
||||
PRINTABLE_CHAR_REGEX = r"[^\x00-\x1f\x7e-\xff]"
|
||||
|
||||
# regular expression used for recognition of generic permission messages
|
||||
PERMISSION_DENIED_REGEX = r"(command|permission|access)\s*(was|is)?\s*denied"
|
||||
|
||||
# regular expression used for recognition of generic maximum connection messages
|
||||
MAX_CONNECTIONS_REGEX = r"max.+connections"
|
||||
|
||||
# regular expression used for extracting results from google search
|
||||
GOOGLE_REGEX = r"url\?\w+=(http[^>]+)&(sa=U|rct=j)"
|
||||
|
||||
|
|
|
@ -53,11 +53,13 @@ from lib.core.settings import HTTP_ACCEPT_HEADER_VALUE
|
|||
from lib.core.settings import HTTP_ACCEPT_ENCODING_HEADER_VALUE
|
||||
from lib.core.settings import HTTP_SILENT_TIMEOUT
|
||||
from lib.core.settings import MAX_CONNECTION_CHUNK_SIZE
|
||||
from lib.core.settings import MAX_CONNECTIONS_REGEX
|
||||
from lib.core.settings import MAX_CONNECTION_TOTAL_SIZE
|
||||
from lib.core.settings import META_REFRESH_REGEX
|
||||
from lib.core.settings import MIN_TIME_RESPONSES
|
||||
from lib.core.settings import IS_WIN
|
||||
from lib.core.settings import LARGE_CHUNK_TRIM_MARKER
|
||||
from lib.core.settings import PERMISSION_DENIED_REGEX
|
||||
from lib.core.settings import UNENCODED_ORIGINAL_VALUE
|
||||
from lib.core.settings import URI_HTTP_HEADER
|
||||
from lib.core.settings import WARN_TIME_STDEV
|
||||
|
@ -766,8 +768,8 @@ class Connect:
|
|||
if not response and removeReflection:
|
||||
page = removeReflectiveValues(page, payload)
|
||||
|
||||
kb.maxConnectionsFlag = re.search(r"max.+connections", page or "", re.I) is not None
|
||||
kb.permissionFlag = re.search(r"(command|permission|access)\s*(was|is)?\s*denied", page or "", re.I) is not None
|
||||
kb.maxConnectionsFlag = re.search(MAX_CONNECTIONS_REGEX, page or "", re.I) is not None
|
||||
kb.permissionFlag = re.search(PERMISSION_DENIED_REGEX, page or "", re.I) is not None
|
||||
|
||||
if content or response:
|
||||
return page, headers
|
||||
|
|
Loading…
Reference in New Issue
Block a user