{"record":{"id":"73441937068dd111","repo":"sqlmapproject/sqlmap","slug":"you-need-to-run-sqlmap-as-an-administrator-if-you","errorCode":null,"errorMessage":"you need to run sqlmap as an administrator if you want to perform a SMB relay attack because it will need to listen on a user-specified SMB TCP port for incoming connection attempts","messagePattern":"you need to run sqlmap as an administrator if you want to perform a SMB relay attack because it will need to listen on a user-specified SMB TCP port for incoming connection attempts","errorType":"exception","errorClass":"SqlmapMissingPrivileges","httpStatus":null,"severity":"error","filePath":"lib/core/option.py","lineNumber":674,"sourceCode":"            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:\n        for path in (conf.msfPath, os.path.join(conf.msfPath, \"bin\")):\n            if any(os.path.exists(normalizePath(os.path.join(path, \"%s%s\" % (_, \".bat\" if IS_WIN else \"\")))) for _ in (\"msfcli\", \"msfconsole\")):\n                msfEnvPathExists = True\n                if all(os.path.exists(normalizePath(os.path.join(path, \"%s%s\" % (_, \".bat\" if IS_WIN else \"\")))) for _ in (\"msfvenom\",)):\n                    kb.oldMsf = False\n                elif all(os.path.exists(normalizePath(os.path.join(path, \"%s%s\" % (_, \".bat\" if IS_WIN else \"\")))) for _ in (\"msfencode\", \"msfpayload\")):\n                    kb.oldMsf = True\n                else:\n                    msfEnvPathExists = False\n\n                conf.msfPath = path\n                break\n\n        if msfEnvPathExists:\n            debugMsg = \"provided Metasploit Framework path \"\n            debugMsg += \"'%s' is valid\" % conf.msfPath","sourceCodeStart":656,"sourceCodeEnd":692,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/lib/core/option.py#L656-L692","documentation":"Error \"you need to run sqlmap as an administrator if you want to perform a SMB relay attack because it will need to listen on a user-specified SMB TCP port for incoming connection attempts\" thrown in sqlmapproject/sqlmap.","triggerScenarios":"Thrown at lib/core/option.py:674 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"}