diff --git a/lib/modules/msfcommand.rb b/lib/modules/msfcommand.rb index 2fd043466..fb0f61e08 100644 --- a/lib/modules/msfcommand.rb +++ b/lib/modules/msfcommand.rb @@ -63,6 +63,7 @@ class Msf < BeEF::Command @info['Name'] = msfinfo['name'] @info['Description'] = msfinfo['description'] @info['MsfModName'] = mod.name + @info['mod-id'] = mod.id @target = targets end @@ -109,6 +110,8 @@ class Msf < BeEF::Command 'mode' => 'local', 'reloadOnChange' => true, # this will trigger a reload of the payload options 'emptyText' => "select a payload..."} + + @info['Data'] << { 'name' => 'mod-id' , 'id' => 'mod-id', 'type' => 'hidden', 'value' => @info['mod-id'] } end diff --git a/public/javascript/ui/panel/common.js b/public/javascript/ui/panel/common.js index d8de52650..e8022957f 100644 --- a/public/javascript/ui/panel/common.js +++ b/public/javascript/ui/panel/common.js @@ -71,7 +71,7 @@ function generate_form_input_field(form, input, value, disabled, zombie) { fields: input['store_fields'], data: input['store_data'] }); - + input_field = new Ext.form.ComboBox(input_def); break; @@ -96,11 +96,12 @@ function generate_form_input_field(form, input, value, disabled, zombie) { function get_metasploit_payload_details(payload, zombie) { + modid = Ext.getCmp( 'form-zombie-'+zombie.session+'-field-mod-id').value Ext.Ajax.request({ loadMask: true, url: '/ui/modules/select/commandmodule.json', method: 'POST', - params: 'command_module_id=' + '29' + '&' + 'payload_name=' + payload, + params: 'command_module_id=' + modid + '&' + 'payload_name=' + payload, success: function(resp) { var module = Ext.decode(resp.responseText); module = module.command_modules[1]; @@ -369,6 +370,7 @@ function genNewExploitPanel(panel, command_module_id, command_module_name, zombi var payload_panel = new Ext.Panel({ id: 'payload-panel', // used with Ext.GetCmp('payload-panel') bodyStyle: 'padding:10px;', // we can assign styles to the main div + layout : 'form', bodyBorder: false, height:200, border: false //we can remove the border of the panel