2007-04-05 05:08:21 +00:00
|
|
|
#
|
2007-03-24 23:28:46 +00:00
|
|
|
# Force the application into production mode
|
2007-04-05 05:08:21 +00:00
|
|
|
#
|
2007-02-19 04:06:29 +00:00
|
|
|
ENV['RAILS_ENV'] = 'production'
|
2006-09-24 00:21:23 +00:00
|
|
|
|
2007-03-24 23:03:19 +00:00
|
|
|
|
2006-09-24 00:21:23 +00:00
|
|
|
# Specifies gem version of Rails to use when vendor/rails is not present
|
2007-03-24 23:03:19 +00:00
|
|
|
RAILS_GEM_VERSION = '1.2.2' unless defined? RAILS_GEM_VERSION
|
2006-09-24 00:21:23 +00:00
|
|
|
|
|
|
|
# Bootstrap the Rails environment, frameworks, and default configuration
|
|
|
|
require File.join(File.dirname(__FILE__), 'boot')
|
|
|
|
|
2007-04-03 04:10:09 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# New versions of Rails force the KCODE to unicode. This breaks
|
|
|
|
# binary string generation used by Metasploit for shellcode,
|
|
|
|
# text generation, and encoding. We override the initialize_encoding
|
|
|
|
# method and force KCODE to be 'NONE'
|
|
|
|
#
|
|
|
|
class Rails::Initializer
|
|
|
|
def initialize_encoding
|
|
|
|
$KCODE = 'NONE'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Initialize Rails
|
2006-09-24 00:21:23 +00:00
|
|
|
Rails::Initializer.run do |config|
|
2007-03-24 23:28:46 +00:00
|
|
|
config.log_level = :warn
|
|
|
|
config.active_record.allow_concurrency = true
|
2006-09-24 00:21:23 +00:00
|
|
|
end
|
|
|
|
|
2007-02-04 07:58:01 +00:00
|
|
|
|
2006-09-24 01:26:16 +00:00
|
|
|
msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
|
|
|
|
$:.unshift(File.join(File.dirname(msfbase), '..', '..', '..', 'lib'))
|
|
|
|
|
|
|
|
require 'rex'
|
|
|
|
require 'msf/ui'
|
|
|
|
require 'msf/base'
|
|
|
|
|
2007-01-19 08:46:06 +00:00
|
|
|
$msfweb = Msf::Ui::Web::Driver.new({'LogLevel' => 5})
|
|
|
|
$msframework = $msfweb.framework
|
2007-02-04 07:58:01 +00:00
|
|
|
|
2007-03-24 06:50:43 +00:00
|
|
|
if ($browser_start)
|
|
|
|
Thread.new do
|
|
|
|
|
2007-03-24 23:03:19 +00:00
|
|
|
select(nil, nil, nil, 0.5)
|
2007-03-24 06:50:43 +00:00
|
|
|
|
|
|
|
case RUBY_PLATFORM
|
|
|
|
when /mswin32/
|
|
|
|
system("start #{$browser_url}")
|
|
|
|
when /darwin/
|
|
|
|
system("open #{$browser_url}")
|
|
|
|
else
|
|
|
|
system("firefox #{$browser_url} &")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|