mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-04 06:50:14 +00:00
added --hostname switch to retrieve DBMS server hostname - closes issue #69
This commit is contained in:
parent
4e64c1126d
commit
53c0336b48
7 changed files with 39 additions and 2 deletions
|
|
@ -83,6 +83,7 @@ class Enumeration:
|
|||
kb.data.banner = None
|
||||
kb.data.currentUser = ""
|
||||
kb.data.currentDb = ""
|
||||
kb.data.hostname = ""
|
||||
kb.data.cachedUsers = []
|
||||
kb.data.cachedUsersPasswords = {}
|
||||
kb.data.cachedUsersPrivileges = {}
|
||||
|
|
@ -150,6 +151,17 @@ class Enumeration:
|
|||
|
||||
return kb.data.currentDb
|
||||
|
||||
def getHostname(self):
|
||||
infoMsg = "fetching server hostname"
|
||||
logger.info(infoMsg)
|
||||
|
||||
query = queries[Backend.getIdentifiedDbms()].hostname.query
|
||||
|
||||
if not kb.data.hostname:
|
||||
kb.data.hostname = unArrayizeValue(inject.getValue(query, safeCharEncode=False))
|
||||
|
||||
return kb.data.hostname
|
||||
|
||||
def isDba(self, user=None):
|
||||
infoMsg = "testing if current user is DBA"
|
||||
logger.info(infoMsg)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue