Pleasing the pylint gods

This commit is contained in:
Miroslav Stampar 2019-05-29 16:42:04 +02:00
parent 95560da7c1
commit 4077cd2342
25 changed files with 74 additions and 75 deletions

View File

@ -172,9 +172,9 @@ class Agent(object):
if place in (PLACE.URI, PLACE.CUSTOM_POST, PLACE.CUSTOM_HEADER): if place in (PLACE.URI, PLACE.CUSTOM_POST, PLACE.CUSTOM_HEADER):
_ = "%s%s" % (origValue, kb.customInjectionMark) _ = "%s%s" % (origValue, kb.customInjectionMark)
if kb.postHint == POST_HINT.JSON and not isNumber(newValue) and not '"%s"' % _ in paramString: if kb.postHint == POST_HINT.JSON and not isNumber(newValue) and '"%s"' % _ not in paramString:
newValue = '"%s"' % newValue newValue = '"%s"' % newValue
elif kb.postHint == POST_HINT.JSON_LIKE and not isNumber(newValue) and not "'%s'" % _ in paramString: elif kb.postHint == POST_HINT.JSON_LIKE and not isNumber(newValue) and "'%s'" % _ not in paramString:
newValue = "'%s'" % newValue newValue = "'%s'" % newValue
newValue = newValue.replace(kb.customInjectionMark, REPLACEMENT_MARKER) newValue = newValue.replace(kb.customInjectionMark, REPLACEMENT_MARKER)
retVal = paramString.replace(_, self.addPayloadDelimiters(newValue)) retVal = paramString.replace(_, self.addPayloadDelimiters(newValue))

View File

@ -328,8 +328,7 @@ class Format(object):
else: else:
return infoStr.lstrip() return infoStr.lstrip()
class Backend: class Backend(object):
# Set methods
@staticmethod @staticmethod
def setDbms(dbms): def setDbms(dbms):
dbms = aliasToDbmsEnum(dbms) dbms = aliasToDbmsEnum(dbms)
@ -3547,7 +3546,7 @@ def checkIntegrity():
retVal = True retVal = True
baseTime = os.path.getmtime(paths.SQLMAP_SETTINGS_PATH) + 3600 # First hour free parking :) baseTime = os.path.getmtime(paths.SQLMAP_SETTINGS_PATH) + 3600 # First hour free parking :)
for root, dirnames, filenames in os.walk(paths.SQLMAP_ROOT_PATH): for root, _, filenames in os.walk(paths.SQLMAP_ROOT_PATH):
for filename in filenames: for filename in filenames:
if re.search(r"(\.py|\.xml|_)\Z", filename): if re.search(r"(\.py|\.xml|_)\Z", filename):
filepath = os.path.join(root, filename) filepath = os.path.join(root, filename)

View File

@ -110,7 +110,7 @@ class WichmannHill(random.Random):
period. period.
""" """
if not n >= 0: if n < 0:
raise ValueError("n must be >= 0") raise ValueError("n must be >= 0")
x, y, z = self._seed x, y, z = self._seed
x = int(x * pow(171, n, 30269)) % 30269 x = int(x * pow(171, n, 30269)) % 30269

View File

