Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 88d74a0

Browse files
committed
ms access connector update
1 parent a02ec29 commit 88d74a0

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

plugins/dbms/access/connector.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,21 @@ def execute(self, query):
6868

6969
try:
7070
self.cursor.execute(query)
71-
except pyodbc.OperationalError, msg:
71+
except (pyodbc.OperationalError, pyodbc.ProgrammingError), msg:
7272
logger.log(8, msg[1])
7373
except pyodbc.Error, msg:
7474
raise sqlmapConnectionException, msg[1]
7575

7676
self.connector.commit()
7777

7878
def select(self, query):
79-
self.cursor.execute(query)
80-
return self.cursor.fetchall()
81-
79+
try:
80+
self.cursor.execute(query)
81+
return self.cursor.fetchall()
82+
except pyodbc.ProgrammingError, msg:
83+
logger.log(8, msg[1])
84+
return None
85+
8286
def setCursor(self):
8387
self.cursor = self.connector.cursor()
8488

plugins/dbms/access/fingerprint.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,12 @@ def __sysTablesCheck(self):
8282
negate = True
8383
table = table[1:]
8484
randInt = randomInt()
85-
query = agent.prefixQuery(" AND EXISTS(SELECT * FROM %s WHERE %d=%d)" % (table, randInt, randInt))
85+
query = agent.prefixQuery(" AND EXISTS(SELECT * FROM %s WHERE %d=%d) FROM %s" % (table, randInt, randInt, table))
8686
query = agent.postfixQuery(query)
8787
payload = agent.payload(newValue=query)
8888
result = Request.queryPage(payload)
89+
if result is None:
90+
result = False
8991
if negate:
9092
result = not result
9193
exist &= result

0 commit comments

Comments
 (0)