MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / _setTorSocksProxySettings

Function _setTorSocksProxySettings

lib/core/option.py:2509–2523  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2507 logger.warning(warnMsg)
2508
2509def _setTorSocksProxySettings():
2510 infoMsg = "setting Tor SOCKS proxy settings"
2511 logger.info(infoMsg)
2512
2513 port = findLocalPort(DEFAULT_TOR_SOCKS_PORTS if not conf.torPort else (conf.torPort,))
2514
2515 if not port:
2516 errMsg = "can't establish connection with the Tor SOCKS proxy. "
2517 errMsg += "Please make sure that you have Tor service installed and setup "
2518 errMsg += "so you could be able to successfully use switch '--tor' "
2519 raise SqlmapConnectionException(errMsg)
2520
2521 # SOCKS5 to prevent DNS leaks (http://en.wikipedia.org/wiki/Tor_%28anonymity_network%29)
2522 socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5 if conf.torType == PROXY_TYPE.SOCKS5 else socks.PROXY_TYPE_SOCKS4, LOCALHOST, port)
2523 socks.wrapmodule(_http_client)
2524
2525def _setHttpOptions():
2526 if conf.chunked and conf.data:

Callers 1

_setTorProxySettingsFunction · 0.85

Calls 3

findLocalPortFunction · 0.90
infoMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…