@ -5,7 +5,7 @@ Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
See the file 'LICENSE' for copying permission See the file 'LICENSE' for copying permission
""" """
class PRIORITY: class PRIORITY(object):
LOWEST = -100 LOWEST = -100
LOWER = -50 LOWER = -50
LOW = -10 LOW = -10
@ -14,7 +14,7 @@ class PRIORITY:
HIGHER = 50 HIGHER = 50
HIGHEST = 100 HIGHEST = 100
class SORT_ORDER: class SORT_ORDER(object):
FIRST = 0 FIRST = 0
SECOND = 1 SECOND = 1
THIRD = 2 THIRD = 2
@ -23,7 +23,7 @@ class SORT_ORDER:
LAST = 100 LAST = 100
# Reference: https://docs.python.org/2/library/logging.html#logging-levels # Reference: https://docs.python.org/2/library/logging.html#logging-levels
class LOGGING_LEVELS: class LOGGING_LEVELS(object):
NOTSET = 0 NOTSET = 0
DEBUG = 10 DEBUG = 10
INFO = 20 INFO = 20
@ -31,7 +31,7 @@ class LOGGING_LEVELS:
ERROR = 40 ERROR = 40
CRITICAL = 50 CRITICAL = 50
class DBMS: class DBMS(object):
ACCESS = "Microsoft Access" ACCESS = "Microsoft Access"
DB2 = "IBM DB2" DB2 = "IBM DB2"
FIREBIRD = "Firebird" FIREBIRD = "Firebird"
@ -46,7 +46,7 @@ class DBMS:
H2 = "H2" H2 = "H2"
INFORMIX = "Informix" INFORMIX = "Informix"
class DBMS_DIRECTORY_NAME: class DBMS_DIRECTORY_NAME(object):
ACCESS = "access" ACCESS = "access"
DB2 = "db2" DB2 = "db2"
FIREBIRD = "firebird" FIREBIRD = "firebird"
@ -61,16 +61,16 @@ class DBMS_DIRECTORY_NAME:
H2 = "h2" H2 = "h2"
INFORMIX = "informix" INFORMIX = "informix"
class CUSTOM_LOGGING: class CUSTOM_LOGGING(object):
PAYLOAD = 9 PAYLOAD = 9
TRAFFIC_OUT = 8 TRAFFIC_OUT = 8
TRAFFIC_IN = 7 TRAFFIC_IN = 7
class OS: class OS(object):
LINUX = "Linux" LINUX = "Linux"
WINDOWS = "Windows" WINDOWS = "Windows"
class PLACE: class PLACE(object):
GET = "GET" GET = "GET"
POST = "POST" POST = "POST"
URI = "URI" URI = "URI"
@ -81,7 +81,7 @@ class PLACE:
CUSTOM_POST = "(custom) POST" CUSTOM_POST = "(custom) POST"
CUSTOM_HEADER = "(custom) HEADER" CUSTOM_HEADER = "(custom) HEADER"
class POST_HINT: class POST_HINT(object):
SOAP = "SOAP" SOAP = "SOAP"
JSON = "JSON" JSON = "JSON"
JSON_LIKE = "JSON-like" JSON_LIKE = "JSON-like"
@ -89,7 +89,7 @@ class POST_HINT:
XML = "XML (generic)" XML = "XML (generic)"
ARRAY_LIKE = "Array-like" ARRAY_LIKE = "Array-like"
class HTTPMETHOD: class HTTPMETHOD(object):
GET = "GET" GET = "GET"
POST = "POST" POST = "POST"
HEAD = "HEAD" HEAD = "HEAD"
@ -100,28 +100,28 @@ class HTTPMETHOD:
CONNECT = "CONNECT" CONNECT = "CONNECT"
PATCH = "PATCH" PATCH = "PATCH"
class NULLCONNECTION: class NULLCONNECTION(object):
HEAD = "HEAD" HEAD = "HEAD"
RANGE = "Range" RANGE = "Range"
SKIP_READ = "skip-read" SKIP_READ = "skip-read"
class REFLECTIVE_COUNTER: class REFLECTIVE_COUNTER(object):
MISS = "MISS" MISS = "MISS"
HIT = "HIT" HIT = "HIT"
class CHARSET_TYPE: class CHARSET_TYPE(object):
BINARY = 1 BINARY = 1
DIGITS = 2 DIGITS = 2
HEXADECIMAL = 3 HEXADECIMAL = 3
ALPHA = 4 ALPHA = 4
ALPHANUM = 5 ALPHANUM = 5
class HEURISTIC_TEST: class HEURISTIC_TEST(object):
CASTED = 1 CASTED = 1
NEGATIVE = 2 NEGATIVE = 2
POSITIVE = 3 POSITIVE = 3
class HASH: class HASH(object):
MYSQL = r'(?i)\A\*[0-9a-f]{40}\Z' MYSQL = r'(?i)\A\*[0-9a-f]{40}\Z'
MYSQL_OLD = r'(?i)\A(?![0-9]+\Z)[0-9a-f]{16}\Z' MYSQL_OLD = r'(?i)\A(?![0-9]+\Z)[0-9a-f]{16}\Z'
POSTGRES = r'(?i)\Amd5[0-9a-f]{32}\Z' POSTGRES = r'(?i)\Amd5[0-9a-f]{32}\Z'
@ -155,7 +155,7 @@ class HASH:
SHA512_BASE64 = r'\A[a-zA-Z0-9+/]{86}==\Z' SHA512_BASE64 = r'\A[a-zA-Z0-9+/]{86}==\Z'
# Reference: http://www.zytrax.com/tech/web/mobile_ids.html # Reference: http://www.zytrax.com/tech/web/mobile_ids.html
class MOBILES: class MOBILES(object):
BLACKBERRY = ("BlackBerry Z10", "Mozilla/5.0 (BB10; Kbd) AppleWebKit/537.35+ (KHTML, like Gecko) Version/10.3.3.2205 Mobile Safari/537.35+") BLACKBERRY = ("BlackBerry Z10", "Mozilla/5.0 (BB10; Kbd) AppleWebKit/537.35+ (KHTML, like Gecko) Version/10.3.3.2205 Mobile Safari/537.35+")
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") 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")
HP = ("HP iPAQ 6365", "Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320; HP iPAQ h6300)") HP = ("HP iPAQ 6365", "Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320; HP iPAQ h6300)")
@ -168,23 +168,23 @@ class MOBILES:
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") 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")
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") 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")
class PROXY_TYPE: class PROXY_TYPE(object):
HTTP = "HTTP" HTTP = "HTTP"
HTTPS = "HTTPS" HTTPS = "HTTPS"
SOCKS4 = "SOCKS4" SOCKS4 = "SOCKS4"
SOCKS5 = "SOCKS5" SOCKS5 = "SOCKS5"
class REGISTRY_OPERATION: class REGISTRY_OPERATION(object):
READ = "read" READ = "read"
ADD = "add" ADD = "add"
DELETE = "delete" DELETE = "delete"
class DUMP_FORMAT: class DUMP_FORMAT(object):
CSV = "CSV" CSV = "CSV"
HTML = "HTML" HTML = "HTML"
SQLITE = "SQLITE" SQLITE = "SQLITE"
class HTTP_HEADER: class HTTP_HEADER(object):
ACCEPT = "Accept" ACCEPT = "Accept"
ACCEPT_CHARSET = "Accept-Charset" ACCEPT_CHARSET = "Accept-Charset"
ACCEPT_ENCODING = "Accept-Encoding" ACCEPT_ENCODING = "Accept-Encoding"
@ -217,17 +217,17 @@ class HTTP_HEADER:
X_POWERED_BY = "X-Powered-By" X_POWERED_BY = "X-Powered-By"
X_DATA_ORIGIN = "X-Data-Origin" X_DATA_ORIGIN = "X-Data-Origin"
class EXPECTED: class EXPECTED(object):
BOOL = "bool" BOOL = "bool"
INT = "int" INT = "int"
class OPTION_TYPE: class OPTION_TYPE(object):
BOOLEAN = "boolean" BOOLEAN = "boolean"
INTEGER = "integer" INTEGER = "integer"
FLOAT = "float" FLOAT = "float"
STRING = "string" STRING = "string"
class HASHDB_KEYS: class HASHDB_KEYS(object):
DBMS = "DBMS" DBMS = "DBMS"
DBMS_FORK = "DBMS_FORK" DBMS_FORK = "DBMS_FORK"
CHECK_WAF_RESULT = "CHECK_WAF_RESULT" CHECK_WAF_RESULT = "CHECK_WAF_RESULT"
@ -243,11 +243,11 @@ class HASHDB_KEYS:
KB_XP_CMDSHELL_AVAILABLE = "KB_XP_CMDSHELL_AVAILABLE" KB_XP_CMDSHELL_AVAILABLE = "KB_XP_CMDSHELL_AVAILABLE"
OS = "OS" OS = "OS"
class REDIRECTION: class REDIRECTION(object):
YES = "Y" YES = "Y"
NO = "N" NO = "N"
class PAYLOAD: class PAYLOAD(object):
SQLINJECTION = { SQLINJECTION = {
1: "boolean-based blind", 1: "boolean-based blind",
2: "error-based", 2: "error-based",
@ -286,13 +286,13 @@ class PAYLOAD:
9: "Pre-WHERE (non-query)", 9: "Pre-WHERE (non-query)",
} }
class METHOD: class METHOD(object):
COMPARISON = "comparison" COMPARISON = "comparison"
GREP = "grep" GREP = "grep"
TIME = "time" TIME = "time"
UNION = "union" UNION = "union"
class TECHNIQUE: class TECHNIQUE(object):
BOOLEAN = 1 BOOLEAN = 1
ERROR = 2 ERROR = 2
QUERY = 3 QUERY = 3
@ -300,28 +300,28 @@ class PAYLOAD:
TIME = 5 TIME = 5
UNION = 6 UNION = 6
class WHERE: class WHERE(object):
ORIGINAL = 1 ORIGINAL = 1
NEGATIVE = 2 NEGATIVE = 2
REPLACE = 3 REPLACE = 3
class WIZARD: class WIZARD(object):
BASIC = ("getBanner", "getCurrentUser", "getCurrentDb", "isDba") BASIC = ("getBanner", "getCurrentUser", "getCurrentDb", "isDba")
INTERMEDIATE = ("getBanner", "getCurrentUser", "getCurrentDb", "isDba", "getUsers", "getDbs", "getTables", "getSchema", "excludeSysDbs") INTERMEDIATE = ("getBanner", "getCurrentUser", "getCurrentDb", "isDba", "getUsers", "getDbs", "getTables", "getSchema", "excludeSysDbs")
ALL = ("getBanner", "getCurrentUser", "getCurrentDb", "isDba", "getHostname", "getUsers", "getPasswordHashes", "getPrivileges", "getRoles", "dumpAll") ALL = ("getBanner", "getCurrentUser", "getCurrentDb", "isDba", "getHostname", "getUsers", "getPasswordHashes", "getPrivileges", "getRoles", "dumpAll")
class ADJUST_TIME_DELAY: class ADJUST_TIME_DELAY(object):
DISABLE = -1 DISABLE = -1
NO = 0 NO = 0
YES = 1 YES = 1
class WEB_PLATFORM: class WEB_PLATFORM(object):
PHP = "php" PHP = "php"
ASP = "asp" ASP = "asp"
ASPX = "aspx" ASPX = "aspx"
JSP = "jsp" JSP = "jsp"
class CONTENT_TYPE: class CONTENT_TYPE(object):
TARGET = 0 TARGET = 0
TECHNIQUES = 1 TECHNIQUES = 1
DBMS_FINGERPRINT = 2 DBMS_FINGERPRINT = 2
@ -350,26 +350,26 @@ class CONTENT_TYPE:
REG_READ = 25 REG_READ = 25
STATEMENTS = 26 STATEMENTS = 26
class CONTENT_STATUS: class CONTENT_STATUS(object):
IN_PROGRESS = 0 IN_PROGRESS = 0
COMPLETE = 1 COMPLETE = 1
class AUTH_TYPE: class AUTH_TYPE(object):
BASIC = "basic" BASIC = "basic"
DIGEST = "digest" DIGEST = "digest"
NTLM = "ntlm" NTLM = "ntlm"
PKI = "pki" PKI = "pki"
class AUTOCOMPLETE_TYPE: class AUTOCOMPLETE_TYPE(object):
SQL = 0 SQL = 0
OS = 1 OS = 1
SQLMAP = 2 SQLMAP = 2
API = 3 API = 3
class NOTE: class NOTE(object):
FALSE_POSITIVE_OR_UNEXPLOITABLE = "false positive or unexploitable" FALSE_POSITIVE_OR_UNEXPLOITABLE = "false positive or unexploitable"
class MKSTEMP_PREFIX: class MKSTEMP_PREFIX(object):
HASHES = "sqlmaphashes-" HASHES = "sqlmaphashes-"
CRAWLER = "sqlmapcrawler-" CRAWLER = "sqlmapcrawler-"
IPC = "sqlmapipc-" IPC = "sqlmapipc-"
@ -381,11 +381,11 @@ class MKSTEMP_PREFIX:
SPECIFIC_RESPONSE = "sqlmapresponse-" SPECIFIC_RESPONSE = "sqlmapresponse-"
PREPROCESS = "sqlmappreprocess-" PREPROCESS = "sqlmappreprocess-"
class TIMEOUT_STATE: class TIMEOUT_STATE(object):
NORMAL = 0 NORMAL = 0
EXCEPTION = 1 EXCEPTION = 1
TIMEOUT = 2 TIMEOUT = 2
class HINT: class HINT(object):
PREPEND = 0 PREPEND = 0
APPEND = 1 APPEND = 1

