Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/lib/metasploit/framework/common_engine.rb
Views: 11779
#1# Standard Library2#34require 'fileutils'56#7# Metasploit gem engines8#910require 'metasploit/model/engine'11require 'metasploit/concern/engine'12require 'metasploit/framework/require'13Metasploit::Framework::Require.optionally_require_metasploit_db_gem_engines1415# `Rails::Engine` behavior common to both {Metasploit::Framework::Application} and {Metasploit::Framework::Engine}.16module Metasploit::Framework::CommonEngine17extend ActiveSupport::Concern1819included do20#21# config22#2324# Force binary encoding to remove necessity to set external and internal encoding when construct Strings from25# from files. Socket#read always returns a String in ASCII-8bit encoding26#27# @see http://rubydoc.info/stdlib/core/IO:read28config.before_initialize do29encoding = 'binary'30::Encoding.default_external = encoding31::Encoding.default_internal = encoding32end3334config.root = Msf::Config::install_root35config.paths.add 'app/models', autoload: true36config.paths.add 'app/concerns', autoload: true37config.paths.add 'data/meterpreter', glob: '**/ext_*'38config.paths.add 'modules'3940config.active_support.deprecation = :stderr4142if ActiveRecord.respond_to?(:legacy_connection_handling=)43ActiveRecord.legacy_connection_handling = false44end4546# @see https://github.com/rapid7/metasploit_data_models/blob/54a17149d5ccd0830db742d14c4987b48399ceb7/lib/metasploit_data_models/yaml.rb#L1047# @see https://github.com/rapid7/metasploit_data_models/blob/54a17149d5ccd0830db742d14c4987b48399ceb7/lib/metasploit_data_models/base64_serializer.rb#L28-L3148ActiveRecord.yaml_column_permitted_classes = (ActiveRecord.yaml_column_permitted_classes + MetasploitDataModels::YAML::PERMITTED_CLASSES).uniq4950#51# `initializer`s52#535455end5657end585960