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

Skip to content

Commit 85a4ef6

Browse files
committed
minor update
1 parent 93d7d6c commit 85a4ef6

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

lib/request/connect.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,8 @@ def _randomizeParameter(paramString, randomParameter):
731731
if not response and removeReflection:
732732
page = removeReflectiveValues(page, payload)
733733

734+
kb.permissionFlag = re.search(r"permission denied", page or "", re.I) is not None
735+
734736
if content or response:
735737
return page, headers
736738

plugins/generic/enumeration.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1768,20 +1768,20 @@ def dumpTable(self, foundData=None):
17681768

17691769
entriesCount = len(columnEntries)
17701770

1771-
if len(kb.data.dumpedTable) > 0:
1771+
if len(kb.data.dumpedTable) == 0 or (entriesCount == 0 and kb.permissionFlag):
1772+
warnMsg = "unable to retrieve the entries of "
1773+
if conf.col:
1774+
warnMsg += "columns '%s' " % colString
1775+
warnMsg += "for table '%s' " % unsafeSQLIdentificatorNaming(tbl)
1776+
warnMsg += "on database '%s'%s" % (unsafeSQLIdentificatorNaming(conf.db), " (permission denied)" if kb.permissionFlag else "")
1777+
logger.warn(warnMsg)
1778+
else:
17721779
kb.data.dumpedTable["__infos__"] = { "count": entriesCount,
17731780
"table": safeSQLIdentificatorNaming(tbl, True),
17741781
"db": safeSQLIdentificatorNaming(conf.db) }
17751782

17761783
attackDumpedTable()
17771784
conf.dumper.dbTableValues(kb.data.dumpedTable)
1778-
else:
1779-
warnMsg = "unable to retrieve the entries of "
1780-
if conf.col:
1781-
warnMsg += "columns '%s' " % colString
1782-
warnMsg += "for table '%s' " % unsafeSQLIdentificatorNaming(tbl)
1783-
warnMsg += "on database '%s'" % unsafeSQLIdentificatorNaming(conf.db)
1784-
logger.warn(warnMsg)
17851785

17861786
except sqlmapConnectionException, e:
17871787
errMsg = "connection exception detected in dumping phase: "

0 commit comments

Comments
 (0)