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

Function _checkTor

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

Source from the content-addressed store, hash-verified

2549 raise SqlmapMissingDependence(errMsg)
2550
2551def _checkTor():
2552 if not conf.checkTor:
2553 return
2554
2555 infoMsg = "checking Tor connection"
2556 logger.info(infoMsg)
2557
2558 try:
2559 page, _, _ = Request.getPage(url="https://check.torproject.org/api/ip", raise404=False)
2560 tor_status = json.loads(page)
2561 except (SqlmapConnectionException, TypeError, ValueError):
2562 tor_status = None
2563
2564 if not tor_status or not tor_status.get("IsTor"):
2565 errMsg = "it appears that Tor is not properly set. Please try using options '--tor-type' and/or '--tor-port'"
2566 raise SqlmapConnectionException(errMsg)
2567 else:
2568 infoMsg = "Tor is properly being used"
2569 logger.info(infoMsg)
2570
2571def _basicOptionValidation():
2572 if conf.limitStart is not None and not (isinstance(conf.limitStart, int) and conf.limitStart > 0):

Callers 1

initFunction · 0.85

Calls 4

infoMethod · 0.80
getPageMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…