2014-06-02 17:57:48 +00:00
|
|
|
#
|
|
|
|
# Standard Library
|
|
|
|
#
|
|
|
|
|
|
|
|
require 'fileutils'
|
|
|
|
|
2014-10-02 19:20:10 +00:00
|
|
|
#
|
|
|
|
# Metasploit gem engines
|
|
|
|
#
|
|
|
|
|
|
|
|
require 'metasploit/model/engine'
|
|
|
|
require 'metasploit/concern/engine'
|
2014-10-03 19:06:13 +00:00
|
|
|
Metasploit::Framework::Require.optionally_require_metasploit_db_gem_engines
|
2014-10-02 19:20:10 +00:00
|
|
|
|
2014-06-02 17:57:48 +00:00
|
|
|
# `Rails::Engine` behavior common to both {Metasploit::Framework::Application} and {Metasploit::Framework::Engine}.
|
|
|
|
module Metasploit::Framework::CommonEngine
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
|
|
|
#
|
|
|
|
# config
|
|
|
|
#
|
|
|
|
|
|
|
|
# Force binary encoding to remove necessity to set external and internal encoding when construct Strings from
|
|
|
|
# from files. Socket#read always returns a String in ASCII-8bit encoding
|
|
|
|
#
|
|
|
|
# @see http://rubydoc.info/stdlib/core/IO:read
|
|
|
|
config.before_initialize do
|
|
|
|
encoding = 'binary'
|
|
|
|
Encoding.default_external = encoding
|
|
|
|
Encoding.default_internal = encoding
|
|
|
|
end
|
|
|
|
|
2014-08-12 18:53:28 +00:00
|
|
|
config.root = Msf::Config::install_root
|
2015-04-14 20:06:59 +00:00
|
|
|
config.paths.add 'app/concerns', autoload: true
|
2014-06-02 17:57:48 +00:00
|
|
|
config.paths.add 'data/meterpreter', glob: '**/ext_*'
|
|
|
|
config.paths.add 'modules'
|
|
|
|
|
2016-02-25 16:59:50 +00:00
|
|
|
config.active_support.deprecation = :stderr
|
2014-08-22 15:33:50 +00:00
|
|
|
|
2014-06-02 17:57:48 +00:00
|
|
|
#
|
|
|
|
# `initializer`s
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2014-10-02 19:20:10 +00:00
|
|
|
end
|