From fe4ece8715615a1049169a858d7ccdb1ac997096 Mon Sep 17 00:00:00 2001 From: "sussurro@happypacket.net" Date: Wed, 22 Dec 2010 18:58:12 +0000 Subject: [PATCH] Addition of table "dynamic_command_info" which is designed to hold cache information about dynamically loaded modules. This information will allow the tree pane to be populated without frequent queries directly into a dynamic module sourcebackend such as Metasploit. git-svn-id: https://beef.googlecode.com/svn/trunk@633 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9 --- lib/loader.rb | 1 + lib/model/commandmodule.rb | 4 +++- lib/model/dynamiccommandinfo.rb | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 lib/model/dynamiccommandinfo.rb diff --git a/lib/loader.rb b/lib/loader.rb index da60a22c4..f71f923cb 100644 --- a/lib/loader.rb +++ b/lib/loader.rb @@ -37,6 +37,7 @@ require 'lib/model/plugin' require 'lib/model/http' require 'lib/model/browserdetails' require 'lib/model/distributedenginerules' +require 'lib/model/dynamiccommandinfo' require 'lib/crypto' diff --git a/lib/model/commandmodule.rb b/lib/model/commandmodule.rb index 4a8829119..ab8681292 100644 --- a/lib/model/commandmodule.rb +++ b/lib/model/commandmodule.rb @@ -12,8 +12,10 @@ class CommandModule property :name, Text, :lazy => false has n, :commands + has 1, :dynamic_command_info + end end -end \ No newline at end of file +end diff --git a/lib/model/dynamiccommandinfo.rb b/lib/model/dynamiccommandinfo.rb new file mode 100644 index 000000000..4b60c016d --- /dev/null +++ b/lib/model/dynamiccommandinfo.rb @@ -0,0 +1,19 @@ +module BeEF +module Models + +class DynamicCommandInfo + + include DataMapper::Resource + + storage_names[:default] = 'dynamic_command_info' + + property :id, Serial + property :name, Text, :lazy => false + property :description, Text, :lazy => false + belongs_to :command_module + +end + +end +end +