diff --git a/core/module.rb b/core/module.rb index ae88459f5..fa9f15fca 100644 --- a/core/module.rb +++ b/core/module.rb @@ -31,6 +31,18 @@ module Module return (self.is_enabled(mod) and BeEF::Core::Configuration.instance.get('beef.module.'+mod.to_s+'.loaded') == true) end + def self.get_options(mod) + begin + class_name = BeEF::Core::Configuration.instance.get("beef.module.#{mod}.class") + class_symbol = BeEF::Core::Command.const_get(class_name) + if class_symbol + return class_symbol.options + end + rescue + print_debug "Unable to find module class: BeEF::Core::Commands::#{mod.capitalize}" + end + end + # Loads module def self.load(mod) config = BeEF::Core::Configuration.instance diff --git a/modules/misc/alert_dialog/module.rb b/modules/misc/alert_dialog/module.rb index 03ac0e92a..f2d339c77 100644 --- a/modules/misc/alert_dialog/module.rb +++ b/modules/misc/alert_dialog/module.rb @@ -39,6 +39,19 @@ class Alert_dialog < BeEF::Core::Command use_template! end + # set and return all options for this module + def self.options + return { + 'name' => 'alert_dialog', + 'description' => 'Sends an alert dialog to the victim', + 'type' => 'textarea', + 'filter' => '', + 'default_value' => 'Alert box text', + 'adminui_width' => '400px', + 'adminui_height' => '100px' + } + end + def callback content = {} content['User Response'] = "The user clicked the 'OK' button when presented with an alert box."