{"record":{"id":"61c247afa9a8d70d","repo":"sqlmapproject/sqlmap","slug":"can-t-establish-connection-with-the-tor-socks-prox","errorCode":null,"errorMessage":"can't establish connection with the Tor SOCKS proxy. Please make sure that you have Tor service installed and setup so you could be able to successfully use switch '--tor' ","messagePattern":"can't establish connection with the Tor SOCKS proxy\\. Please make sure that you have Tor service installed and setup so you could be able to successfully use switch '--tor' ","errorType":"exception","errorClass":"SqlmapConnectionException","httpStatus":null,"severity":"error","filePath":"lib/core/option.py","lineNumber":2729,"sourceCode":"    if not conf.checkTor:\n        warnMsg = \"use switch '--check-tor' at \"\n        warnMsg += \"your own convenience when accessing \"\n        warnMsg += \"Tor anonymizing network because of \"\n        warnMsg += \"known issues with default settings of various 'bundles' \"\n        warnMsg += \"(e.g. Vidalia)\"\n        logger.warning(warnMsg)\n\ndef _setTorSocksProxySettings():\n    infoMsg = \"setting Tor SOCKS proxy settings\"\n    logger.info(infoMsg)\n\n    port = findLocalPort(DEFAULT_TOR_SOCKS_PORTS if not conf.torPort else (conf.torPort,))\n\n    if not port:\n        errMsg = \"can't establish connection with the Tor SOCKS proxy. \"\n        errMsg += \"Please make sure that you have Tor service installed and setup \"\n        errMsg += \"so you could be able to successfully use switch '--tor' \"\n        raise SqlmapConnectionException(errMsg)\n\n    # SOCKS5 to prevent DNS leaks (http://en.wikipedia.org/wiki/Tor_%28anonymity_network%29)\n    socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5 if conf.torType == PROXY_TYPE.SOCKS5 else socks.PROXY_TYPE_SOCKS4, LOCALHOST, port)\n    socks.wrapmodule(_http_client)\n\ndef _setHttpOptions():\n    if conf.chunked and conf.data:\n        if hasattr(_http_client.HTTPConnection, \"_set_content_length\"):\n            _http_client.HTTPConnection._set_content_length = lambda self, *args, **kwargs: None\n        else:\n            def putheader(self, header, *values):\n                if header != HTTP_HEADER.CONTENT_LENGTH:\n                    self._putheader(header, *values)\n\n            if not hasattr(_http_client.HTTPConnection, \"_putheader\"):\n                _http_client.HTTPConnection._putheader = _http_client.HTTPConnection.putheader\n\n            _http_client.HTTPConnection.putheader = putheader","sourceCodeStart":2711,"sourceCodeEnd":2747,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/lib/core/option.py#L2711-L2747","documentation":"Error \"can't establish connection with the Tor SOCKS proxy. Please make sure that you have Tor service installed and setup so you could be able to successfully use switch '--tor' \" thrown in sqlmapproject/sqlmap.","triggerScenarios":"Thrown at lib/core/option.py:2729 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"}