Added support for encoding and storing requests of type image. Fixes issue 368.
git-svn-id: https://beef.googlecode.com/svn/trunk@1200 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
@@ -61,7 +61,7 @@ beef.encode.base64 = {
|
||||
|
||||
decode : function (input) {
|
||||
if (window.atob) {
|
||||
return atob(escape(input));
|
||||
return escape(atob(input));
|
||||
}
|
||||
|
||||
var output = "";
|
||||
|
||||
@@ -72,15 +72,13 @@ module Requester
|
||||
http_db.response_date = Time.now
|
||||
http_db.has_ran = true
|
||||
|
||||
# temporary hack to prevent MySQL errors when saving images
|
||||
# see issue http://code.google.com/p/beef/issues/detail?id=368
|
||||
if BeEF::Core::Configuration.instance.get("beef.database.default") == "mysql"
|
||||
if http_db.response_headers.to_s =~ /Content-Type: image/
|
||||
print_debug("Found [Content-Type: image] in the http response headers: saving dummy data instead of original raw image data")
|
||||
http_db.response_data = "IMAGE CONTENT"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# Store images as binary
|
||||
# see issue http://code.google.com/p/beef/issues/detail?id=368
|
||||
if http_db.response_headers =~ /Content-Type: image/
|
||||
http_db.response_data = http_db.response_data.unpack('a*')
|
||||
end
|
||||
|
||||
|
||||
http_db.save
|
||||
end
|
||||
|
||||
@@ -34,7 +34,7 @@ module Models
|
||||
property :request, Text, :lazy => true
|
||||
|
||||
# The http response body received. In clear text.
|
||||
property :response_data, Text, :lazy => true
|
||||
property :response_data, Binary, :lazy => true, :length => 2097152
|
||||
|
||||
# The http response code. Useful to handle cases like 404, 500, 302, ...
|
||||
property :response_status_code, Integer, :lazy => true
|
||||
|
||||
Reference in New Issue
Block a user