Files
metasploit-gs/data/msfweb/config/environment.rb
T

58 lines
1.3 KiB
Ruby
Raw Normal View History

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'
2007-03-24 23:03:19 +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
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
#
# 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
Rails::Initializer.run do |config|
2007-03-24 23:28:46 +00:00
config.log_level = :warn
config.active_record.allow_concurrency = true
end
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
if ($browser_start)
Thread.new do
2007-03-24 23:03:19 +00:00
select(nil, nil, nil, 0.5)
case RUBY_PLATFORM
when /mswin32/
system("start #{$browser_url}")
when /darwin/
system("open #{$browser_url}")
else
system("firefox #{$browser_url} &")
end
end
end