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

Skip to content

Commit 8c9da95

Browse files
committed
Style and consistency update (url -> URL)
1 parent 3948b52 commit 8c9da95

13 files changed

Lines changed: 53 additions & 53 deletions

File tree

lib/controller/action.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
def action():
2323
"""
2424
This function exploit the SQL injection on the affected
25-
url parameter and extract requested data from the
25+
URL parameter and extract requested data from the
2626
back-end database management system or operating system
2727
if possible
2828
"""

lib/controller/checks.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ def _(page):
791791

792792
def checkDynParam(place, parameter, value):
793793
"""
794-
This function checks if the url parameter is dynamic. If it is
794+
This function checks if the URL parameter is dynamic. If it is
795795
dynamic, the content of the page differs, otherwise the
796796
dynamicity might depend on another parameter.
797797
"""
@@ -855,14 +855,14 @@ def checkDynamicContent(firstPage, secondPage):
855855
count += 1
856856

857857
if count > conf.retries:
858-
warnMsg = "target url is too dynamic. "
858+
warnMsg = "target URL is too dynamic. "
859859
warnMsg += "Switching to '--text-only' "
860860
logger.warn(warnMsg)
861861

862862
conf.textOnly = True
863863
return
864864

865-
warnMsg = "target url is heavily dynamic"
865+
warnMsg = "target URL is heavily dynamic"
866866
warnMsg += ". sqlmap is going to retry the request"
867867
logger.critical(warnMsg)
868868