View File

@ -32,7 +32,7 @@ class Replication(object):
errMsg += "file '%s' ('%s')" % (self.filepath, getSafeExString(ex)) errMsg += "file '%s' ('%s')" % (self.filepath, getSafeExString(ex))
raise SqlmapConnectionException(errMsg) raise SqlmapConnectionException(errMsg)
class DataType: class DataType(object):
""" """
Using this class we define auxiliary objects Using this class we define auxiliary objects
used for representing sqlite data types. used for representing sqlite data types.
@ -47,7 +47,7 @@ class Replication(object):
def __repr__(self): def __repr__(self):
return "<DataType: %s>" % self return "<DataType: %s>" % self
class Table: class Table(object):
""" """
This class defines methods used to manipulate table objects. This class defines methods used to manipulate table objects.
""" """

View File

@ -18,7 +18,7 @@ from lib.core.enums import OS
from thirdparty.six import unichr as _unichr from thirdparty.six import unichr as _unichr
# sqlmap version (<major>.<minor>.<month>.<monthly commit>) # sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.3.5.152" VERSION = "1.3.5.153"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

View File

@ -94,7 +94,7 @@ class Popen(subprocess.Popen):
try: try:
x = msvcrt.get_osfhandle(self.stdin.fileno()) x = msvcrt.get_osfhandle(self.stdin.fileno())
(errCode, written) = WriteFile(x, input) (_, written) = WriteFile(x, input)
except ValueError: except ValueError:
return self._close('stdin') return self._close('stdin')
except (subprocess.pywintypes.error, Exception) as ex: except (subprocess.pywintypes.error, Exception) as ex:
@ -111,11 +111,11 @@ class Popen(subprocess.Popen):
try: try:
x = msvcrt.get_osfhandle(conn.fileno()) x = msvcrt.get_osfhandle(conn.fileno())
(read, nAvail, nMessage) = PeekNamedPipe(x, 0) (read, nAvail, _) = PeekNamedPipe(x, 0)
if maxsize < nAvail: if maxsize < nAvail:
nAvail = maxsize nAvail = maxsize
if nAvail > 0: if nAvail > 0:
(errCode, read) = ReadFile(x, nAvail, None) (_, read) = ReadFile(x, nAvail, None)
except (ValueError, NameError): except (ValueError, NameError):
return self._close(which) return self._close(which)
except (subprocess.pywintypes.error, Exception) as ex: except (subprocess.pywintypes.error, Exception) as ex:

