Gone unnoticed for way too long

This commit is contained in:
Bernardo Damele 2011-04-08 11:15:19 +00:00
parent 228cc68747
commit d5fb1378cc
2 changed files with 42 additions and 4 deletions

View File

@ -14,6 +14,7 @@ from lib.core.common import isTechniqueAvailable
from lib.core.common import normalizePath from lib.core.common import normalizePath
from lib.core.common import ntToPosixSlashes from lib.core.common import ntToPosixSlashes
from lib.core.common import randomStr from lib.core.common import randomStr
from lib.core.common import readInput
from lib.core.data import kb from lib.core.data import kb
from lib.core.data import logger from lib.core.data import logger
from lib.core.data import paths from lib.core.data import paths
@ -80,11 +81,29 @@ class Takeover(GenericTakeover):
self.udfLocalFile = paths.SQLMAP_UDF_PATH self.udfLocalFile = paths.SQLMAP_UDF_PATH
self.udfSharedLibName = "libs%s" % randomStr(lowercase=True) self.udfSharedLibName = "libs%s" % randomStr(lowercase=True)
msg = "what is the back-end database management system architecture?"
msg += "\n[1] 32-bit (default)"
msg += "\n[2] 64-bit"
while True:
arch = readInput(msg, default='1')
if isinstance(arch, basestring) and arch.isdigit() and int(arch) in ( 1, 2 ):
if int(arch) == 1:
arch = 32
else:
arch = 64
break
else:
warnMsg = "invalid value, valid values are 1 and 2"
logger.warn(warnMsg)
if kb.os == "Windows": if kb.os == "Windows":
self.udfLocalFile += "/mysql/windows/32/lib_mysqludf_sys.dll" self.udfLocalFile += "/mysql/windows/%d/lib_mysqludf_sys.dll" % arch
self.udfSharedLibExt = "dll" self.udfSharedLibExt = "dll"
else: else:
self.udfLocalFile += "/mysql/linux/32/lib_mysqludf_sys.so" self.udfLocalFile += "/mysql/linux/%d/lib_mysqludf_sys.so" % arch
self.udfSharedLibExt = "so" self.udfSharedLibExt = "so"
def udfCreateFromSharedLib(self, udf, inpRet): def udfCreateFromSharedLib(self, udf, inpRet):

View File

@ -8,6 +8,7 @@ See the file 'doc/COPYING' for copying permission
""" """
from lib.core.common import randomStr from lib.core.common import randomStr
from lib.core.common import readInput
from lib.core.data import kb from lib.core.data import kb
from lib.core.data import logger from lib.core.data import logger
from lib.core.data import paths from lib.core.data import paths
@ -54,11 +55,29 @@ class Takeover(GenericTakeover):
errMsg = "unsupported feature on versions of PostgreSQL before 8.2" errMsg = "unsupported feature on versions of PostgreSQL before 8.2"
raise sqlmapUnsupportedFeatureException, errMsg raise sqlmapUnsupportedFeatureException, errMsg
msg = "what is the back-end database management system architecture?"
msg += "\n[1] 32-bit (default)"
msg += "\n[2] 64-bit"
while True:
arch = readInput(msg, default='1')
if isinstance(arch, basestring) and arch.isdigit() and int(arch) in ( 1, 2 ):
if int(arch) == 1:
arch = 32
else:
arch = 64
break
else:
warnMsg = "invalid value, valid values are 1 and 2"
logger.warn(warnMsg)
if kb.os == "Windows": if kb.os == "Windows":
self.udfLocalFile += "/postgresql/windows/32/%s/lib_postgresqludf_sys.dll" % majorVer self.udfLocalFile += "/postgresql/windows/%d/%s/lib_postgresqludf_sys.dll" % (arch, majorVer)
self.udfSharedLibExt = "dll" self.udfSharedLibExt = "dll"
else: else:
self.udfLocalFile += "/postgresql/linux/32/%s/lib_postgresqludf_sys.so" % majorVer self.udfLocalFile += "/postgresql/linux/%d/%s/lib_postgresqludf_sys.so" % (arch, majorVer)
self.udfSharedLibExt = "so" self.udfSharedLibExt = "so"
def udfCreateFromSharedLib(self, udf, inpRet): def udfCreateFromSharedLib(self, udf, inpRet):