@@ -897,7 +897,7 @@ def getTables(self, bruteForce=None):
897897 continue
898898
899899 infoMsg = "fetching number of tables for "
900- infoMsg += "database '%s'" % db
900+ infoMsg += "database '%s'" % unsafeSQLIdentificatorNaming ( db )
901901 logger .info (infoMsg )
902902
903903 if Backend .getIdentifiedDbms () in (DBMS .SQLITE , DBMS .FIREBIRD , DBMS .MAXDB , DBMS .ACCESS ):
@@ -908,7 +908,7 @@ def getTables(self, bruteForce=None):
908908
909909 if not isNumPosStrValue (count ):
910910 warnMsg = "unable to retrieve the number of "
911- warnMsg += "tables for database '%s'" % db
911+ warnMsg += "tables for database '%s'" % unsafeSQLIdentificatorNaming ( db )
912912 logger .warn (warnMsg )
913913 continue
914914
@@ -937,7 +937,7 @@ def getTables(self, bruteForce=None):
937937 kb .data .cachedTables [db ] = tables
938938 else :
939939 warnMsg = "unable to retrieve the table names "
940- warnMsg += "for database '%s'" % db
940+ warnMsg += "for database '%s'" % unsafeSQLIdentificatorNaming ( db )
941941 logger .warn (warnMsg )
942942
943943 if isNoneValue (kb .data .cachedTables ):
@@ -1012,7 +1012,7 @@ def getColumns(self, onlyColNames=False, colTuple=None, bruteForce=None):
10121012 tblList = list (tblList )
10131013 else :
10141014 errMsg = "unable to retrieve the tables "
1015- errMsg += "on database '%s'" % conf .db
1015+ errMsg += "on database '%s'" % unsafeSQLIdentificatorNaming ( conf .db )
10161016 raise sqlmapNoneDataException , errMsg
10171017
10181018 for tbl in tblList :
@@ -1077,7 +1077,7 @@ def getColumns(self, onlyColNames=False, colTuple=None, bruteForce=None):
10771077 and conf .db in kb .data .cachedColumns and tbl in \
10781078 kb .data .cachedColumns [conf .db ]:
10791079 infoMsg = "fetched tables' columns on "
1080- infoMsg += "database '%s'" % conf .db
1080+ infoMsg += "database '%s'" % unsafeSQLIdentificatorNaming ( conf .db )
10811081 logger .info (infoMsg )
10821082
10831083 return {conf .db : kb .data .cachedColumns [conf .db ]}
@@ -1099,8 +1099,8 @@ def getColumns(self, onlyColNames=False, colTuple=None, bruteForce=None):
10991099 else :
11001100 condQuery = ""
11011101
1102- infoMsg += "for table '%s' " % tbl
1103- infoMsg += "on database '%s'" % conf .db
1102+ infoMsg += "for table '%s' " % unsafeSQLIdentificatorNaming ( tbl )
1103+ infoMsg += "on database '%s'" % unsafeSQLIdentificatorNaming ( conf .db )
11041104 logger .info (infoMsg )
11051105
11061106 if Backend .getIdentifiedDbms () in (DBMS .MYSQL , DBMS .PGSQL ):
@@ -1168,8 +1168,8 @@ def getColumns(self, onlyColNames=False, colTuple=None, bruteForce=None):
11681168 else :
11691169 condQuery = ""
11701170
1171- infoMsg += "for table '%s' " % tbl
1172- infoMsg += "on database '%s'" % conf .db
1171+ infoMsg += "for table '%s' " % unsafeSQLIdentificatorNaming ( tbl )
1172+ infoMsg += "on database '%s'" % unsafeSQLIdentificatorNaming ( conf .db )
11731173 logger .info (infoMsg )
11741174
11751175 if Backend .getIdentifiedDbms () in (DBMS .MYSQL , DBMS .PGSQL ):
@@ -1199,8 +1199,8 @@ def getColumns(self, onlyColNames=False, colTuple=None, bruteForce=None):
11991199
12001200 if not isNumPosStrValue (count ):
12011201 errMsg = "unable to retrieve the number of columns "
1202- errMsg += "for table '%s' " % tbl
1203- errMsg += "on database '%s'" % conf .db
1202+ errMsg += "for table '%s' " % unsafeSQLIdentificatorNaming ( tbl )
1203+ errMsg += "on database '%s'" % unsafeSQLIdentificatorNaming ( conf .db )
12041204 logger .error (errMsg )
12051205
12061206 continue
@@ -1264,7 +1264,7 @@ def getColumns(self, onlyColNames=False, colTuple=None, bruteForce=None):
12641264
12651265 if not kb .data .cachedColumns :
12661266 errMsg = "unable to retrieve the columns for any "
1267- errMsg += "table on database '%s'" % conf .db
1267+ errMsg += "table on database '%s'" % unsafeSQLIdentificatorNaming ( conf .db )
12681268 logger .error (errMsg )
12691269
12701270 if bruteForce is None :
@@ -1339,7 +1339,7 @@ def getCount(self):
13391339 if conf .tbl is not None and conf .db is None :
13401340 warnMsg = "missing database parameter, sqlmap is going to "
13411341 warnMsg += "use the current database to retrieve the "
1342- warnMsg += "number of entries for table '%s'" % conf .tbl
1342+ warnMsg += "number of entries for table '%s'" % unsafeSQLIdentificatorNaming ( conf .tbl )
13431343 logger .warn (warnMsg )
13441344
13451345 conf .db = self .getCurrentDb ()
@@ -1372,7 +1372,7 @@ def __pivotDumpTable(self, table, colList, count=None, blind=True):
13721372 count = inject .getValue (query , inband = False , error = False ) if blind else inject .getValue (query , blind = False )
13731373
13741374 if count == "0" :
1375- infoMsg = "table '%s' appears to be empty" % table
1375+ infoMsg = "table '%s' appears to be empty" % unsafeSQLIdentificatorNaming ( table )
13761376 logger .info (infoMsg )
13771377
13781378 for column in colList :
@@ -1523,7 +1523,7 @@ def dumpTable(self, foundData=None):
15231523 tblList = tblList [0 ]
15241524 else :
15251525 errMsg = "unable to retrieve the tables "
1526- errMsg += "on database '%s'" % conf .db
1526+ errMsg += "on database '%s'" % unsafeSQLIdentificatorNaming ( conf .db )
15271527 raise sqlmapNoneDataException , errMsg
15281528
15291529 for tbl in tblList :
0 commit comments