diff --git a/lib/msf/ui/console/driver.rb b/lib/msf/ui/console/driver.rb index a1d6f61b30..399c0781c2 100644 --- a/lib/msf/ui/console/driver.rb +++ b/lib/msf/ui/console/driver.rb @@ -167,7 +167,7 @@ class Driver < Msf::Ui::Driver end # Parse any specified database.yml file - if framework.db.usable and not opts['SkipDatabaseInit'] and not opts['Framework'] + if framework.db.usable and not opts['SkipDatabaseInit'] # Append any migration paths necessary to bring the database online if opts['DatabaseMigrationPaths'] diff --git a/lib/msf/ui/web/console.rb b/lib/msf/ui/web/console.rb index 1b0c08a8fa..17dadcdecd 100644 --- a/lib/msf/ui/web/console.rb +++ b/lib/msf/ui/web/console.rb @@ -47,6 +47,11 @@ class WebConsole # Create a read subscriber self.pipe.create_subscriber('msfweb') + # Skip database initialization if it is already configured + if framework.db and framework.db.usable and framework.db.migrated + opts['SkipDatabaseInit'] = true + end + # Initialize the console with our pipe self.console = Msf::Ui::Console::Driver.new( 'msf',