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

Skip to content

Commit 9fcab68

Browse files
committed
Minor adjustments
1 parent 0a378c1 commit 9fcab68

4 files changed

Lines changed: 20 additions & 15 deletions

File tree

lib/core/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1437,12 +1437,13 @@ def getUnicode(value, encoding=None):
14371437
>>> getUnicode(1)
14381438
u'1'
14391439
"""
1440+
14401441
if encoding is None:
14411442
encoding = conf.dataEncoding if 'dataEncoding' in conf else "utf-8"
14421443
if isinstance(value, basestring):
14431444
return value if isinstance(value, unicode) else unicode(value, encoding, errors='replace')
14441445
else:
1445-
return unicode(value) #encoding ignored for non-basestring instances
1446+
return unicode(value) # encoding ignored for non-basestring instances
14461447

14471448
# http://boredzo.org/blog/archives/2007-01-06/longest-common-prefix-in-python-2
14481449
def longestCommonPrefix(*sequences):

lib/core/dump.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ def __init__(self):
3131
self.__outputFP = None
3232

3333
def __write(self, data, n=True):
34-
text = "%s%s" % (data, "\n" if n else " ")
35-
34+
text = "%s%s" % (data, "\n" if n else " ")
3635
dataToStdout(text)
36+
3737
self.__outputFP.write(text)
3838
self.__outputFP.flush()
3939

lib/core/option.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ def __setHTTPProxy():
599599
__scheme = __proxySplit[0]
600600
__hostname = __hostnamePort[0]
601601
__port = None
602+
__proxyString = ""
602603

603604
if len(__hostnamePort) == 2:
604605
try:
@@ -619,9 +620,9 @@ def __setHTTPProxy():
619620
raise sqlmapSyntaxException, errMsg
620621

621622
# Reference: http://stackoverflow.com/questions/34079/how-to-specify-an-authenticated-proxy-for-a-python-http-connection
622-
__proxyString = "%s@%s:%d" % (conf.pCred, __hostname, __port)
623-
else:
624-
__proxyString = "%s:%d" % (__hostname, __port)
623+
__proxyString = "%s@" % conf.pCred
624+
625+
__proxyString += "%s:%d" % (__hostname, __port)
625626

626627
# Workaround for http://bugs.python.org/issue1424152 (urllib/urllib2:
627628
# HTTPS over (Squid) Proxy fails) as long as HTTP over SSL requests
@@ -1184,19 +1185,17 @@ def __basicOptionValidation():
11841185
errMsg = "value for --stop (limitStop) option must be an integer value greater than zero (>0)"
11851186
raise sqlmapSyntaxException, errMsg
11861187

1187-
if conf.limitStart is not None and isinstance(conf.limitStart, int) and conf.limitStart > 0 and\
1188+
if conf.limitStart is not None and isinstance(conf.limitStart, int) and conf.limitStart > 0 and \
11881189
conf.limitStop is not None and isinstance(conf.limitStop, int) and conf.limitStop > 0 and conf.limitStop <= conf.limitStart:
11891190
errMsg = "value for --start (limitStart) option must be smaller than value for --stop (limitStop) option"
11901191
raise sqlmapSyntaxException, errMsg
11911192

1192-
if conf.cpuThrottle is not None and isinstance(conf.cpuThrottle, int) and (conf.cpuThrottle > 100 or\
1193-
conf.cpuThrottle < 0):
1193+
if conf.cpuThrottle is not None and isinstance(conf.cpuThrottle, int) and (conf.cpuThrottle > 100 or conf.cpuThrottle < 0):
11941194
errMsg = "value for --cpu-throttle (cpuThrottle) option must be in range [0,100]"
11951195
raise sqlmapSyntaxException, errMsg
11961196

1197-
if conf.matchRatio is not None and isinstance(conf.matchRatio, float) and (conf.matchRatio > 1 or\
1198-
conf.cpuThrottle < 0):
1199-
errMsg = "value for --ratio (matchRatio) option must be in range [0,1]"
1197+
if conf.thold is not None and isinstance(conf.thold, float) and (conf.thold > 1 or conf.cpuThrottle < 0):
1198+
errMsg = "value for --threshold (thold) option must be in range [0,1]"
12001199
raise sqlmapSyntaxException, errMsg
12011200

12021201
if conf.textOnly and conf.useNullConnection:

sqlmap.conf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ headers = Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9
7575
# Valid: Basic, Digest or NTLM
7676
aType =
7777

78-
# HTTP Authentication credentials. Useful only if the target url requires
78+
# HTTP authentication credentials. Useful only if the target url requires
7979
# HTTP Basic, Digest or NTLM authentication and you have such data.
8080
# Syntax: username:password
8181
aCred =
@@ -92,6 +92,11 @@ keepAlive = False
9292
# Syntax: http://address:port
9393
proxy =
9494

95+
# HTTP proxy authentication credentials. Useful only if the proxy requires
96+
# HTTP Basic or Digest authentication and you have such data.
97+
# Syntax: username:password
98+
pCred =
99+
95100
# Ignore system default HTTP proxy
96101
# Valid: True or False
97102
ignoreProxy = False
@@ -178,7 +183,7 @@ string =
178183
regexp =
179184

180185
# String to be excluded by the page content before calculating the page
181-
# MD5 hash
186+
# MD5 hash.
182187
eString =
183188

184189
# Regular expression matches to be excluded by the page content before
@@ -187,7 +192,7 @@ eString =
187192
# (http://www.python.org/doc/2.5.2/lib/re-syntax.html)
188193
eRegexp =
189194

190-
# Page comparison threshold value (aka matchRatio)
195+
# Page comparison threshold value.
191196
# Valid: 0.0-1.0
192197
thold =
193198

0 commit comments

Comments
 (0)