Skip to content

Commit 4077cd2

Browse files
committed
Pleasing the pylint gods
1 parent 95560da commit 4077cd2

25 files changed

Lines changed: 74 additions & 75 deletions

lib/core/agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ def payload(self, place=None, parameter=None, value=None, newValue=None, where=N
172172

173173
if place in (PLACE.URI, PLACE.CUSTOM_POST, PLACE.CUSTOM_HEADER):
174174
_ = "%s%s" % (origValue, kb.customInjectionMark)
175-
if kb.postHint == POST_HINT.JSON and not isNumber(newValue) and not '"%s"' % _ in paramString:
175+
if kb.postHint == POST_HINT.JSON and not isNumber(newValue) and '"%s"' % _ not in paramString:
176176
newValue = '"%s"' % newValue
177-
elif kb.postHint == POST_HINT.JSON_LIKE and not isNumber(newValue) and not "'%s'" % _ in paramString:
177+
elif kb.postHint == POST_HINT.JSON_LIKE and not isNumber(newValue) and "'%s'" % _ not in paramString:
178178
newValue = "'%s'" % newValue
179179
newValue = newValue.replace(kb.customInjectionMark, REPLACEMENT_MARKER)
180180
retVal = paramString.replace(_, self.addPayloadDelimiters(newValue))

lib/core/common.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,7 @@ def getOs(target, info):
328328
else:
329329
return infoStr.lstrip()
330330

331-
class Backend:
332-
# Set methods
331+
class Backend(object):
333332
@staticmethod
334333
def setDbms(dbms):
335334
dbms = aliasToDbmsEnum(dbms)
@@ -3547,7 +3546,7 @@ def checkIntegrity():
35473546
retVal = True
35483547

35493548
baseTime = os.path.getmtime(paths.SQLMAP_SETTINGS_PATH) + 3600 # First hour free parking :)
3550-
for root, dirnames, filenames in os.walk(paths.SQLMAP_ROOT_PATH):
3549+
for root, _, filenames in os.walk(paths.SQLMAP_ROOT_PATH):
35513550
for filename in filenames:
35523551
if re.search(r"(\.py|\.xml|_)\Z", filename):
35533552
filepath = os.path.join(root, filename)

lib/core/compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def jumpahead(self, n):
110110
period.
111111
"""
112112

113-
if not n >= 0:
113+
if n < 0:
114114
raise ValueError("n must be >= 0")
115115
x, y, z = self._seed
116116
x = int(x * pow(171, n, 30269)) % 30269

lib/core/enums.py

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
See the file 'LICENSE' for copying permission
66
"""
77

8-
class PRIORITY:
8+
class PRIORITY(object):
99
LOWEST = -100
1010
LOWER = -50
1111
LOW = -10
@@ -14,7 +14,7 @@ class PRIORITY:
1414
HIGHER = 50
1515
HIGHEST = 100
1616

17-
class SORT_ORDER:
17+
class SORT_ORDER(object):
1818
FIRST = 0
1919
SECOND = 1
2020
THIRD = 2
@@ -23,15 +23,15 @@ class SORT_ORDER:
2323
LAST = 100
2424

2525
# Reference: https://docs.python.org/2/library/logging.html#logging-levels
26-
class LOGGING_LEVELS:
26+
class LOGGING_LEVELS(object):
2727
NOTSET = 0
2828
DEBUG = 10
2929
INFO = 20
3030
WARNING = 30
3131
ERROR = 40
3232
CRITICAL = 50
3333

34-
class DBMS:
34+
class DBMS(object):
3535
ACCESS = "Microsoft Access"
3636
DB2 = "IBM DB2"
3737
FIREBIRD = "Firebird"
@@ -46,7 +46,7 @@ class DBMS:
4646
H2 = "H2"
4747
INFORMIX = "Informix"
4848

49-
class DBMS_DIRECTORY_NAME:
49+
class DBMS_DIRECTORY_NAME(object):
5050
ACCESS = "access"
5151
DB2 = "db2"
5252
FIREBIRD = "firebird"
@@ -61,16 +61,16 @@ class DBMS_DIRECTORY_NAME:
6161
H2 = "h2"
6262
INFORMIX = "informix"
6363

64-
class CUSTOM_LOGGING:
64+
class CUSTOM_LOGGING(object):
6565
PAYLOAD = 9
6666
TRAFFIC_OUT = 8
6767
TRAFFIC_IN = 7
6868

69-
class OS:
69+
class OS(object):
7070
LINUX = "Linux"
7171
WINDOWS = "Windows"
7272

73-
class PLACE:
73+
class PLACE(object):
7474
GET = "GET"
7575
POST = "POST"
7676
URI = "URI"
@@ -81,15 +81,15 @@ class PLACE:
8181
CUSTOM_POST = "(custom) POST"
8282
CUSTOM_HEADER = "(custom) HEADER"
8383

84-
class POST_HINT:
84+
class POST_HINT(object):
8585
SOAP = "SOAP"
8686
JSON = "JSON"
8787
JSON_LIKE = "JSON-like"
8888
MULTIPART = "MULTIPART"
8989
XML = "XML (generic)"
9090
ARRAY_LIKE = "Array-like"
9191

92-
class HTTPMETHOD:
92+
class HTTPMETHOD(object):
9393
GET = "GET"
9494
POST = "POST"
9595
HEAD = "HEAD"
@@ -100,28 +100,28 @@ class HTTPMETHOD:
100100
CONNECT = "CONNECT"
101101
PATCH = "PATCH"
102102

103-
class NULLCONNECTION:
103+
class NULLCONNECTION(object):
104104
HEAD = "HEAD"
105105
RANGE = "Range"
106106
SKIP_READ = "skip-read"
107107

108-
class REFLECTIVE_COUNTER:
108+
class REFLECTIVE_COUNTER(object):
109109
MISS = "MISS"
110110
HIT = "HIT"
111111

112-
class CHARSET_TYPE:
112+
class CHARSET_TYPE(object):
113113
BINARY = 1
114114
DIGITS = 2
115115
HEXADECIMAL = 3
116116
ALPHA = 4
117117
ALPHANUM = 5
118118

119-
class HEURISTIC_TEST:
119+
class HEURISTIC_TEST(object):
120120
CASTED = 1
121121
NEGATIVE = 2
122122
POSITIVE = 3
123123

124-
class HASH:
124+
class HASH(object):
125125
MYSQL = r'(?i)\A\*[0-9a-f]{40}\Z'
126126
MYSQL_OLD = r'(?i)\A(?![0-9]+\Z)[0-9a-f]{16}\Z'
127127
POSTGRES = r'(?i)\Amd5[0-9a-f]{32}\Z'
@@ -155,7 +155,7 @@ class HASH:
155155
SHA512_BASE64 = r'\A[a-zA-Z0-9+/]{86}==\Z'
156156

157157
# Reference: http://www.zytrax.com/tech/web/mobile_ids.html
158-
class MOBILES:
158+
class MOBILES(object):
159159
BLACKBERRY = ("BlackBerry Z10", "Mozilla/5.0 (BB10; Kbd) AppleWebKit/537.35+ (KHTML, like Gecko) Version/10.3.3.2205 Mobile Safari/537.35+")
160160
GALAXY = ("Samsung Galaxy S7", "Mozilla/5.0 (Linux; Android 7.0; SM-G930V Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.125 Mobile Safari/537.36")
161161
HP = ("HP iPAQ 6365", "Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320; HP iPAQ h6300)")
@@ -168,23 +168,23 @@ class MOBILES:
168168
PIXEL = ("Google Pixel", "Mozilla/5.0 (Linux; Android 8.0.0; Pixel Build/OPR3.170623.013) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.111 Mobile Safari/537.36")
169169
XIAOMI = ("Xiaomi Mi 3", "Mozilla/5.0 (Linux; U; Android 4.4.4; en-gb; MI 3W Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Mobile Safari/537.36 XiaoMi/MiuiBrowser/2.1.1")
170170

171-
class PROXY_TYPE:
171+
class PROXY_TYPE(object):
172172
HTTP = "HTTP"
173173
HTTPS = "HTTPS"
174174
SOCKS4 = "SOCKS4"
175175
SOCKS5 = "SOCKS5"
176176

177-
class REGISTRY_OPERATION:
177+
class REGISTRY_OPERATION(object):
178178
READ = "read"
179179
ADD = "add"
180180
DELETE = "delete"
181181

182-
class DUMP_FORMAT:
182+
class DUMP_FORMAT(object):
183183
CSV = "CSV"
184184
HTML = "HTML"
185185
SQLITE = "SQLITE"
186186

187-
class HTTP_HEADER:
187+
class HTTP_HEADER(object):
188188
ACCEPT = "Accept"
189189
ACCEPT_CHARSET = "Accept-Charset"
190190
ACCEPT_ENCODING = "Accept-Encoding"
@@ -217,17 +217,17 @@ class HTTP_HEADER:
217217
X_POWERED_BY = "X-Powered-By"
218218
X_DATA_ORIGIN = "X-Data-Origin"
219219

220-
class EXPECTED:
220+
class EXPECTED(object):
221221
BOOL = "bool"
222222
INT = "int"
223223

224-
class OPTION_TYPE:
224+
class OPTION_TYPE(object):
225225
BOOLEAN = "boolean"
226226
INTEGER = "integer"
227227
FLOAT = "float"
228228
STRING = "string"
229229

230-
class HASHDB_KEYS:
230+
class HASHDB_KEYS(object):
231231
DBMS = "DBMS"
232232
DBMS_FORK = "DBMS_FORK"
233233
CHECK_WAF_RESULT = "CHECK_WAF_RESULT"
@@ -243,11 +243,11 @@ class HASHDB_KEYS:
243243
KB_XP_CMDSHELL_AVAILABLE = "KB_XP_CMDSHELL_AVAILABLE"
244244
OS = "OS"
245245

246-
class REDIRECTION:
246+
class REDIRECTION(object):
247247
YES = "Y"
248248
NO = "N"
249249

250-
class PAYLOAD:
250+
class PAYLOAD(object):
251251
SQLINJECTION = {
252252
1: "boolean-based blind",
253253
2: "error-based",
@@ -286,42 +286,42 @@ class PAYLOAD:
286286
9: "Pre-WHERE (non-query)",
287287
}
288288

289-
class METHOD:
289+
class METHOD(object):
290290
COMPARISON = "comparison"
291291
GREP = "grep"
292292
TIME = "time"
293293
UNION = "union"
294294

295-
class TECHNIQUE:
295+
class TECHNIQUE(object):
296296
BOOLEAN = 1
297297
ERROR = 2
298298
QUERY = 3
299299
STACKED = 4
300300
TIME = 5
301301
UNION = 6
302302

303-
class WHERE:
303+
class WHERE(object):
304304
ORIGINAL = 1
305305
NEGATIVE = 2
306306
REPLACE = 3
307307

308-
class WIZARD:
308+
class WIZARD(object):
309309
BASIC = ("getBanner", "getCurrentUser", "getCurrentDb", "isDba")
310310
INTERMEDIATE = ("getBanner", "getCurrentUser", "getCurrentDb", "isDba", "getUsers", "getDbs", "getTables", "getSchema", "excludeSysDbs")
311311
ALL = ("getBanner", "getCurrentUser", "getCurrentDb", "isDba", "getHostname", "getUsers", "getPasswordHashes", "getPrivileges", "getRoles", "dumpAll")
312312

313-
class ADJUST_TIME_DELAY:
313+
class ADJUST_TIME_DELAY(object):
314314
DISABLE = -1
315315
NO = 0
316316
YES = 1
317317

318-
class WEB_PLATFORM:
318+
class WEB_PLATFORM(object):
319319
PHP = "php"
320320
ASP = "asp"
321321
ASPX = "aspx"
322322
JSP = "jsp"
323323

324-
class CONTENT_TYPE:
324+
class CONTENT_TYPE(object):
325325
TARGET = 0
326326
TECHNIQUES = 1
327327
DBMS_FINGERPRINT = 2
@@ -350,26 +350,26 @@ class CONTENT_TYPE:
350350
REG_READ = 25
351351
STATEMENTS = 26
352352

353-
class CONTENT_STATUS:
353+
class CONTENT_STATUS(object):
354354
IN_PROGRESS = 0
355355
COMPLETE = 1
356356

357-
class AUTH_TYPE:
357+
class AUTH_TYPE(object):
358358
BASIC = "basic"
359359
DIGEST = "digest"
360360
NTLM = "ntlm"
361361
PKI = "pki"
362362

363-
class AUTOCOMPLETE_TYPE:
363+
class AUTOCOMPLETE_TYPE(object):
364364
SQL = 0
365365
OS = 1
366366
SQLMAP = 2
367367
API = 3
368368

369-
class NOTE:
369+
class NOTE(object):
370370
FALSE_POSITIVE_OR_UNEXPLOITABLE = "false positive or unexploitable"
371371

372-
class MKSTEMP_PREFIX:
372+
class MKSTEMP_PREFIX(object):
373373
HASHES = "sqlmaphashes-"
374374
CRAWLER = "sqlmapcrawler-"
375375
IPC = "sqlmapipc-"
@@ -381,11 +381,11 @@ class MKSTEMP_PREFIX:
381381
SPECIFIC_RESPONSE = "sqlmapresponse-"
382382
PREPROCESS = "sqlmappreprocess-"
383383

384-
class TIMEOUT_STATE:
384+
class TIMEOUT_STATE(object):
385385
NORMAL = 0
386386
EXCEPTION = 1
387387
TIMEOUT = 2
388388

389-
class HINT:
389+
class HINT(object):
390390
PREPEND = 0
391391
APPEND = 1

lib/core/replication.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __init__(self, dbpath):
3232
errMsg += "file '%s' ('%s')" % (self.filepath, getSafeExString(ex))
3333
raise SqlmapConnectionException(errMsg)
3434

35-
class DataType:
35+
class DataType(object):
3636
"""
3737
Using this class we define auxiliary objects
3838
used for representing sqlite data types.
@@ -47,7 +47,7 @@ def __str__(self):
4747
def __repr__(self):
4848
return "<DataType: %s>" % self
4949

50-
class Table:
50+
class Table(object):
5151
"""
5252
This class defines methods used to manipulate table objects.
5353
"""

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.3.5.152"
21+
VERSION = "1.3.5.153"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/core/subprocessng.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def send(self, input):
9494

9595
try:
9696
x = msvcrt.get_osfhandle(self.stdin.fileno())
97-
(errCode, written) = WriteFile(x, input)
97+
(_, written) = WriteFile(x, input)
9898
except ValueError:
9999
return self._close('stdin')
100100
except (subprocess.pywintypes.error, Exception) as ex:
@@ -111,11 +111,11 @@ def _recv(self, which, maxsize):
111111

112112
try:
113113
x = msvcrt.get_osfhandle(conn.fileno())
114-
(read, nAvail, nMessage) = PeekNamedPipe(x, 0)
114+
(read, nAvail, _) = PeekNamedPipe(x, 0)
115115
if maxsize < nAvail:
116116
nAvail = maxsize
117117
if nAvail > 0:
118-
(errCode, read) = ReadFile(x, nAvail, None)
118+
(_, read) = ReadFile(x, nAvail, None)
119119
except (ValueError, NameError):
120120
return self._close(which)
121121
except (subprocess.pywintypes.error, Exception) as ex:

lib/core/testing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def smokeTest():
169169
logger.setLevel(logging.CRITICAL)
170170
kb.smokeMode = True
171171

172-
(failure_count, test_count) = doctest.testmod(module)
172+
(failure_count, _) = doctest.testmod(module)
173173

174174
kb.smokeMode = False
175175
logger.setLevel(logging.INFO)

lib/takeover/icmpsh.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from lib.core.data import paths
2323
from lib.core.exception import SqlmapDataException
2424

25-
class ICMPsh:
25+
class ICMPsh(object):
2626
"""
2727
This class defines methods to call icmpsh for plugins.
2828
"""

0 commit comments

Comments
 (0)