View File

@ -169,7 +169,7 @@ def smokeTest():
logger.setLevel(logging.CRITICAL) logger.setLevel(logging.CRITICAL)
kb.smokeMode = True kb.smokeMode = True
(failure_count, test_count) = doctest.testmod(module) (failure_count, _) = doctest.testmod(module)
kb.smokeMode = False kb.smokeMode = False
logger.setLevel(logging.INFO) logger.setLevel(logging.INFO)

View File

@ -22,7 +22,7 @@ from lib.core.data import logger
from lib.core.data import paths from lib.core.data import paths
from lib.core.exception import SqlmapDataException from lib.core.exception import SqlmapDataException
class ICMPsh: class ICMPsh(object):
""" """
This class defines methods to call icmpsh for plugins. This class defines methods to call icmpsh for plugins.
""" """

View File

@ -53,7 +53,7 @@ from thirdparty import six
if IS_WIN: if IS_WIN:
import msvcrt import msvcrt
class Metasploit: class Metasploit(object):
""" """
This class defines methods to call Metasploit for plugins. This class defines methods to call Metasploit for plugins.
""" """

View File

@ -12,7 +12,7 @@ from lib.core.data import conf
from lib.core.data import logger from lib.core.data import logger
from lib.core.enums import REGISTRY_OPERATION from lib.core.enums import REGISTRY_OPERATION
class Registry: class Registry(object):
""" """
This class defines methods to read and write Windows registry keys This class defines methods to read and write Windows registry keys
""" """

