2013-06-24 17:34:25 +04:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
"""
|
2015-01-06 17:02:16 +03:00
|
|
|
Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/)
|
2013-06-24 17:34:25 +04:00
|
|
|
See the file 'doc/COPYING' for copying permission
|
|
|
|
"""
|
|
|
|
|
|
|
|
from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
|
|
|
from lib.core.data import conf
|
|
|
|
from lib.core.data import kb
|
|
|
|
from lib.core.data import logger
|
|
|
|
from lib.core.data import queries
|
|
|
|
from lib.core.common import Backend
|
|
|
|
from lib.core.common import unArrayizeValue
|
2015-10-09 17:52:13 +03:00
|
|
|
from lib.core.settings import HSQLDB_DEFAULT_SCHEMA
|
2013-06-24 17:34:25 +04:00
|
|
|
from lib.request import inject
|
|
|
|
|
|
|
|
class Enumeration(GenericEnumeration):
|
|
|
|
def __init__(self):
|
|
|
|
GenericEnumeration.__init__(self)
|
|
|
|
|
|
|
|
def getBanner(self):
|
|
|
|
if not conf.getBanner:
|
|
|
|
return
|
|
|
|
|
|
|
|
if kb.data.banner is None:
|
|
|
|
infoMsg = "fetching banner"
|
|
|
|
logger.info(infoMsg)
|
|
|
|
|
|
|
|
query = queries[Backend.getIdentifiedDbms()].banner.query
|
|
|
|
kb.data.banner = unArrayizeValue(inject.getValue(query, safeCharEncode=True))
|
|
|
|
|
|
|
|
return kb.data.banner
|
2014-09-09 18:22:13 +04:00
|
|
|
|
|
|
|
def getPrivileges(self, *args):
|
|
|
|
warnMsg = "on HSQLDB it is not possible to enumerate the user privileges"
|
|
|
|
logger.warn(warnMsg)
|
|
|
|
|
|
|
|
return {}
|
|
|
|
|
|
|
|
def getHostname(self):
|
|
|
|
warnMsg = "on HSQLDB it is not possible to enumerate the hostname"
|
|
|
|
logger.warn(warnMsg)
|
2015-10-09 17:52:13 +03:00
|
|
|
|
|
|
|
def getCurrentDb(self):
|
|
|
|
return HSQLDB_DEFAULT_SCHEMA
|