sqlmapproject/sqlmap · error · SqlmapMissingMandatoryOptionException
you provided a shared object as shared library, but the…
Error message
you provided a shared object as shared library, but the database underlying operating system is Windows
What it means
OS-mismatch guard in udfInjectCustom: the supplied library ends with .so (Unix shared object) but the remote DBMS underlying OS is Windows, which cannot load it. Fires only after the extension check passed, i.e. the file type is valid but wrong for the target.
Solutions
- Provide a Windows '.dll' build of the UDF library
- Cross-compile the payload for the Windows target architecture
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at lib/takeover/udf.py:227 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26).
Data as JSON: /api/errors/bca703b9278b6945.
Report an issue: GitHub.
Appendix: source
Thrown at lib/takeover/udf.py:227
if self.udfLocalFile:
break
else:
logger.warning("you need to specify the local path of the shared library")
else:
self.udfLocalFile = conf.shLib
if not os.path.exists(self.udfLocalFile):
errMsg = "the specified shared library file does not exist"
raise SqlmapFilePathException(errMsg)
if not self.udfLocalFile.endswith(".dll") and not self.udfLocalFile.endswith(".so"):
errMsg = "shared library file must end with '.dll' or '.so'"
raise SqlmapMissingMandatoryOptionException(errMsg)
elif self.udfLocalFile.endswith(".so") and Backend.isOs(OS.WINDOWS):
errMsg = "you provided a shared object as shared library, but "
errMsg += "the database underlying operating system is Windows"
raise SqlmapMissingMandatoryOptionException(errMsg)
elif self.udfLocalFile.endswith(".dll") and Backend.isOs(OS.LINUX):
errMsg = "you provided a dynamic-link library as shared library, "
errMsg += "but the database underlying operating system is Linux"
raise SqlmapMissingMandatoryOptionException(errMsg)
self.udfSharedLibName = os.path.splitext(os.path.basename(self.udfLocalFile))[0]
self.udfSharedLibExt = os.path.splitext(self.udfLocalFile)[1][1:]
msg = "how many user-defined functions do you want to create "
msg += "from the shared library? "
while True:
udfCount = readInput(msg, default='1')
if udfCount.isdigit():
udfCount = int(udfCount)
View on GitHub (pinned to 0a35b20e39)