View File

@ -29,7 +29,7 @@ from lib.core.exception import SqlmapUserQuitException
from lib.core.unescaper import unescaper from lib.core.unescaper import unescaper
from lib.request import inject from lib.request import inject
class UDF: class UDF(object):
""" """
This class defines methods to deal with User-Defined Functions for This class defines methods to deal with User-Defined Functions for
plugins. plugins.

View File

@ -56,7 +56,7 @@ from lib.core.settings import VIEWSTATE_REGEX
from lib.request.connect import Connect as Request from lib.request.connect import Connect as Request
from thirdparty.six.moves import urllib as _urllib from thirdparty.six.moves import urllib as _urllib
class Web: class Web(object):
""" """
This class defines web-oriented OS takeover functionalities for This class defines web-oriented OS takeover functionalities for
plugins. plugins.

View File

@ -35,7 +35,7 @@ from lib.core.exception import SqlmapUnsupportedFeatureException
from lib.core.threads import getCurrentThreadData from lib.core.threads import getCurrentThreadData
from lib.request import inject from lib.request import inject
class XP_cmdshell: class XP_cmdshell(object):
""" """
This class defines methods to deal with Microsoft SQL Server This class defines methods to deal with Microsoft SQL Server
xp_cmdshell extended procedure for plugins. xp_cmdshell extended procedure for plugins.

