Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit efd27d7

Browse files
committed
minor renaming
1 parent ccd6fb7 commit efd27d7

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

lib/core/agent.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
from lib.core.enums import PAYLOAD
2525
from lib.core.enums import PLACE
2626
from lib.core.exception import sqlmapNoneDataException
27+
from lib.core.settings import CUSTOM_INJECTION_MARK_CHAR
2728
from lib.core.settings import FROM_DUMMY_TABLE
2829
from lib.core.settings import PAYLOAD_DELIMITER
29-
from lib.core.settings import URI_INJECTION_MARK_CHAR
3030
from lib.core.unescaper import unescaper
3131

3232
class Agent:
@@ -76,7 +76,7 @@ def payload(self, place=None, parameter=None, value=None, newValue=None, where=N
7676
origValue = paramDict[parameter]
7777

7878
if place == PLACE.URI:
79-
origValue = origValue.split(URI_INJECTION_MARK_CHAR)[0]
79+
origValue = origValue.split(CUSTOM_INJECTION_MARK_CHAR)[0]
8080
origValue = origValue[origValue.rfind('/') + 1:]
8181
for char in ('?', '=', ':'):
8282
if char in origValue:
@@ -113,7 +113,7 @@ def payload(self, place=None, parameter=None, value=None, newValue=None, where=N
113113

114114
retValue = ET.tostring(root)
115115
elif place == PLACE.URI:
116-
retValue = paramString.replace("%s%s" % (origValue, URI_INJECTION_MARK_CHAR), self.addPayloadDelimiters(newValue))
116+
retValue = paramString.replace("%s%s" % (origValue, CUSTOM_INJECTION_MARK_CHAR), self.addPayloadDelimiters(newValue))
117117
elif place in (PLACE.UA, PLACE.REFERER, PLACE.HOST):
118118
retValue = paramString.replace(origValue, self.addPayloadDelimiters(newValue))
119119
else:

lib/core/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
from lib.core.exception import sqlmapSilentQuitException
7979
from lib.core.exception import sqlmapSyntaxException
8080
from lib.core.optiondict import optDict
81+
from lib.core.settings import CUSTOM_INJECTION_MARK_CHAR
8182
from lib.core.settings import DEFAULT_COOKIE_DELIMITER
8283
from lib.core.settings import DEFAULT_GET_POST_DELIMITER
8384
from lib.core.settings import DUMMY_USER_INJECTION
@@ -126,7 +127,6 @@
126127
from lib.core.settings import SENSITIVE_DATA_REGEX
127128
from lib.core.settings import TEXT_TAG_REGEX
128129
from lib.core.settings import UNION_UNIQUE_FIFO_LENGTH
129-
from lib.core.settings import URI_INJECTION_MARK_CHAR
130130
from lib.core.settings import URI_QUESTION_MARKER
131131
from lib.core.threads import getCurrentThreadData
132132

@@ -1072,7 +1072,7 @@ def parseTargetUrl():
10721072
else:
10731073
conf.url = "http://" + conf.url
10741074

1075-
if URI_INJECTION_MARK_CHAR in conf.url:
1075+
if CUSTOM_INJECTION_MARK_CHAR in conf.url:
10761076
conf.url = conf.url.replace('?', URI_QUESTION_MARKER)
10771077

10781078
__urlSplit = urlparse.urlsplit(conf.url)

lib/core/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,8 @@
317317
# Maximum value for comparison ratio
318318
MAX_RATIO = 1.0
319319

320-
# Character used for marking injectable position inside URI
321-
URI_INJECTION_MARK_CHAR = '*'
320+
# Character used for marking injectable position inside provided data
321+
CUSTOM_INJECTION_MARK_CHAR = '*'
322322

323323
# Maximum length used for retrieving data over MySQL error based payload due to "known" problems with longer result strings
324324
MYSQL_ERROR_CHUNK_LENGTH = 50

lib/core/target.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@
3737
from lib.core.option import __setDBMS
3838
from lib.core.option import __setKnowledgeBaseAttributes
3939
from lib.core.session import resumeConfKb
40+
from lib.core.settings import CUSTOM_INJECTION_MARK_CHAR
4041
from lib.core.settings import HOST_ALIASES
4142
from lib.core.settings import REFERER_ALIASES
4243
from lib.core.settings import RESULTS_FILE_FORMAT
4344
from lib.core.settings import SOAP_REGEX
4445
from lib.core.settings import UNENCODED_ORIGINAL_VALUE
4546
from lib.core.settings import UNICODE_ENCODING
4647
from lib.core.settings import URI_INJECTABLE_REGEX
47-
from lib.core.settings import URI_INJECTION_MARK_CHAR
4848
from lib.core.settings import USER_AGENT_ALIASES
4949
from lib.utils.hashdb import HashDB
5050
from lib.core.xmldump import dumper as xmldumper
@@ -110,16 +110,16 @@ def __setRequestParams():
110110
test = readInput(message, default="Y")
111111

112112
if not test or test[0] in ("y", "Y"):
113-
conf.url = "%s%s" % (conf.url, URI_INJECTION_MARK_CHAR)
113+
conf.url = "%s%s" % (conf.url, CUSTOM_INJECTION_MARK_CHAR)
114114
elif test[0] in ("n", "N"):
115115
pass
116116
elif test[0] in ("q", "Q"):
117117
raise sqlmapUserQuitException
118118

119-
if URI_INJECTION_MARK_CHAR in conf.url:
119+
if CUSTOM_INJECTION_MARK_CHAR in conf.url:
120120
conf.parameters[PLACE.URI] = conf.url
121121
conf.paramDict[PLACE.URI] = {}
122-
parts = conf.url.split(URI_INJECTION_MARK_CHAR)
122+
parts = conf.url.split(CUSTOM_INJECTION_MARK_CHAR)
123123

124124
for i in xrange(len(parts)-1):
125125
result = str()
@@ -128,11 +128,11 @@ def __setRequestParams():
128128
result += parts[j]
129129

130130
if i == j:
131-
result += URI_INJECTION_MARK_CHAR
131+
result += CUSTOM_INJECTION_MARK_CHAR
132132

133-
conf.paramDict[PLACE.URI]["#%d%s" % (i+1, URI_INJECTION_MARK_CHAR)] = result
133+
conf.paramDict[PLACE.URI]["#%d%s" % (i+1, CUSTOM_INJECTION_MARK_CHAR)] = result
134134

135-
conf.url = conf.url.replace(URI_INJECTION_MARK_CHAR, str())
135+
conf.url = conf.url.replace(CUSTOM_INJECTION_MARK_CHAR, str())
136136
__testableParameters = True
137137

138138
# Perform checks on Cookie parameters

0 commit comments

Comments
 (0)