Skip to content

Commit

Permalink
Make -n option available to msfrpcd too.
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/svn/framework3/trunk@11593 4d416f70-5f16-0410-b530-b9f4589650da
  • Loading branch information
scriptjunkie committed Jan 17, 2011
1 parent 1d7745d commit 400e0a9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions msfrpcd
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ arguments = Rex::Parser::Arguments.new(
"-u" => [ true, "URI for Web server" ],
"-S" => [ false, "Disable SSL on the XMLRPC socket" ],
"-f" => [ false, "Run the daemon in the foreground" ],
"-n" => [ false, "Disable database" ],
"-h" => [ false, "Help banner" ])

opts = {
Expand All @@ -39,6 +40,7 @@ opts = {
}

foreground = false
frameworkOpts = {}


# Parse command line arguments.
Expand All @@ -60,6 +62,8 @@ arguments.parse(ARGV) { |opt, idx, val|
opts['ServerType'] = val
when "-u"
opts['URI'] = val
when "-n"
frameworkOpts['DisableDatabase'] = true
when "-h"
print("\nUsage: #{File.basename(__FILE__)} <options>\n" + arguments.usage)
exit
Expand All @@ -81,7 +85,7 @@ require 'msf/base'
require 'msf/ui'

# Create an instance of the framework
$framework = Msf::Simple::Framework.create
$framework = Msf::Simple::Framework.create(frameworkOpts)

# Fork into the background if requested
begin
Expand All @@ -93,7 +97,7 @@ rescue ::NotImplementedError
$stderr.puts "[-] Background mode is not available on this platform"
end

$framework.db.sink.restart if RUBY_PLATFORM !~ /cygwin/
$framework.db.sink.restart if RUBY_PLATFORM !~ /cygwin/ and not frameworkOpts['DisableDatabase']

# Run the plugin instance in the foreground.
begin
Expand Down

0 comments on commit 400e0a9

Please sign in to comment.