View File

@ -21,14 +21,14 @@ from thirdparty.six.moves import http_client as _http_client
# Reference: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HAR/Overview.html # Reference: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HAR/Overview.html
# http://www.softwareishard.com/har/viewer/ # http://www.softwareishard.com/har/viewer/
class HTTPCollectorFactory: class HTTPCollectorFactory(object):
def __init__(self, harFile=False): def __init__(self, harFile=False):
self.harFile = harFile self.harFile = harFile
def create(self): def create(self):
return HTTPCollector() return HTTPCollector()
class HTTPCollector: class HTTPCollector(object):
def __init__(self): def __init__(self):
self.messages = BigArray() self.messages = BigArray()
self.extendedArguments = {} self.extendedArguments = {}
@ -48,7 +48,7 @@ class HTTPCollector:
"entries": [pair.toEntry().toDict() for pair in self.messages], "entries": [pair.toEntry().toDict() for pair in self.messages],
}} }}
class RawPair: class RawPair(object):
def __init__(self, request, response, startTime=None, endTime=None, extendedArguments=None): def __init__(self, request, response, startTime=None, endTime=None, extendedArguments=None):
self.request = getBytes(request) self.request = getBytes(request)
self.response = getBytes(response) self.response = getBytes(response)
@ -61,7 +61,7 @@ class RawPair:
startTime=self.startTime, endTime=self.endTime, startTime=self.startTime, endTime=self.endTime,
extendedArguments=self.extendedArguments) extendedArguments=self.extendedArguments)
class Entry: class Entry(object):
def __init__(self, request, response, startTime, endTime, extendedArguments): def __init__(self, request, response, startTime, endTime, extendedArguments):
self.request = request self.request = request
self.response = response self.response = response
@ -85,7 +85,7 @@ class Entry:
out.update(self.extendedArguments) out.update(self.extendedArguments)
return out return out
class Request: class Request(object):
def __init__(self, method, path, httpVersion, headers, postBody=None, raw=None, comment=None): def __init__(self, method, path, httpVersion, headers, postBody=None, raw=None, comment=None):
self.method = method self.method = method
self.path = path self.path = path
@ -133,7 +133,7 @@ class Request:
return out return out
class Response: class Response(object):
extract_status = re.compile(b'\\((\\d{3}) (.*)\\)') extract_status = re.compile(b'\\((\\d{3}) (.*)\\)')
def __init__(self, httpVersion, status, statusText, headers, content, raw=None, comment=None): def __init__(self, httpVersion, status, statusText, headers, content, raw=None, comment=None):
@ -202,7 +202,7 @@ class Response:
"comment": getText(self.comment), "comment": getText(self.comment),
} }
class FakeSocket: class FakeSocket(object):
# Original source: # Original source:
# https://stackoverflow.com/questions/24728088/python-parse-http-response-string # https://stackoverflow.com/questions/24728088/python-parse-http-response-string

