Update for an Issue #431

This commit is contained in:
Miroslav Stampar 2014-11-21 09:41:39 +01:00
parent 34ce774acd
commit cf2d5fd453
5 changed files with 16 additions and 8 deletions

View File

@ -269,7 +269,7 @@ def start():
for targetUrl, targetMethod, targetData, targetCookie, targetHeaders in kb.targets: for targetUrl, targetMethod, targetData, targetCookie, targetHeaders in kb.targets:
try: try:
conf.url = targetUrl conf.url = targetUrl
conf.method = targetMethod conf.method = targetMethod.upper() if targetMethod else targetMethod
conf.data = targetData conf.data = targetData
conf.cookie = targetCookie conf.cookie = targetCookie
conf.httpHeaders = list(initialHeaders) conf.httpHeaders = list(initialHeaders)

View File

@ -23,6 +23,7 @@ optDict = {
}, },
"Request": { "Request": {
"method": "string",
"data": "string", "data": "string",
"paramDel": "string", "paramDel": "string",
"cookie": "string", "cookie": "string",

View File

@ -90,6 +90,9 @@ def cmdLineParser():
request = OptionGroup(parser, "Request", "These options can be used " request = OptionGroup(parser, "Request", "These options can be used "
"to specify how to connect to the target URL") "to specify how to connect to the target URL")
request.add_option("--method", dest="method",
help="Force usage of given HTTP method (e.g. PUT)")
request.add_option("--data", dest="data", request.add_option("--data", dest="data",
help="Data string to be sent through POST") help="Data string to be sent through POST")

View File

@ -307,7 +307,7 @@ class Connect(object):
url = "%s?%s" % (url, get) url = "%s?%s" % (url, get)
requestMsg += "?%s" % get requestMsg += "?%s" % get
if PLACE.POST in conf.parameters and not post and method in (None, HTTPMETHOD.POST): if PLACE.POST in conf.parameters and not post and method != HTTPMETHOD.GET:
post = conf.parameters[PLACE.POST] post = conf.parameters[PLACE.POST]
elif get: elif get:
@ -634,6 +634,7 @@ class Connect(object):
auxHeaders = {} auxHeaders = {}
raise404 = place != PLACE.URI if raise404 is None else raise404 raise404 = place != PLACE.URI if raise404 is None else raise404
method = method or conf.method
value = agent.adjustLateValues(value) value = agent.adjustLateValues(value)
payload = agent.extractPayload(value) payload = agent.extractPayload(value)

View File

@ -40,31 +40,34 @@ sitemapUrl =
# These options can be used to specify how to connect to the target URL. # These options can be used to specify how to connect to the target URL.
[Request] [Request]
# Force usage of given HTTP method (e.g. PUT).
method =
# Data string to be sent through POST. # Data string to be sent through POST.
data = data =
# Character used for splitting parameter values # Character used for splitting parameter values.
paramDel = paramDel =
# HTTP Cookie header value. # HTTP Cookie header value.
cookie = cookie =
# Character used for splitting cookie values # Character used for splitting cookie values.
cookieDel = cookieDel =
# File containing cookies in Netscape/wget format # File containing cookies in Netscape/wget format.
loadCookies = loadCookies =
# Ignore Set-Cookie header from response # Ignore Set-Cookie header from response.
# Valid: True or False # Valid: True or False
dropSetCookie = False dropSetCookie = False
# HTTP User-Agent header value. Useful to fake the HTTP User-Agent header value # HTTP User-Agent header value. Useful to fake the HTTP User-Agent header value
# at each HTTP request # at each HTTP request.
# sqlmap will also test for SQL injection on the HTTP User-Agent value. # sqlmap will also test for SQL injection on the HTTP User-Agent value.
agent = agent =
# Use randomly selected HTTP User-Agent header value # Use randomly selected HTTP User-Agent header value.
# Valid: True or False # Valid: True or False
randomAgent = False randomAgent = False