From f9f30eb49d00b0ed97d8ebdfa66916dadf68c7b9 Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Sat, 22 Apr 2017 03:29:49 +0000 Subject: [PATCH] Force UTF-8 encoding for zombie HTTP headers --- core/main/handlers/browserdetails.rb | 2 +- core/main/handlers/commands.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/main/handlers/browserdetails.rb b/core/main/handlers/browserdetails.rb index 31f63e107..c68b0afe2 100644 --- a/core/main/handlers/browserdetails.rb +++ b/core/main/handlers/browserdetails.rb @@ -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 diff --git a/core/main/handlers/commands.rb b/core/main/handlers/commands.rb index 5d0611abc..9a7376f01 100644 --- a/core/main/handlers/commands.rb +++ b/core/main/handlers/commands.rb @@ -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