Skip to content

Commit

Permalink
(1.1.0) [Fixed #15] makeQueryPattern 내 페이로드 생성 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hahwul committed Jul 26, 2019
1 parent e86d4c9 commit 562c720
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/XSpear.rb
Original file line number Diff line number Diff line change
Expand Up @@ -489,22 +489,26 @@ def makeQueryPattern(type, payload, pattern, category, desc, callback)
params = URI.decode_www_form(uri.query)
params.each do |p|
if @params.nil? || (@params.include? p[0] if !@params.nil?)
attack = ""
dparams = params
dparams.each do |d|
d[1] = p[1] + payload if p[0] == d[0]
attack = uri.query.sub "#{d[0]}=#{d[1]}","#{d[0]}=#{d[1]}#{URI::encode(payload)}" if p[0] == d[0]
#d[1] = p[1] + payload if p[0] == d[0]
end
result.push("inject": 'url',"param":p[0] ,"type": type, "query": URI.encode_www_form(dparams), "pattern": pattern, "desc": desc, "category": category, "callback": callback)
result.push("inject": 'url',"param":p[0] ,"type": type, "query": attack, "pattern": pattern, "desc": desc, "category": category, "callback": callback)
end
end
unless @data.nil?
params = URI.decode_www_form(@data)
params.each do |p|
if @params.nil? || (@params.include? p[0] if !@params.nil?)
attack = ""
dparams = params
dparams.each do |d|
d[1] = p[1] + payload if p[0] == d[0]
attack = uri.query.sub "#{d[0]}=#{d[1]}","#{d[0]}=#{d[1]}#{URI::encode(payload)}" if p[0] == d[0]
#d[1] = p[1] + payload if p[0] == d[0]
end
result.push("inject": 'body', "param":p[0], "type": type, "query": URI.encode_www_form(dparams), "pattern": pattern, "desc": desc, "category": category, "callback": callback)
result.push("inject": 'body', "param":p[0], "type": type, "query": attack, "pattern": pattern, "desc": desc, "category": category, "callback": callback)
end
end
end
Expand Down

0 comments on commit 562c720

Please sign in to comment.