{"record":{"id":"cf6ddcbf17069017","repo":"sqlmapproject/sqlmap","slug":"sqlmap-requires-third-party-module-pywin32-in-or","errorCode":null,"errorMessage":"sqlmap requires third-party module 'pywin32' in order to use Metasploit functionalities on Windows. You can download it from 'https://github.com/mhammond/pywin32'","messagePattern":"sqlmap requires third-party module 'pywin32' in order to use Metasploit functionalities on Windows\\. You can download it from 'https://github\\.com/mhammond/pywin32'","errorType":"exception","errorClass":"SqlmapMissingDependence","httpStatus":null,"severity":"error","filePath":"lib/core/option.py","lineNumber":658,"sourceCode":"\ndef _setMetasploit():\n    if not conf.osPwn and not conf.osSmb and not conf.osBof:\n        return\n\n    debugMsg = \"setting the takeover out-of-band functionality\"\n    logger.debug(debugMsg)\n\n    msfEnvPathExists = False\n\n    if IS_WIN:\n        try:\n            __import__(\"win32file\")\n        except ImportError:\n            errMsg = \"sqlmap requires third-party module 'pywin32' \"\n            errMsg += \"in order to use Metasploit functionalities on \"\n            errMsg += \"Windows. You can download it from \"\n            errMsg += \"'https://github.com/mhammond/pywin32'\"\n            raise SqlmapMissingDependence(errMsg)\n\n        if not conf.msfPath:\n            for candidate in os.environ.get(\"PATH\", \"\").split(';'):\n                if all(_ in candidate for _ in (\"metasploit\", \"bin\")):\n                    conf.msfPath = os.path.dirname(candidate.rstrip('\\\\'))\n                    break\n\n    if conf.osSmb:\n        isAdmin = runningAsAdmin()\n\n        if not isAdmin:\n            errMsg = \"you need to run sqlmap as an administrator \"\n            errMsg += \"if you want to perform a SMB relay attack because \"\n            errMsg += \"it will need to listen on a user-specified SMB \"\n            errMsg += \"TCP port for incoming connection attempts\"\n            raise SqlmapMissingPrivileges(errMsg)\n\n    if conf.msfPath:","sourceCodeStart":640,"sourceCodeEnd":676,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/lib/core/option.py#L640-L676","documentation":"Error \"sqlmap requires third-party module 'pywin32' in order to use Metasploit functionalities on Windows. You can download it from 'https://github.com/mhammond/pywin32'\" thrown in sqlmapproject/sqlmap.","triggerScenarios":"Thrown at lib/core/option.py:658 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0a35b20e3953d341be6c7ac75ccb0b3362540c8d","analyzedAt":"2026-08-26T23:02:52.002Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}