ms access connector update

This commit is contained in:
Miroslav Stampar 2010-03-30 12:48:51 +00:00
parent a02ec29c15
commit 88d74a00c1
2 changed files with 11 additions and 5 deletions

View File

@ -68,7 +68,7 @@ class Connector(GenericConnector):
try:
self.cursor.execute(query)
except pyodbc.OperationalError, msg:
except (pyodbc.OperationalError, pyodbc.ProgrammingError), msg:
logger.log(8, msg[1])
except pyodbc.Error, msg:
raise sqlmapConnectionException, msg[1]
@ -76,8 +76,12 @@ class Connector(GenericConnector):
self.connector.commit()
def select(self, query):
try:
self.cursor.execute(query)
return self.cursor.fetchall()
except pyodbc.ProgrammingError, msg:
logger.log(8, msg[1])
return None
def setCursor(self):
self.cursor = self.connector.cursor()

View File

@ -82,10 +82,12 @@ class Fingerprint(GenericFingerprint):
negate = True
table = table[1:]
randInt = randomInt()
query = agent.prefixQuery(" AND EXISTS(SELECT * FROM %s WHERE %d=%d)" % (table, randInt, randInt))
query = agent.prefixQuery(" AND EXISTS(SELECT * FROM %s WHERE %d=%d) FROM %s" % (table, randInt, randInt, table))
query = agent.postfixQuery(query)
payload = agent.payload(newValue=query)
result = Request.queryPage(payload)
if result is None:
result = False
if negate:
result = not result
exist &= result