Proper fix for --technique=U bug

This commit is contained in:
Bernardo Damele 2011-05-01 23:42:41 +00:00
parent 8e8886cd20
commit ac2550535c
2 changed files with 11 additions and 3 deletions

View File

@ -450,7 +450,7 @@ class Agent:
else: else:
return query return query
if Backend.getIdentifiedDbms() == DBMS.MYSQL: if Backend.isDbms(DBMS.MYSQL):
if fieldsExists: if fieldsExists:
concatenatedQuery = concatenatedQuery.replace("SELECT ", "CONCAT('%s'," % kb.misc.start, 1) concatenatedQuery = concatenatedQuery.replace("SELECT ", "CONCAT('%s'," % kb.misc.start, 1)
concatenatedQuery += ",'%s')" % kb.misc.stop concatenatedQuery += ",'%s')" % kb.misc.stop

View File

@ -421,11 +421,19 @@ class Backend:
# Comparison methods # Comparison methods
@staticmethod @staticmethod
def isDbms(dbms): def isDbms(dbms):
return Backend.getDbms() is not None and Backend.getDbms() == aliasToDbmsEnum(dbms) if Backend.getDbms() is not None:
return Backend.getDbms() == aliasToDbmsEnum(dbms)
else:
return Backend.getIdentifiedDbms() == aliasToDbmsEnum(dbms)
@staticmethod @staticmethod
def isDbmsWithin(aliases): def isDbmsWithin(aliases):
return Backend.getDbms() is not None and Backend.getDbms().lower() in aliases if Backend.getDbms() is not None:
return Backend.getDbms().lower() in aliases
elif Backend.getIdentifiedDbms() is not None:
return Backend.getIdentifiedDbms().lower() in aliases
else:
return False
@staticmethod @staticmethod
def isVersion(version): def isVersion(version):