mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-07 21:21:33 +00:00
switching from HTTP proxy to SOCKS proxy for --tor (sick and tired of Polipo/Privoxy bull; either Tor flag is overwritten every here and there or they are putting all kinds of filter warnings)
This commit is contained in:
@@ -15,7 +15,9 @@ import urllib2
|
||||
import urlparse
|
||||
import traceback
|
||||
|
||||
from extra.socks.socks import GeneralProxyError
|
||||
from extra.multipart import multipartpost
|
||||
|
||||
from lib.core.agent import agent
|
||||
from lib.core.common import asciifyUrl
|
||||
from lib.core.common import average
|
||||
@@ -92,10 +94,20 @@ class Connect:
|
||||
warnMsg += "lower the --time-sec value (e.g. --time-sec=2)"
|
||||
singleTimeWarnMessage(warnMsg)
|
||||
elif kb.originalPage is None:
|
||||
warnMsg = "if the problem persists please check that the provided "
|
||||
warnMsg += "target url is valid. If it is, you can try to rerun "
|
||||
warnMsg += "with the --random-agent switch turned on "
|
||||
warnMsg += "and/or proxy switches (--ignore-proxy, --proxy,...)"
|
||||
if conf.tor:
|
||||
warnMsg = "please make sure that you have "
|
||||
warnMsg += "Tor installed and running so "
|
||||
warnMsg += "you could successfully use "
|
||||
warnMsg += "--tor switch "
|
||||
if IS_WIN:
|
||||
warnMsg += "(e.g. https://www.torproject.org/download/download.html.en)"
|
||||
else:
|
||||
warnMsg += "(e.g. https://help.ubuntu.com/community/Tor)"
|
||||
else:
|
||||
warnMsg = "if the problem persists please check that the provided "
|
||||
warnMsg += "target url is valid. If it is, you can try to rerun "
|
||||
warnMsg += "with the --random-agent switch turned on "
|
||||
warnMsg += "and/or proxy switches (--ignore-proxy, --proxy,...)"
|
||||
singleTimeWarnMessage(warnMsg)
|
||||
elif conf.threads > 1:
|
||||
warnMsg = "if the problem persists please try to lower "
|
||||
@@ -440,7 +452,7 @@ class Connect:
|
||||
processResponse(page, responseHeaders)
|
||||
return page, responseHeaders, code
|
||||
|
||||
except (urllib2.URLError, socket.error, socket.timeout, httplib.BadStatusLine, httplib.IncompleteRead), e:
|
||||
except (urllib2.URLError, socket.error, socket.timeout, httplib.BadStatusLine, httplib.IncompleteRead, GeneralProxyError), e:
|
||||
tbMsg = traceback.format_exc()
|
||||
|
||||
if "no host given" in tbMsg:
|
||||
|
||||
Reference in New Issue
Block a user