Skip to content

Commit 21d5e63

Browse files
committed
Land rapid7#3400, last msftody set-cookie warnings
2 parents 3f86aeb + 8a2236e commit 21d5e63

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

modules/auxiliary/crawler/msfcrawler.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,6 @@ def sendreq(nclient,reqopts={})
258258
# In case modules or crawler calls to_s on de-chunked responses
259259
#
260260
resp.transfer_chunked = false
261-
if resp['Set-Cookie']
262-
#puts "Set Cookie: #{resp['Set-Cookie']}"
263-
#puts "Storing in cookie jar for host:port #{reqopts['rhost']}:#{reqopts['rport']}"
264-
#$cookiejar["#{reqopts['rhost']}:#{reqopts['rport']}"] = resp['Set-Cookie']
265-
end
266261

267262
if datastore['StoreDB']
268263
storedb(reqopts,resp,$dbpathmsf)

modules/auxiliary/scanner/http/crawler.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ def crawler_process_page(t, page, cnt)
104104
info[:ctype] = page.headers['content-type']
105105
end
106106

107-
if page.headers['set-cookie']
108-
info[:cookie] = page.headers['set-cookie']
107+
if !page.get_cookies.empty?
108+
info[:cookie] = page.get_cookies
109109
end
110110

111111
if page.headers['authorization']

modules/exploits/multi/http/dexter_casinoloader_exec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ def database_get_field(table, column, row)
7979
'page' => Rex::Text.encode_base64("' AND 1=2 UNION ALL SELECT 1," + column + ",3 FROM " + table + " LIMIT 1 OFFSET " + row.to_s + " -- --")
8080
}
8181
})
82-
if res and res.headers.has_key?('Set-Cookie') and res.headers['Set-Cookie'].start_with?('response=')
83-
return Rex::Text.decode_base64(URI.unescape(res.headers['Set-Cookie']['response='.length..-1]))[1..-3]
82+
if res and !res.get_cookies.empty? and res.get_cookies.start_with?('response=')
83+
return Rex::Text.decode_base64(URI.unescape(res.get_cookies['response='.length..-1]))[1..-3]
8484
end
8585
return false
8686
end
@@ -96,8 +96,8 @@ def check
9696
}
9797
})
9898

99-
if res and res.headers.has_key?('Set-Cookie') and res.headers['Set-Cookie'].start_with?('response=') and
100-
Rex::Text.decode_base64(URI.unescape(res.headers['Set-Cookie']['response='.length..-1])) == '$' + testvalue + ';#' and database_get_field('users', 'name', 0) != false
99+
if res and !res.get_cookies.empty? and res.get_cookies.start_with?('response=') and
100+
Rex::Text.decode_base64(URI.unescape(res.get_cookies['response='.length..-1])) == '$' + testvalue + ';#' and database_get_field('users', 'name', 0) != false
101101
return Exploit::CheckCode::Vulnerable
102102
end
103103
return Exploit::CheckCode::Safe
@@ -167,4 +167,4 @@ def exploit
167167
return
168168
end
169169
end
170-
end
170+
end

0 commit comments

Comments
 (0)