Fixing blind enumeration (MS Access listing only first table; MySQL --privileges user labeling)

This commit is contained in:
Miroslav Štampar 2026-07-28 21:27:49 +02:00
parent 1b09b028ba
commit f21a6ab88d
3 changed files with 8 additions and 5 deletions

View file

@ -418,9 +418,9 @@ class Databases(object):
else:
for index in indexRange:
if Backend.isDbms(DBMS.SYBASE):
query = _query % (db, (kb.data.cachedTables[-1] if kb.data.cachedTables else " "))
query = _query % (db, (tables[-1] if tables else " "))
elif Backend.getIdentifiedDbms() in (DBMS.MAXDB, DBMS.ACCESS, DBMS.MCKOI, DBMS.EXTREMEDB):
query = _query % (kb.data.cachedTables[-1] if kb.data.cachedTables else " ")
query = _query % (tables[-1] if tables else " ")
elif Backend.getIdentifiedDbms() in (DBMS.SQLITE, DBMS.FIREBIRD):
query = _query % index
elif Backend.getIdentifiedDbms() in (DBMS.HSQLDB, DBMS.INFORMIX, DBMS.FRONTBASE, DBMS.VIRTUOSO):

View file

@ -648,13 +648,16 @@ class Users(object):
break
if privileges:
kb.data.cachedUsersPrivileges[user] = list(privileges)
# Note: 'user' may be a LIKE-wrapped form (e.g. '%root%') built for the MySQL
# query above; key/record under the real name so the output isn't mislabelled
# (and the retrievedUsers de-dup check, which compares the unwrapped name, works)
kb.data.cachedUsersPrivileges[outuser] = list(privileges)
else:
warnMsg = "unable to retrieve the privileges "
warnMsg += "for user '%s'" % outuser
logger.warning(warnMsg)
retrievedUsers.add(user)
retrievedUsers.add(outuser)
if not kb.data.cachedUsersPrivileges:
errMsg = "unable to retrieve the privileges "