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

Skip to content

Commit 103045d

Browse files
committed
variable renamed
1 parent 95998e3 commit 103045d

4 files changed

Lines changed: 28 additions & 28 deletions

File tree

lib/controller/action.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from lib.core.data import kb
1313
from lib.core.data import logger
1414
from lib.core.data import paths
15-
from lib.core.enums import API_CONTENT_TYPE
15+
from lib.core.enums import CONTENT_TYPE
1616
from lib.core.exception import SqlmapNoneDataException
1717
from lib.core.exception import SqlmapUnsupportedDBMSException
1818
from lib.core.settings import SUPPORTED_DBMS
@@ -78,7 +78,7 @@ def action():
7878
if conf.getPasswordHashes:
7979
try:
8080
conf.dumper.userSettings("database management system users password hashes",
81-
conf.dbmsHandler.getPasswordHashes(), "password hash", API_CONTENT_TYPE.PASSWORDS)
81+
conf.dbmsHandler.getPasswordHashes(), "password hash", CONTENT_TYPE.PASSWORDS)
8282
except SqlmapNoneDataException, ex:
8383
logger.critical(ex)
8484
except:
@@ -87,7 +87,7 @@ def action():
8787
if conf.getPrivileges:
8888
try:
8989
conf.dumper.userSettings("database management system users privileges",
90-
conf.dbmsHandler.getPrivileges(), "privilege", API_CONTENT_TYPE.PRIVILEGES)
90+
conf.dbmsHandler.getPrivileges(), "privilege", CONTENT_TYPE.PRIVILEGES)
9191
except SqlmapNoneDataException, ex:
9292
logger.critical(ex)
9393
except:
@@ -96,7 +96,7 @@ def action():
9696
if conf.getRoles:
9797
try:
9898
conf.dumper.userSettings("database management system users roles",
99-
conf.dbmsHandler.getRoles(), "role", API_CONTENT_TYPE.ROLES)
99+
conf.dbmsHandler.getRoles(), "role", CONTENT_TYPE.ROLES)
100100
except SqlmapNoneDataException, ex:
101101
logger.critical(ex)
102102
except:
@@ -112,10 +112,10 @@ def action():
112112
conf.dumper.dbTables(tableExists(paths.COMMON_TABLES))
113113

114114
if conf.getSchema:
115-
conf.dumper.dbTableColumns(conf.dbmsHandler.getSchema(), API_CONTENT_TYPE.SCHEMA)
115+
conf.dumper.dbTableColumns(conf.dbmsHandler.getSchema(), CONTENT_TYPE.SCHEMA)
116116

117117
if conf.getColumns:
118-
conf.dumper.dbTableColumns(conf.dbmsHandler.getColumns(), API_CONTENT_TYPE.COLUMNS)
118+
conf.dumper.dbTableColumns(conf.dbmsHandler.getColumns(), CONTENT_TYPE.COLUMNS)
119119

120120
if conf.getCount:
121121
conf.dumper.dbTablesCount(conf.dbmsHandler.getCount())

lib/controller/controller.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
from lib.core.data import conf
3737
from lib.core.data import kb
3838
from lib.core.data import logger
39-
from lib.core.enums import API_CONTENT_TYPE
39+
from lib.core.enums import CONTENT_TYPE
4040
from lib.core.enums import HASHDB_KEYS
4141
from lib.core.enums import HEURISTIC_TEST
4242
from lib.core.enums import HTTPMETHOD
@@ -153,7 +153,7 @@ def _showInjections():
153153
header += "a total of %d HTTP(s) requests" % kb.testQueryCount
154154

155155
if hasattr(conf, "api"):
156-
conf.dumper.string("", kb.injections, content_type=API_CONTENT_TYPE.TECHNIQUES)
156+
conf.dumper.string("", kb.injections, content_type=CONTENT_TYPE.TECHNIQUES)
157157
else:
158158
data = "".join(set(map(lambda x: _formatInjection(x), kb.injections))).rstrip("\n")
159159
conf.dumper.string(header, data)

lib/core/dump.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from lib.core.data import logger
2828
from lib.core.dicts import DUMP_REPLACEMENTS
2929
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
3131
from lib.core.enums import DBMS
3232
from lib.core.enums import DUMP_FORMAT
3333
from lib.core.exception import SqlmapGenericException
@@ -135,27 +135,27 @@ def lister(self, header, elements, content_type=None, sort=True):
135135
self._write("")
136136

137137
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)
139139

140140
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)
142142

143143
def currentDb(self, data):
144144
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)
146146
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)
148148
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)
150150

151151
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)
153153

154154
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)
156156

157157
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)
159159

160160
def userSettings(self, header, userSettings, subHeader, content_type=None):
161161
self._areAdmins = set()
@@ -197,12 +197,12 @@ def userSettings(self, header, userSettings, subHeader, content_type=None):
197197
self.singleString("")
198198

199199
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)
201201

202202
def dbTables(self, dbTables):
203203
if isinstance(dbTables, dict) and len(dbTables) > 0:
204204
if hasattr(conf, "api"):
205-
self._write(dbTables, content_type=API_CONTENT_TYPE.TABLES)
205+
self._write(dbTables, content_type=CONTENT_TYPE.TABLES)
206206
return
207207

208208
maxlength = 0
@@ -237,9 +237,9 @@ def dbTables(self, dbTables):
237237

238238
self._write("+%s+\n" % lines)
239239
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)
241241
else:
242-
self.string("tables", dbTables, content_type=API_CONTENT_TYPE.TABLES)
242+
self.string("tables", dbTables, content_type=CONTENT_TYPE.TABLES)
243243

244244
def dbTableColumns(self, tableColumns, content_type=None):
245245
if isinstance(tableColumns, dict) and len(tableColumns) > 0:
@@ -315,7 +315,7 @@ def dbTableColumns(self, tableColumns, content_type=None):
315315
def dbTablesCount(self, dbTables):
316316
if isinstance(dbTables, dict) and len(dbTables) > 0:
317317
if hasattr(conf, "api"):
318-
self._write(dbTables, content_type=API_CONTENT_TYPE.COUNT)
318+
self._write(dbTables, content_type=CONTENT_TYPE.COUNT)
319319
return
320320

321321
maxlength1 = len("Table")
@@ -372,7 +372,7 @@ def dbTableValues(self, tableValues):
372372
table = tableValues["__infos__"]["table"]
373373

374374
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)
376376
return
377377

378378
if conf.dumpFormat == DUMP_FORMAT.SQLITE:
@@ -570,7 +570,7 @@ def dbTableValues(self, tableValues):
570570

571571
def dbColumns(self, dbColumnsDict, colConsider, dbs):
572572
if hasattr(conf, "api"):
573-
self._write(dbColumnsDict, content_type=API_CONTENT_TYPE.COLUMNS)
573+
self._write(dbColumnsDict, content_type=CONTENT_TYPE.COLUMNS)
574574
return
575575

576576
for column in dbColumnsDict.keys():
@@ -603,13 +603,13 @@ def dbColumns(self, dbColumnsDict, colConsider, dbs):
603603
self.dbTableColumns(_)
604604

605605
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)
607607

608608
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)
610610

611611
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)
613613

614614
# object to manage how to print the retrieved queries output to
615615
# standard output and sessions file

lib/core/enums.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ class WEB_API:
244244
ASPX = "aspx"
245245
JSP = "jsp"
246246

247-
class API_CONTENT_TYPE:
247+
class CONTENT_TYPE:
248248
TECHNIQUES = 0
249249
DBMS_FINGERPRINT = 1
250250
BANNER = 2

0 commit comments

Comments
 (0)