few minor fixes

This commit is contained in:
Miroslav Stampar 2011-05-13 09:56:12 +00:00
parent a7d7be5ce0
commit 053c245114

View File

@ -95,6 +95,7 @@ class Connect:
method = kwargs.get('method', None) method = kwargs.get('method', None)
cookie = kwargs.get('cookie', None) cookie = kwargs.get('cookie', None)
ua = kwargs.get('ua', None) ua = kwargs.get('ua', None)
host = kwargs.get('host', None)
referer = kwargs.get('referer', None) referer = kwargs.get('referer', None)
direct = kwargs.get('direct', False) direct = kwargs.get('direct', False)
multipart = kwargs.get('multipart', False) multipart = kwargs.get('multipart', False)
@ -104,10 +105,11 @@ class Connect:
response = kwargs.get('response', False) response = kwargs.get('response', False)
ignoreTimeout = kwargs.get('ignoreTimeout', False) ignoreTimeout = kwargs.get('ignoreTimeout', False)
refreshing = kwargs.get('refreshing', False) refreshing = kwargs.get('refreshing', False)
target = kwargs.get('target', True)
page = "" page = ""
cookieStr = "" cookieStr = ""
requestMsg = "HTTP request [#%d]:\n%s " % (threadData.lastRequestUID, conf.method) requestMsg = "HTTP request [#%d]:\n%s " % (threadData.lastRequestUID, method or conf.method)
requestMsg += "%s" % urlparse.urlsplit(url)[2] or "/" requestMsg += "%s" % urlparse.urlsplit(url)[2] or "/"
responseMsg = "HTTP response " responseMsg = "HTTP response "
requestHeaders = "" requestHeaders = ""
@ -150,7 +152,7 @@ class Connect:
get = None get = None
post = None post = None
else: elif target:
if conf.parameters.has_key(PLACE.GET) and not get: if conf.parameters.has_key(PLACE.GET) and not get:
get = conf.parameters[PLACE.GET] get = conf.parameters[PLACE.GET]
@ -164,6 +166,10 @@ class Connect:
post = conf.parameters[place] post = conf.parameters[place]
break break
elif get:
url = "%s?%s" % (url, get)
requestMsg += "?%s" % get
requestMsg += " %s" % httplib.HTTPConnection._http_vsn_str requestMsg += " %s" % httplib.HTTPConnection._http_vsn_str
# Perform HTTP request # Perform HTTP request
@ -178,7 +184,7 @@ class Connect:
if kb.proxyAuthHeader: if kb.proxyAuthHeader:
headers[HTTPHEADER.PROXY_AUTHORIZATION] = kb.proxyAuthHeader headers[HTTPHEADER.PROXY_AUTHORIZATION] = kb.proxyAuthHeader
headers[HTTPHEADER.HOST] = urlparse.urlparse(url).netloc headers[HTTPHEADER.HOST] = host or urlparse.urlparse(url).netloc
if auxHeaders: if auxHeaders:
for key, item in auxHeaders.items(): for key, item in auxHeaders.items():
@ -237,7 +243,7 @@ class Connect:
if hasattr(conn, "setcookie"): if hasattr(conn, "setcookie"):
kb.redirectSetCookie = conn.setcookie kb.redirectSetCookie = conn.setcookie
if hasattr(conn, "redurl") and hasattr(conn, "redcode") and not conf.redirectHandled and not conf.realTest: if hasattr(conn, "redurl") and hasattr(conn, "redcode") and target and not conf.redirectHandled and not conf.realTest:
msg = "sqlmap got a %d redirect to " % conn.redcode msg = "sqlmap got a %d redirect to " % conn.redcode
msg += "%s - What target address do you " % conn.redurl msg += "%s - What target address do you " % conn.redurl
msg += "want to use from now on? %s " % conf.url msg += "want to use from now on? %s " % conf.url