{"record":{"id":"bca703b9278b6945","repo":"sqlmapproject/sqlmap","slug":"you-provided-a-shared-object-as-shared-library-bu","errorCode":null,"errorMessage":"you provided a shared object as shared library, but the database underlying operating system is Windows","messagePattern":"you provided a shared object as shared library, but the database underlying operating system is Windows","errorType":"exception","errorClass":"SqlmapMissingMandatoryOptionException","httpStatus":null,"severity":"error","filePath":"lib/takeover/udf.py","lineNumber":227,"sourceCode":"                if self.udfLocalFile:\n                    break\n                else:\n                    logger.warning(\"you need to specify the local path of the shared library\")\n        else:\n            self.udfLocalFile = conf.shLib\n\n        if not os.path.exists(self.udfLocalFile):\n            errMsg = \"the specified shared library file does not exist\"\n            raise SqlmapFilePathException(errMsg)\n\n        if not self.udfLocalFile.endswith(\".dll\") and not self.udfLocalFile.endswith(\".so\"):\n            errMsg = \"shared library file must end with '.dll' or '.so'\"\n            raise SqlmapMissingMandatoryOptionException(errMsg)\n\n        elif self.udfLocalFile.endswith(\".so\") and Backend.isOs(OS.WINDOWS):\n            errMsg = \"you provided a shared object as shared library, but \"\n            errMsg += \"the database underlying operating system is Windows\"\n            raise SqlmapMissingMandatoryOptionException(errMsg)\n\n        elif self.udfLocalFile.endswith(\".dll\") and Backend.isOs(OS.LINUX):\n            errMsg = \"you provided a dynamic-link library as shared library, \"\n            errMsg += \"but the database underlying operating system is Linux\"\n            raise SqlmapMissingMandatoryOptionException(errMsg)\n\n        self.udfSharedLibName = os.path.splitext(os.path.basename(self.udfLocalFile))[0]\n        self.udfSharedLibExt = os.path.splitext(self.udfLocalFile)[1][1:]\n\n        msg = \"how many user-defined functions do you want to create \"\n        msg += \"from the shared library? \"\n\n        while True:\n            udfCount = readInput(msg, default='1')\n\n            if udfCount.isdigit():\n                udfCount = int(udfCount)\n","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/lib/takeover/udf.py#L209-L245","documentation":"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.","triggerScenarios":"Thrown at lib/takeover/udf.py:227 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a Windows '.dll' build of the UDF library","Cross-compile the payload for the Windows target architecture"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0a35b20e3953d341be6c7ac75ccb0b3362540c8d","analyzedAt":"2026-08-26T23:02:52.002Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}