Force UTF-8 encoding for zombie HTTP headers

This commit is contained in:
Brendan Coles
2017-04-22 03:29:49 +00:00
parent c191a50f3c
commit f9f30eb49d
2 changed files with 2 additions and 2 deletions

View File

@@ -70,7 +70,7 @@ module BeEF
@http_headers = Hash.new
http_header = @data['request'].env.select { |k, v| k.to_s.start_with? 'HTTP_' }
.each { |key, value|
@http_headers[key.sub(/^HTTP_/, '')] = value
@http_headers[key.sub(/^HTTP_/, '')] = value.force_encoding('UTF-8')
}
zombie.httpheaders = @http_headers.to_json
zombie.save

View File

@@ -31,7 +31,7 @@ module BeEF
@http_params = @data['request'].params
@http_header = Hash.new
http_header = @data['request'].env.select { |k, v| k.to_s.start_with? 'HTTP_' }.each { |key, value|
@http_header[key.sub(/^HTTP_/, '')] = value
@http_header[key.sub(/^HTTP_/, '')] = value.force_encoding('UTF-8')
}
# @note get and check command id from the request