|
27 | 27 | from lib.core.data import logger |
28 | 28 | from lib.core.dicts import DUMP_REPLACEMENTS |
29 | 29 | from lib.core.enums import API_CONTENT_STATUS |
30 | | -from lib.core.enums import API_CONTENT_TYPE |
| 30 | +from lib.core.enums import CONTENT_TYPE |
31 | 31 | from lib.core.enums import DBMS |
32 | 32 | from lib.core.enums import DUMP_FORMAT |
33 | 33 | from lib.core.exception import SqlmapGenericException |
@@ -135,27 +135,27 @@ def lister(self, header, elements, content_type=None, sort=True): |
135 | 135 | self._write("") |
136 | 136 |
|
137 | 137 | def banner(self, data): |
138 | | - self.string("banner", data, content_type=API_CONTENT_TYPE.BANNER) |
| 138 | + self.string("banner", data, content_type=CONTENT_TYPE.BANNER) |
139 | 139 |
|
140 | 140 | def currentUser(self, data): |
141 | | - self.string("current user", data, content_type=API_CONTENT_TYPE.CURRENT_USER) |
| 141 | + self.string("current user", data, content_type=CONTENT_TYPE.CURRENT_USER) |
142 | 142 |
|
143 | 143 | def currentDb(self, data): |
144 | 144 | if Backend.isDbms(DBMS.MAXDB): |
145 | | - self.string("current database (no practical usage on %s)" % Backend.getIdentifiedDbms(), data, content_type=API_CONTENT_TYPE.CURRENT_DB) |
| 145 | + self.string("current database (no practical usage on %s)" % Backend.getIdentifiedDbms(), data, content_type=CONTENT_TYPE.CURRENT_DB) |
146 | 146 | elif Backend.isDbms(DBMS.ORACLE): |
147 | | - self.string("current schema (equivalent to database on %s)" % Backend.getIdentifiedDbms(), data, content_type=API_CONTENT_TYPE.CURRENT_DB) |
| 147 | + self.string("current schema (equivalent to database on %s)" % Backend.getIdentifiedDbms(), data, content_type=CONTENT_TYPE.CURRENT_DB) |
148 | 148 | else: |
149 | | - self.string("current database", data, content_type=API_CONTENT_TYPE.CURRENT_DB) |
| 149 | + self.string("current database", data, content_type=CONTENT_TYPE.CURRENT_DB) |
150 | 150 |
|
151 | 151 | def hostname(self, data): |
152 | | - self.string("hostname", data, content_type=API_CONTENT_TYPE.HOSTNAME) |
| 152 | + self.string("hostname", data, content_type=CONTENT_TYPE.HOSTNAME) |
153 | 153 |
|
154 | 154 | def dba(self, data): |
155 | | - self.string("current user is DBA", data, content_type=API_CONTENT_TYPE.IS_DBA) |
| 155 | + self.string("current user is DBA", data, content_type=CONTENT_TYPE.IS_DBA) |
156 | 156 |
|
157 | 157 | def users(self, users): |
158 | | - self.lister("database management system users", users, content_type=API_CONTENT_TYPE.USERS) |
| 158 | + self.lister("database management system users", users, content_type=CONTENT_TYPE.USERS) |
159 | 159 |
|
160 | 160 | def userSettings(self, header, userSettings, subHeader, content_type=None): |
161 | 161 | self._areAdmins = set() |
@@ -197,12 +197,12 @@ def userSettings(self, header, userSettings, subHeader, content_type=None): |
197 | 197 | self.singleString("") |
198 | 198 |
|
199 | 199 | def dbs(self, dbs): |
200 | | - self.lister("available databases", dbs, content_type=API_CONTENT_TYPE.DBS) |
| 200 | + self.lister("available databases", dbs, content_type=CONTENT_TYPE.DBS) |
201 | 201 |
|
202 | 202 | def dbTables(self, dbTables): |
203 | 203 | if isinstance(dbTables, dict) and len(dbTables) > 0: |
204 | 204 | if hasattr(conf, "api"): |
205 | | - self._write(dbTables, content_type=API_CONTENT_TYPE.TABLES) |
| 205 | + self._write(dbTables, content_type=CONTENT_TYPE.TABLES) |
206 | 206 | return |
207 | 207 |
|
208 | 208 | maxlength = 0 |
@@ -237,9 +237,9 @@ def dbTables(self, dbTables): |
237 | 237 |
|
238 | 238 | self._write("+%s+\n" % lines) |
239 | 239 | elif dbTables is None or len(dbTables) == 0: |
240 | | - self.singleString("No tables found", content_type=API_CONTENT_TYPE.TABLES) |
| 240 | + self.singleString("No tables found", content_type=CONTENT_TYPE.TABLES) |
241 | 241 | else: |
242 | | - self.string("tables", dbTables, content_type=API_CONTENT_TYPE.TABLES) |
| 242 | + self.string("tables", dbTables, content_type=CONTENT_TYPE.TABLES) |
243 | 243 |
|
244 | 244 | def dbTableColumns(self, tableColumns, content_type=None): |
245 | 245 | if isinstance(tableColumns, dict) and len(tableColumns) > 0: |
@@ -315,7 +315,7 @@ def dbTableColumns(self, tableColumns, content_type=None): |
315 | 315 | def dbTablesCount(self, dbTables): |
316 | 316 | if isinstance(dbTables, dict) and len(dbTables) > 0: |
317 | 317 | if hasattr(conf, "api"): |
318 | | - self._write(dbTables, content_type=API_CONTENT_TYPE.COUNT) |
| 318 | + self._write(dbTables, content_type=CONTENT_TYPE.COUNT) |
319 | 319 | return |
320 | 320 |
|
321 | 321 | maxlength1 = len("Table") |
@@ -372,7 +372,7 @@ def dbTableValues(self, tableValues): |
372 | 372 | table = tableValues["__infos__"]["table"] |
373 | 373 |
|
374 | 374 | if hasattr(conf, "api"): |
375 | | - self._write(tableValues, content_type=API_CONTENT_TYPE.DUMP_TABLE) |
| 375 | + self._write(tableValues, content_type=CONTENT_TYPE.DUMP_TABLE) |
376 | 376 | return |
377 | 377 |
|
378 | 378 | if conf.dumpFormat == DUMP_FORMAT.SQLITE: |
@@ -570,7 +570,7 @@ def dbTableValues(self, tableValues): |
570 | 570 |
|
571 | 571 | def dbColumns(self, dbColumnsDict, colConsider, dbs): |
572 | 572 | if hasattr(conf, "api"): |
573 | | - self._write(dbColumnsDict, content_type=API_CONTENT_TYPE.COLUMNS) |
| 573 | + self._write(dbColumnsDict, content_type=CONTENT_TYPE.COLUMNS) |
574 | 574 | return |
575 | 575 |
|
576 | 576 | for column in dbColumnsDict.keys(): |
@@ -603,13 +603,13 @@ def dbColumns(self, dbColumnsDict, colConsider, dbs): |
603 | 603 | self.dbTableColumns(_) |
604 | 604 |
|
605 | 605 | def query(self, query, queryRes): |
606 | | - self.string(query, queryRes, content_type=API_CONTENT_TYPE.SQL_QUERY) |
| 606 | + self.string(query, queryRes, content_type=CONTENT_TYPE.SQL_QUERY) |
607 | 607 |
|
608 | 608 | def rFile(self, fileData): |
609 | | - self.lister("files saved to", fileData, sort=False, content_type=API_CONTENT_TYPE.FILE_READ) |
| 609 | + self.lister("files saved to", fileData, sort=False, content_type=CONTENT_TYPE.FILE_READ) |
610 | 610 |
|
611 | 611 | def registerValue(self): |
612 | | - self.string("Registry key value data", registerData, registerData, content_type=API_CONTENT_TYPE.REG_READ, sort=False) |
| 612 | + self.string("Registry key value data", registerData, registerData, content_type=CONTENT_TYPE.REG_READ, sort=False) |
613 | 613 |
|
614 | 614 | # object to manage how to print the retrieved queries output to |
615 | 615 | # standard output and sessions file |
|
0 commit comments