mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-01-03 13:19:06 +00:00
added --hostname switch to retrieve DBMS server hostname - closes issue #69
This commit is contained in:
@@ -64,6 +64,9 @@ def action():
|
||||
if conf.getCurrentDb:
|
||||
conf.dumper.currentDb(conf.dbmsHandler.getCurrentDb())
|
||||
|
||||
if conf.getHostname:
|
||||
conf.dumper.hostname(conf.dbmsHandler.getHostname())
|
||||
|
||||
if conf.isDba:
|
||||
conf.dumper.dba(conf.dbmsHandler.isDba())
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ class Dump:
|
||||
def string(self, header, data, sort=True):
|
||||
if isListLike(data):
|
||||
self.lister(header, data, sort)
|
||||
elif data is not None:
|
||||
elif data is not None and len(data) > 0:
|
||||
data = getUnicode(data)
|
||||
|
||||
if data[-1] == '\n':
|
||||
@@ -125,6 +125,9 @@ class Dump:
|
||||
else:
|
||||
self.string("current database", data)
|
||||
|
||||
def hostname(self,data):
|
||||
self.string("hostname", data)
|
||||
|
||||
def dba(self,data):
|
||||
self.string("current user is DBA", data)
|
||||
|
||||
|
||||
@@ -96,6 +96,7 @@ optDict = {
|
||||
"getBanner": ("boolean", "Banners"),
|
||||
"getCurrentUser": ("boolean", "Users"),
|
||||
"getCurrentDb": ("boolean", "Databases"),
|
||||
"getHostname": "boolean",
|
||||
"isDba": "boolean",
|
||||
"getUsers": ("boolean", "Users"),
|
||||
"getPasswordHashes": ("boolean", "Passwords"),
|
||||
|
||||
@@ -304,6 +304,10 @@ def cmdLineParser():
|
||||
action="store_true",
|
||||
help="Retrieve DBMS current database")
|
||||
|
||||
enumeration.add_option("--hostname", dest="getHostname",
|
||||
action="store_true",
|
||||
help="Retrieve DBMS server hostname")
|
||||
|
||||
enumeration.add_option("--is-dba", dest="isDba",
|
||||
action="store_true",
|
||||
help="Detect if the DBMS current user is DBA")
|
||||
|
||||
Reference in New Issue
Block a user