@@ -880,7 +880,7 @@ def checkStability():
880880
like for instance string matching (--string).
881881
"""
882882

883-
infoMsg = "testing if the url is stable. This can take a couple of seconds"
883+
infoMsg = "testing if the target URL is stable. This can take a couple of seconds"
884884
logger.info(infoMsg)
885885

886886
firstPage = kb.originalPage # set inside checkConnection()
@@ -894,7 +894,7 @@ def checkStability():
894894

895895
if kb.pageStable:
896896
if firstPage:
897-
infoMsg = "url is stable"
897+
infoMsg = "target URL is stable"
898898
logger.info(infoMsg)
899899
else:
900900
errMsg = "there was an error checking the stability of page "
@@ -904,7 +904,7 @@ def checkStability():
904904
logger.error(errMsg)
905905

906906
else:
907-
warnMsg = "url is not stable, sqlmap will base the page "
907+
warnMsg = "target URL is not stable. sqlmap will base the page "
908908
warnMsg += "comparison on a sequence matcher. If no dynamic nor "
909909
warnMsg += "injectable parameters are detected, or in case of "
910910
warnMsg += "junk results, refer to user's manual paragraph "
@@ -1112,7 +1112,7 @@ def checkNullConnection():
11121112
if conf.data:
11131113
return False
11141114

1115-
infoMsg = "testing NULL connection to the target url"
1115+
infoMsg = "testing NULL connection to the target URL"
11161116
logger.info(infoMsg)
11171117

11181118
try:
@@ -1148,7 +1148,7 @@ def checkConnection(suppressOutput=False):
11481148
raise SqlmapConnectionException(errMsg)
11491149

11501150
if not suppressOutput and not conf.dummy:
1151-
infoMsg = "testing connection to the target url"
1151+
infoMsg = "testing connection to the target URL"
11521152
logger.info(infoMsg)
11531153

11541154
try:

lib/controller/controller.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def start():
253253

254254
if conf.configFile and not kb.targets:
255255
errMsg = "you did not edit the configuration file properly, set "
256-
errMsg += "the target url, list of targets or google dork"
256+
errMsg += "the target URL, list of targets or google dork"
257257
logger.error(errMsg)
258258
return False
259259

@@ -301,7 +301,7 @@ def start():
301301
if conf.forms:
302302
message = "[#%d] form:\n%s %s" % (hostCount, conf.method or HTTPMETHOD.GET, targetUrl)
303303
else:
304-
message = "url %d:\n%s %s%s" % (hostCount, conf.method or HTTPMETHOD.GET, targetUrl, " (PageRank: %s)" % get_pagerank(targetUrl) if conf.googleDork and conf.pageRank else "")
304+
message = "URL %d:\n%s %s%s" % (hostCount, conf.method or HTTPMETHOD.GET, targetUrl, " (PageRank: %s)" % get_pagerank(targetUrl) if conf.googleDork and conf.pageRank else "")
305305

306306
if conf.cookie:
307307
message += "\nCookie: %s" % conf.cookie
@@ -340,7 +340,7 @@ def start():
340340
break
341341

342342
else:
343-
message += "\ndo you want to test this url? [Y/n/q]"
343+
message += "\ndo you want to test this URL? [Y/n/q]"
344344
test = readInput(message, default="Y")
345345

346346
if not test or test[0] in ("y", "Y"):
@@ -350,7 +350,7 @@ def start():
350350
elif test[0] in ("q", "Q"):
351351
break
352352

353-
infoMsg = "testing url '%s'" % targetUrl
353+
infoMsg = "testing URL '%s'" % targetUrl
354354
logger.info(infoMsg)
355355

356356
setupTargetEnv()
@@ -602,7 +602,7 @@ def start():
602602
e = getUnicode(e)
603603

604604
if conf.multipleTargets:
605-
e += ", skipping to the next %s" % ("form" if conf.forms else "url")
605+
e += ", skipping to the next %s" % ("form" if conf.forms else "URL")
606606
logger.error(e)
607607
else:
608608
logger.critical(e)

lib/core/common.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ def parseTargetDirect():
11271127

11281128
def parseTargetUrl():
11291129
"""
1130-
Parse target url and set some attributes into the configuration singleton.
1130+
Parse target URL and set some attributes into the configuration singleton.
11311131
"""
11321132

11331133
if not conf.url:
@@ -1165,14 +1165,14 @@ def parseTargetUrl():
11651165
_ = None
11661166

11671167
if any((_ is None, re.search(r'\s', conf.hostname), '..' in conf.hostname, conf.hostname.startswith('.'))):
1168-
errMsg = "invalid target url"
1168+
errMsg = "invalid target URL"
11691169
raise SqlmapSyntaxException(errMsg)
11701170

11711171
if len(hostnamePort) == 2:
11721172
try:
11731173
conf.port = int(hostnamePort[1])
11741174
except:
1175-
errMsg = "invalid target url"
1175+
errMsg = "invalid target URL"
11761176
raise SqlmapSyntaxException(errMsg)
11771177
elif conf.scheme == "https":
11781178
conf.port = 443
@@ -1186,13 +1186,13 @@ def parseTargetUrl():
11861186
conf.url = conf.url.replace(URI_QUESTION_MARKER, '?')
11871187

11881188
if not conf.referer and intersect(REFERER_ALIASES, conf.testParameter, True):
1189-
debugMsg = "setting the HTTP Referer header to the target url"
1189+
debugMsg = "setting the HTTP Referer header to the target URL"
11901190
logger.debug(debugMsg)
11911191
conf.httpHeaders = filter(lambda (key, value): key != HTTP_HEADER.REFERER, conf.httpHeaders)
11921192
conf.httpHeaders.append((HTTP_HEADER.REFERER, conf.url))
11931193

11941194
if not conf.host and intersect(HOST_ALIASES, conf.testParameter, True):
1195-
debugMsg = "setting the HTTP Host header to the target url"
1195+
debugMsg = "setting the HTTP Host header to the target URL"
11961196
logger.debug(debugMsg)
11971197
conf.httpHeaders = filter(lambda (key, value): key != HTTP_HEADER.HOST, conf.httpHeaders)
11981198
conf.httpHeaders.append((HTTP_HEADER.HOST, getHostHeader(conf.url)))
@@ -2120,7 +2120,7 @@ def _(match):
21202120
return char if char in charset else match.group(0)
21212121
result = value
21222122
if plusspace:
2123-
result = result.replace("+", " ") # plus sign has a special meaning in url encoded data (hence the usage of urllib.unquote_plus in convall case)
2123+
result = result.replace("+", " ") # plus sign has a special meaning in URL encoded data (hence the usage of urllib.unquote_plus in convall case)
21242124
result = re.sub("%([0-9a-fA-F]{2})", _, result)
21252125

21262126
if isinstance(result, str):
@@ -2147,7 +2147,7 @@ def urlencode(value, safe="%&=", convall=False, limit=False, spaceplus=False):
21472147
safe = ""
21482148

21492149
# corner case when character % really needs to be
2150-
# encoded (when not representing url encoded char)
2150+
# encoded (when not representing URL encoded char)
21512151
# except in cases when tampering scripts are used
21522152
if all(map(lambda x: '%' in x, [safe, value])) and not kb.tamperFunctions:
21532153
value = re.sub("%(?![0-9a-fA-F]{2})", "%25", value)
@@ -3119,7 +3119,7 @@ def randomizeParameterValue(value):
31193119

31203120
def asciifyUrl(url, forceQuote=False):
31213121
"""
3122-
Attempts to make a unicode url usuable with ``urllib/urllib2``.
3122+
Attempts to make a unicode URL usuable with ``urllib/urllib2``.
31233123
31243124
More specifically, it attempts to convert the unicode object ``url``,
31253125
which is meant to represent a IRI, to an unicode object that,
@@ -3232,7 +3232,7 @@ def geturl(self):
32323232
try:
32333233
forms = ParseResponse(response, backwards_compat=False)
32343234
except ParseError:
3235-
warnMsg = "badly formed HTML at the given url ('%s'). Going to filter it" % url
3235+
warnMsg = "badly formed HTML at the given URL ('%s'). Going to filter it" % url
32363236
logger.warning(warnMsg)
32373237
response.seek(0)
32383238
filtered = _("".join(re.findall(FORM_SEARCH_REGEX, response.read())), response.geturl())
@@ -3279,7 +3279,7 @@ def geturl(self):
32793279
target = (url, method, data, conf.cookie)
32803280
retVal.add(target)
32813281
else:
3282-
errMsg = "there were no forms found at the given target url"
3282+
errMsg = "there were no forms found at the given target URL"
32833283
if raise_:
32843284
raise SqlmapGenericException(errMsg)
32853285
else:

lib/core/option.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def _urllib2Opener():
189189

190190
def _feedTargetsDict(reqFile, addedTargetUrls):
191191
"""
192-
Parses web scarab and burp logs and adds results to the target url list
192+
Parses web scarab and burp logs and adds results to the target URL list
193193
"""
194194

195195
def _parseWebScarabLog(content):
@@ -1045,7 +1045,7 @@ def _setSafeUrl():
10451045
conf.safUrl = "http://" + conf.safUrl
10461046

10471047
if conf.saFreq <= 0:
1048-
errMsg = "please provide a valid value (>0) for safe frequency (--safe-freq) while using safe url feature"
1048+
errMsg = "please provide a valid value (>0) for safe frequency (--safe-freq) while using safe URL feature"
10491049
raise SqlmapSyntaxException(errMsg)
10501050

10511051
def _setPrefixSuffix():

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@
307307
# Chars which can be used as a failsafe values in case of too long URL encoding value
308308
URLENCODE_FAILSAFE_CHARS = "()|,"
309309

310-
# Maximum length of urlencoded value after which failsafe procedure takes away
310+
# Maximum length of URL encoded value after which failsafe procedure takes away
311311
URLENCODE_CHAR_LIMIT = 2000
312312

313313
# Default schema for Microsoft SQL Server DBMS

lib/core/target.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,14 @@ def process(match, repl):
155155
kb.processUserMarks = True if (kb.postHint and CUSTOM_INJECTION_MARK_CHAR in conf.data) else kb.processUserMarks
156156

157157
if re.search(URI_INJECTABLE_REGEX, conf.url, re.I) and not any(place in conf.parameters for place in (PLACE.GET, PLACE.POST)) and not kb.postHint:
158-
warnMsg = "you've provided target url without any GET "
158+
warnMsg = "you've provided target URL without any GET "
159159
warnMsg += "parameters (e.g. www.site.com/article.php?id=1) "
160160
warnMsg += "and without providing any POST parameters "
161161
warnMsg += "through --data option"
162162
logger.warn(warnMsg)
163163

164164
message = "do you want to try URI injections "
165-
message += "in the target url itself? [Y/n/q] "
165+
message += "in the target URL itself? [Y/n/q] "
166166
test = readInput(message, default="Y")
167167

168168
if not test or test[0] not in ("n", "N"):
@@ -423,7 +423,7 @@ def _setResultsFile():
423423
if not conf.resultsFP:
424424
conf.resultsFilename = "%s%s%s" % (paths.SQLMAP_OUTPUT_PATH, os.sep, time.strftime(RESULTS_FILE_FORMAT).lower())
425425
conf.resultsFP = codecs.open(conf.resultsFilename, "w+", UNICODE_ENCODING, buffering=0)
426-
conf.resultsFP.writelines("Target url,Place,Parameter,Techniques%s" % os.linesep)
426+
conf.resultsFP.writelines("Target URL,Place,Parameter,Techniques%s" % os.linesep)
427427

428428
logger.info("using '%s' as the CSV results file in multiple targets mode" % conf.resultsFilename)
429429

lib/request/basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def forgeHeaders(items=None):
6161
if ("%s=" % cookie.name) in headers[HTTP_HEADER.COOKIE]:
6262
if kb.mergeCookies is None:
6363
message = "you provided a HTTP %s header value. " % HTTP_HEADER.COOKIE
64-
message += "The target url provided its own cookies within "
64+
message += "The target URL provided its own cookies within "
6565
message += "the HTTP %s header which intersect with yours. " % HTTP_HEADER.SET_COOKIE
6666
message += "Do you want to merge them in futher requests? [Y/n] "
6767
_ = readInput(message, default="Y")

lib/request/connect.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def _retryProxy(**kwargs):
126126
warnMsg += "(e.g. 'https://help.ubuntu.com/community/Tor')"
127127
else:
128128
warnMsg = "if the problem persists please check that the provided "
129-
warnMsg += "target url is valid. In case that it is, you can try to rerun "
129+
warnMsg += "target URL is valid. In case that it is, you can try to rerun "
130130
warnMsg += "with the switch '--random-agent' turned on "
131131
warnMsg += "and/or proxy switches ('--ignore-proxy', '--proxy',...)"
132132
singleTimeWarnMessage(warnMsg)
@@ -175,8 +175,8 @@ def _connReadProxy(conn):
175175
@staticmethod
176176
def getPage(**kwargs):
177177
"""
178-
This method connects to the target url or proxy and returns
179-
the target url page content
178+
This method connects to the target URL or proxy and returns
179+
the target URL page content
180180
"""
181181

182182
if conf.delay is not None and isinstance(conf.delay, (int, float)) and conf.delay > 0:
@@ -488,7 +488,7 @@ def getPage(**kwargs):
488488
if ignoreTimeout:
489489
return None, None, None
490490
else:
491-
warnMsg = "unable to connect to the target url (%d - %s)" % (e.code, httplib.responses[e.code])
491+
warnMsg = "unable to connect to the target URL (%d - %s)" % (e.code, httplib.responses[e.code])
492492
if threadData.retriesCount < conf.retries and not kb.threadException:
493493
warnMsg += ". sqlmap is going to retry the request"
494494
logger.critical(warnMsg)
@@ -506,23 +506,23 @@ def getPage(**kwargs):
506506
tbMsg = traceback.format_exc()
507507

508508
if "no host given" in tbMsg:
509-
warnMsg = "invalid url address used (%s)" % repr(url)
509+
warnMsg = "invalid URL address used (%s)" % repr(url)
510510
raise SqlmapSyntaxException(warnMsg)
511511
elif "forcibly closed" in tbMsg:
512-
warnMsg = "connection was forcibly closed by the target url"
512+
warnMsg = "connection was forcibly closed by the target URL"
513513
elif "timed out" in tbMsg:
514-
warnMsg = "connection timed out to the target url"
514+
warnMsg = "connection timed out to the target URL"
515515
elif "URLError" in tbMsg or "error" in tbMsg:
516-
warnMsg = "unable to connect to the target url"
516+
warnMsg = "unable to connect to the target URL"
517517
elif "BadStatusLine" in tbMsg:
518518
warnMsg = "connection dropped or unknown HTTP "
519519
warnMsg += "status code received. Try to force the HTTP User-Agent "
520520
warnMsg += "header with option '--user-agent' or switch '--random-agent'"
521521
elif "IncompleteRead" in tbMsg:
522522
warnMsg = "there was an incomplete read error while retrieving data "
523-
warnMsg += "from the target url"
523+
warnMsg += "from the target URL"
524524
else:
525-
warnMsg = "unable to connect to the target url"
525+
warnMsg = "unable to connect to the target URL"
526526

527527
if "BadStatusLine" not in tbMsg:
528528
warnMsg += " or proxy"
@@ -569,7 +569,7 @@ def getPage(**kwargs):
569569
@staticmethod
570570
def queryPage(value=None, place=None, content=False, getRatioValue=False, silent=False, method=None, timeBasedCompare=False, noteResponseTime=True, auxHeaders=None, response=False, raise404=None, removeReflection=True):
571571
"""
572-
This method calls a function to get the target url page content
572+
This method calls a function to get the target URL page content
573573
and returns its page MD5 hash or a boolean value in case of
574574
string match check ('--string' command line parameter)
575575
"""

lib/techniques/blind/inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ def blindThread():
450450
infoMsg = None
451451

452452
# If we have got one single character not correctly fetched it
453-
# can mean that the connection to the target url was lost
453+
# can mean that the connection to the target URL was lost
454454
if None in value:
455455
partialValue = "".join(value[:value.index(None)])
456456

0 commit comments

Comments
 (0)