View File

@ -12,7 +12,7 @@ from lib.core.data import logger
from lib.core.exception import SqlmapFilePathException from lib.core.exception import SqlmapFilePathException
from lib.core.exception import SqlmapUndefinedMethod from lib.core.exception import SqlmapUndefinedMethod
class Connector: class Connector(object):
""" """
This class defines generic dbms protocol functionalities for plugins. This class defines generic dbms protocol functionalities for plugins.
""" """

View File

@ -26,7 +26,7 @@ from lib.core.shell import autoCompletion
from lib.request import inject from lib.request import inject
from thirdparty.six.moves import input as _input from thirdparty.six.moves import input as _input
class Custom: class Custom(object):
""" """
This class defines custom enumeration functionalities for plugins. This class defines custom enumeration functionalities for plugins.
""" """

View File

@ -51,7 +51,7 @@ from lib.utils.brute import columnExists
from lib.utils.brute import tableExists from lib.utils.brute import tableExists
from thirdparty import six from thirdparty import six
class Databases: class Databases(object):
""" """
This class defines databases' enumeration functionalities for plugins. This class defines databases' enumeration functionalities for plugins.
""" """

View File

@ -48,7 +48,7 @@ from lib.utils.pivotdumptable import pivotDumpTable
from thirdparty import six from thirdparty import six
from thirdparty.six.moves import zip as _zip from thirdparty.six.moves import zip as _zip
class Entries: class Entries(object):
""" """
This class defines entries' enumeration functionalities for plugins. This class defines entries' enumeration functionalities for plugins.
""" """

View File

@ -35,7 +35,7 @@ from lib.core.settings import TAKEOVER_TABLE_PREFIX
from lib.core.settings import UNICODE_ENCODING from lib.core.settings import UNICODE_ENCODING
from lib.request import inject from lib.request import inject
class Filesystem: class Filesystem(object):
""" """
This class defines generic OS file system functionalities for plugins. This class defines generic OS file system functionalities for plugins.
""" """

View File

@ -11,7 +11,7 @@ from lib.core.data import logger
from lib.core.enums import OS from lib.core.enums import OS
from lib.core.exception import SqlmapUndefinedMethod from lib.core.exception import SqlmapUndefinedMethod
class Fingerprint: class Fingerprint(object):
""" """
This class defines generic fingerprint functionalities for plugins. This class defines generic fingerprint functionalities for plugins.
""" """

View File

@ -28,7 +28,7 @@ from lib.core.exception import SqlmapNoneDataException
from lib.core.exception import SqlmapUnsupportedFeatureException from lib.core.exception import SqlmapUnsupportedFeatureException
from lib.request import inject from lib.request import inject
class Miscellaneous: class Miscellaneous(object):
""" """
This class defines miscellaneous functionalities for plugins. This class defines miscellaneous functionalities for plugins.
""" """

View File

@ -37,7 +37,7 @@ from lib.utils.brute import columnExists
from lib.utils.brute import tableExists from lib.utils.brute import tableExists
from thirdparty import six from thirdparty import six
class Search: class Search(object):
""" """
This class defines search functionalities for plugins. This class defines search functionalities for plugins.
""" """

View File

@ -9,7 +9,7 @@ import re
from lib.core.exception import SqlmapUndefinedMethod from lib.core.exception import SqlmapUndefinedMethod
class Syntax: class Syntax(object):
""" """
This class defines generic syntax functionalities for plugins. This class defines generic syntax functionalities for plugins.
""" """

View File

@ -45,7 +45,7 @@ from lib.utils.hash import storeHashesToFile
from lib.utils.pivotdumptable import pivotDumpTable from lib.utils.pivotdumptable import pivotDumpTable
from thirdparty.six.moves import zip as _zip from thirdparty.six.moves import zip as _zip
class Users: class Users(object):
""" """
This class defines users' enumeration functionalities for plugins. This class defines users' enumeration functionalities for plugins.
""" """