mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-07 05:01:30 +00:00
Some PEP8 related style cleaning
This commit is contained in:
@@ -17,4 +17,5 @@ class Enumeration(GenericEnumeration):
|
||||
warnMsg = "on DB2 it is not possible to list password hashes"
|
||||
logger.warn(warnMsg)
|
||||
|
||||
return {}
|
||||
return {}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ class Fingerprint(GenericFingerprint):
|
||||
return None
|
||||
|
||||
def getFingerprint(self):
|
||||
value = ""
|
||||
value = ""
|
||||
wsOsFp = Format.getOs("web server", kb.headersFp)
|
||||
|
||||
if wsOsFp:
|
||||
|
||||
@@ -40,7 +40,7 @@ class Connector(GenericConnector):
|
||||
|
||||
try:
|
||||
self.connector = kinterbasdb.connect(host=self.hostname.encode(UNICODE_ENCODING), database=self.db.encode(UNICODE_ENCODING), \
|
||||
user=self.user.encode(UNICODE_ENCODING), password=self.password.encode(UNICODE_ENCODING), charset="UTF8") #http://www.daniweb.com/forums/thread248499.html
|
||||
user=self.user.encode(UNICODE_ENCODING), password=self.password.encode(UNICODE_ENCODING), charset="UTF8") # Reference: http://www.daniweb.com/forums/thread248499.html
|
||||
except kinterbasdb.OperationalError, msg:
|
||||
raise SqlmapConnectionException(msg[1])
|
||||
self.setCursor()
|
||||
|
||||
@@ -70,16 +70,16 @@ class Fingerprint(GenericFingerprint):
|
||||
def _sysTablesCheck(self):
|
||||
retVal = None
|
||||
table = (
|
||||
("1.0", ["EXISTS(SELECT CURRENT_USER FROM RDB$DATABASE)"]),
|
||||
("1.5", ["NULLIF(%d,%d) IS NULL", "EXISTS(SELECT CURRENT_TRANSACTION FROM RDB$DATABASE)"]),
|
||||
("2.0", ["EXISTS(SELECT CURRENT_TIME(0) FROM RDB$DATABASE)", "BIT_LENGTH(%d)>0", "CHAR_LENGTH(%d)>0"]),
|
||||
("2.1", ["BIN_XOR(%d,%d)=0", "PI()>0.%d", "RAND()<1.%d", "FLOOR(1.%d)>=0"])
|
||||
("1.0", ("EXISTS(SELECT CURRENT_USER FROM RDB$DATABASE)",)),
|
||||
("1.5", ("NULLIF(%d,%d) IS NULL", "EXISTS(SELECT CURRENT_TRANSACTION FROM RDB$DATABASE)")),
|
||||
("2.0", ("EXISTS(SELECT CURRENT_TIME(0) FROM RDB$DATABASE)", "BIT_LENGTH(%d)>0", "CHAR_LENGTH(%d)>0")),
|
||||
("2.1", ("BIN_XOR(%d,%d)=0", "PI()>0.%d", "RAND()<1.%d", "FLOOR(1.%d)>=0"))
|
||||
)
|
||||
|
||||
for i in xrange(len(table)):
|
||||
version, checks = table[i]
|
||||
failed = False
|
||||
check = checks[randomRange(0, len(checks)-1)].replace("%d", getUnicode(randomRange(1,100)))
|
||||
check = checks[randomRange(0, len(checks) - 1)].replace("%d", getUnicode(randomRange(1, 100)))
|
||||
result = inject.checkBooleanExpression(check)
|
||||
|
||||
if result:
|
||||
|
||||
@@ -148,7 +148,7 @@ class Enumeration(GenericEnumeration):
|
||||
|
||||
randStr = randomStr()
|
||||
query = rootQuery.inband.query % (unsafeSQLIdentificatorNaming(tbl), ("'%s'" % unsafeSQLIdentificatorNaming(conf.db)) if unsafeSQLIdentificatorNaming(conf.db) != "USER" else 'USER')
|
||||
retVal = pivotDumpTable("(%s) AS %s" % (query, randStr), ['%s.columnname' % randStr,'%s.datatype' % randStr,'%s.len' % randStr], blind=True)
|
||||
retVal = pivotDumpTable("(%s) AS %s" % (query, randStr), ['%s.columnname' % randStr, '%s.datatype' % randStr, '%s.len' % randStr], blind=True)
|
||||
|
||||
if retVal:
|
||||
table = {}
|
||||
|
||||
@@ -44,7 +44,7 @@ class Filesystem(GenericFilesystem):
|
||||
for fileLine in xrange(0, len(fileContent), lineLen):
|
||||
scrString = ""
|
||||
|
||||
for lineChar in fileContent[fileLine:fileLine+lineLen]:
|
||||
for lineChar in fileContent[fileLine:fileLine + lineLen]:
|
||||
strLineChar = hexencode(lineChar)
|
||||
|
||||
if not scrString:
|
||||
|
||||
@@ -68,7 +68,7 @@ class Takeover(GenericTakeover):
|
||||
hexStr = binascii.hexlify(self.shellcodeString[:-1])
|
||||
|
||||
for hexPair in xrange(0, len(hexStr), 2):
|
||||
shellcodeChar += "CHAR(0x%s)+" % hexStr[hexPair:hexPair+2]
|
||||
shellcodeChar += "CHAR(0x%s)+" % hexStr[hexPair:hexPair + 2]
|
||||
|
||||
shellcodeChar = shellcodeChar[:-1]
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ class Fingerprint(GenericFingerprint):
|
||||
elif inject.checkBooleanExpression("@@table_open_cache=@@table_open_cache"):
|
||||
if inject.checkBooleanExpression("%s=(SELECT %s FROM information_schema.GLOBAL_STATUS LIMIT 0, 1)" % (randInt, randInt)):
|
||||
Backend.setVersionList([">= 5.1.12", "< 5.5.0"])
|
||||
elif inject.checkBooleanExpression("%s=(SELECT %s FROM information_schema.PROCESSLIST LIMIT 0, 1)" % (randInt,randInt)):
|
||||
elif inject.checkBooleanExpression("%s=(SELECT %s FROM information_schema.PROCESSLIST LIMIT 0, 1)" % (randInt, randInt)):
|
||||
Backend.setVersionList([">= 5.1.7", "< 5.1.12"])
|
||||
elif inject.checkBooleanExpression("%s=(SELECT %s FROM information_schema.PARTITIONS LIMIT 0, 1)" % (randInt, randInt)):
|
||||
Backend.setVersion("= 5.1.6")
|
||||
|
||||
@@ -39,7 +39,7 @@ class Syntax(GenericSyntax):
|
||||
break
|
||||
|
||||
firstIndex = index
|
||||
index = expression[firstIndex+2:].find("'")
|
||||
index = expression[firstIndex + 2:].find("'")
|
||||
|
||||
if index == -1:
|
||||
raise SqlmapSyntaxException("Unenclosed ' in '%s'" % expression)
|
||||
@@ -49,8 +49,8 @@ class Syntax(GenericSyntax):
|
||||
oldUpper = old.upper()
|
||||
oldUpper = oldUpper.replace("X'", "").replace("'", "")
|
||||
|
||||
for i in xrange(len(oldUpper)/2):
|
||||
char = oldUpper[i*2:i*2+2]
|
||||
for i in xrange(len(oldUpper) / 2):
|
||||
char = oldUpper[i * 2:i * 2 + 2]
|
||||
escaped = "'%s'" % chr(int(char, 16))
|
||||
expression = expression.replace(old, escaped)
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ class Enumeration(GenericEnumeration):
|
||||
for blind in blinds:
|
||||
randStr = randomStr()
|
||||
query = rootQuery.inband.query % (conf.db, conf.db, conf.db, conf.db, conf.db, conf.db, conf.db, unsafeSQLIdentificatorNaming(tbl))
|
||||
retVal = pivotDumpTable("(%s) AS %s" % (query, randStr), ['%s.name' % randStr,'%s.usertype' % randStr], blind=blind)
|
||||
retVal = pivotDumpTable("(%s) AS %s" % (query, randStr), ['%s.name' % randStr, '%s.usertype' % randStr], blind=blind)
|
||||
|
||||
if retVal:
|
||||
table = {}
|
||||
|
||||
Reference in New Issue
Block a user