From 921cf10e55e708aef0d3e8753a86c077edfd98ae Mon Sep 17 00:00:00 2001 From: Christian Frichot Date: Mon, 28 Nov 2011 07:27:49 +0800 Subject: [PATCH] Migration no longer re-adds existing modules to the database. You can now see previous results after you stop/start BeEF --- core/main/migration.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/main/migration.rb b/core/main/migration.rb index bafc94720..2ecfb3856 100644 --- a/core/main/migration.rb +++ b/core/main/migration.rb @@ -33,7 +33,11 @@ module Core def update_commands! config = BeEF::Core::Configuration.instance - db_modules = BeEF::Core::Models::CommandModule.all + db_modules = [] + BeEF::Core::Models::CommandModule.all.each do |mod| + db_modules << mod.name + end + config.get('beef.module').each{|k,v| BeEF::Core::Models::CommandModule.new(:name => k, :path => "#{v['path']}module.rb").save if not db_modules.include? k