Use zeitwerk for lib/msf/core folder

This commit is contained in:
dwelch-r7
2020-09-22 02:56:51 +01:00
parent d7852716f9
commit 1617b3ec9b
1299 changed files with 905 additions and 3083 deletions
+2
View File
@@ -84,6 +84,7 @@ PATH
windows_error windows_error
xdr xdr
xmlrpc xmlrpc
zeitwerk
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
@@ -439,6 +440,7 @@ GEM
activesupport (>= 4.2, < 7.0) activesupport (>= 4.2, < 7.0)
xmlrpc (0.3.1) xmlrpc (0.3.1)
yard (0.9.25) yard (0.9.25)
zeitwerk (2.4.0)
PLATFORMS PLATFORMS
ruby ruby
+1
View File
@@ -1,5 +1,6 @@
#!/usr/bin/env rake #!/usr/bin/env rake
require File.expand_path('../config/application', __FILE__) require File.expand_path('../config/application', __FILE__)
require 'msfenv'
require 'metasploit/framework/require' require 'metasploit/framework/require'
require 'metasploit/framework/spec/untested_payloads' require 'metasploit/framework/spec/untested_payloads'
+1 -1
View File
@@ -29,7 +29,6 @@ require 'action_view/railtie'
require 'metasploit/framework/common_engine' require 'metasploit/framework/common_engine'
require 'metasploit/framework/database' require 'metasploit/framework/database'
module Metasploit module Metasploit
module Framework module Framework
class Application < Rails::Application class Application < Rails::Application
@@ -52,3 +51,4 @@ end
# Silence warnings about this defaulting to true # Silence warnings about this defaulting to true
I18n.enforce_available_locales = true I18n.enforce_available_locales = true
require 'msfenv'
-1
View File
@@ -1,5 +1,4 @@
# Load the rails application # Load the rails application
require File.expand_path('../application', __FILE__) require File.expand_path('../application', __FILE__)
# Initialize the rails application # Initialize the rails application
Metasploit::Framework::Application.initialize! Metasploit::Framework::Application.initialize!
+1 -2
View File
@@ -17,12 +17,11 @@ require 'packetfu'
require 'rkelly' require 'rkelly'
require 'robots' require 'robots'
require 'zip' require 'zip'
require 'msf'
# #
# Project # Project
# #
require 'msf/core'
# Top-level namespace that is shared between {Metasploit::Framework # Top-level namespace that is shared between {Metasploit::Framework
# metasploit-framework} and pro, which uses Metasploit::Pro. # metasploit-framework} and pro, which uses Metasploit::Pro.
-3
View File
@@ -1,7 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
require 'msf/core/exploit/tcp'
module Metasploit module Metasploit
module Framework module Framework
module AFP module AFP
+4 -2
View File
@@ -10,6 +10,8 @@ require 'fileutils'
require 'metasploit/model/engine' require 'metasploit/model/engine'
require 'metasploit/concern/engine' require 'metasploit/concern/engine'
require 'metasploit/framework/require'
require 'msf/base/config'
Metasploit::Framework::Require.optionally_require_metasploit_db_gem_engines Metasploit::Framework::Require.optionally_require_metasploit_db_gem_engines
# `Rails::Engine` behavior common to both {Metasploit::Framework::Application} and {Metasploit::Framework::Engine}. # `Rails::Engine` behavior common to both {Metasploit::Framework::Application} and {Metasploit::Framework::Engine}.
@@ -27,8 +29,8 @@ module Metasploit::Framework::CommonEngine
# @see http://rubydoc.info/stdlib/core/IO:read # @see http://rubydoc.info/stdlib/core/IO:read
config.before_initialize do config.before_initialize do
encoding = 'binary' encoding = 'binary'
Encoding.default_external = encoding ::Encoding.default_external = encoding
Encoding.default_internal = encoding ::Encoding.default_internal = encoding
end end
config.root = Msf::Config::install_root config.root = Msf::Config::install_root
@@ -1,4 +1,3 @@
require 'msf/core/modules'
# Monitor constants created by module loading to ensure that the loads in one example don't interfere with the # Monitor constants created by module loading to ensure that the loads in one example don't interfere with the
# assertions in another example. # assertions in another example.
@@ -6,6 +6,7 @@
# # framework.threads created here # # framework.threads created here
# Rex::ThreadFactory.spawn("name", false) { ... } # Rex::ThreadFactory.spawn("name", false) { ... }
# #
require 'metasploit_data_models'
class Metasploit::Framework::ThreadFactoryProvider < Metasploit::Model::Base class Metasploit::Framework::ThreadFactoryProvider < Metasploit::Model::Base
# #
# Attributes # Attributes
@@ -1,7 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
require 'msf/core/exploit/tcp'
module Metasploit module Metasploit
module Framework module Framework
module Varnish module Varnish
+5
View File
@@ -0,0 +1,5 @@
module Msf
end
require 'msf/core/exception' # TODO: temporary require until we can split up the exceptions file and namespace properly
require 'msf_autoload'
-1
View File
@@ -14,7 +14,6 @@
# such as exploitation, into easier to manage functions. # such as exploitation, into easier to manage functions.
# framework-base depends on framework-core # framework-base depends on framework-core
require 'msf/core'
# Configuration # Configuration
require 'msf/base/config' require 'msf/base/config'
+1 -1
View File
@@ -1,7 +1,7 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'rex' require 'rex'
require 'msf/base' require 'msf/base'
require 'msf/core'
module Msf module Msf
# This module provides an initialization interface for logging. # This module provides an initialization interface for logging.
-1
View File
@@ -1,6 +1,5 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core/opt_condition'
module Msf module Msf
module Serializer module Serializer
-1
View File
@@ -1,7 +1,6 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/base' require 'msf/base'
require 'securerandom' require 'securerandom'
require 'msf/core/payload/windows/payload_db_conf'
module Msf module Msf
module Sessions module Sessions
-2
View File
@@ -1,7 +1,5 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core/payload/transport_config'
require 'msf/core/payload/uuid/options'
require 'base64' require 'base64'
require 'securerandom' require 'securerandom'
+1 -1
View File
@@ -2,7 +2,7 @@
require 'msf/base/simple' require 'msf/base/simple'
require 'msf/base/simple/framework/module_paths' require 'msf/base/simple/framework/module_paths'
require 'msf/base/simple/noop_job_listener' require 'msf/base/simple/noop_job_listener'
require 'msf/core/constants'
module Msf module Msf
module Simple module Simple
@@ -1,4 +1,5 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'rails'
module Msf module Msf
module Simple module Simple
module Framework module Framework
-41
View File
@@ -30,46 +30,5 @@ module Msf
LogSource = "core" LogSource = "core"
end end
# General
require 'msf/core/constants'
require 'msf/core/exceptions'
require 'msf/core/data_store'
require 'msf/core/option_container'
# Event subscriber interfaces # Event subscriber interfaces
require 'msf/events' require 'msf/events'
# Framework context and core classes
require 'msf/core/framework'
require 'msf/core/feature_manager'
require 'msf/core/db_manager'
require 'msf/core/event_dispatcher'
require 'msf/core/module_manager'
require 'msf/core/module_set'
require 'msf/core/plugin_manager'
require 'msf/core/session'
require 'msf/core/session_manager'
require 'msf/core/analyze'
# Wrappers
require 'msf/core/encoded_payload'
# Pseudo-modules
require 'msf/core/handler'
# Modules
require 'msf/core/module'
require 'msf/core/encoder'
require 'msf/core/auxiliary'
require 'msf/core/exploit'
require 'msf/core/nop'
require 'msf/core/payload'
require 'msf/core/post'
require 'msf/core/evasion'
# Drivers
require 'msf/core/exploit_driver'
require 'msf/core/evasion_driver'
-1
View File
@@ -1,5 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
### ###
# #
-2
View File
@@ -1,5 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core/module'
module Msf module Msf
@@ -19,7 +18,6 @@ class Auxiliary < Msf::Module
class Failed < RuntimeError class Failed < RuntimeError
end end
require 'msf/core/auxiliary/mixins'
include HasActions include HasActions
-1
View File
@@ -1,6 +1,5 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core/exploit'
module Msf module Msf
module Auxiliary::Etcd module Auxiliary::Etcd
-1
View File
@@ -1,5 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core/auxiliary/mdns'
module Msf module Msf
# This module provides methods for working with LLMNR # This module provides methods for working with LLMNR
-51
View File
@@ -1,51 +0,0 @@
# -*- coding: binary -*-
#
# Auxiliary mixins
#
require 'msf/core/auxiliary/auth_brute'
require 'msf/core/auxiliary/crand'
require 'msf/core/auxiliary/dos'
require 'msf/core/auxiliary/drdos'
require 'msf/core/auxiliary/fuzzer'
require 'msf/core/auxiliary/report'
require 'msf/core/auxiliary/scanner'
require 'msf/core/auxiliary/udp_scanner'
require 'msf/core/auxiliary/timed'
require 'msf/core/auxiliary/wmapmodule'
require 'msf/core/auxiliary/web'
require 'msf/core/auxiliary/crawler'
require 'msf/core/auxiliary/commandshell'
require 'msf/core/auxiliary/login'
require 'msf/core/auxiliary/rservices'
require 'msf/core/auxiliary/kademlia'
require 'msf/core/auxiliary/llmnr'
require 'msf/core/auxiliary/mdns'
require 'msf/core/auxiliary/mqtt'
require 'msf/core/auxiliary/nmap'
require 'msf/core/auxiliary/natpmp'
require 'msf/core/auxiliary/iax2'
require 'msf/core/auxiliary/ntp'
require 'msf/core/auxiliary/pii'
require 'msf/core/auxiliary/redis'
require 'msf/core/auxiliary/sms'
require 'msf/core/auxiliary/mms'
#
# Networking
#
require 'msf/core/auxiliary/arista'
require 'msf/core/auxiliary/brocade'
require 'msf/core/auxiliary/cisco'
require 'msf/core/auxiliary/juniper'
require 'msf/core/auxiliary/mikrotik'
require 'msf/core/auxiliary/ubiquiti'
#
# Custom HTTP modules
#
require 'msf/core/auxiliary/cnpilot'
require 'msf/core/auxiliary/epmp'
require 'msf/core/auxiliary/etcd'
-1
View File
@@ -1,6 +1,5 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core/exploit'
require 'rex/proto/mqtt' require 'rex/proto/mqtt'
module Msf module Msf
-1
View File
@@ -1,6 +1,5 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'rex/proto/ntp' require 'rex/proto/ntp'
require 'msf/core/exploit'
module Msf module Msf
### ###
-1
View File
@@ -1,5 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core/exploit'
module Msf module Msf
### ###
# #
-6
View File
@@ -11,12 +11,6 @@ module Msf
module Analysis module Analysis
end end
require 'msf/core/auxiliary/web/http'
require 'msf/core/auxiliary/web/fuzzable'
require 'msf/core/auxiliary/web/form'
require 'msf/core/auxiliary/web/path'
require 'msf/core/auxiliary/web/target'
include Auxiliary::Report include Auxiliary::Report
attr_reader :target attr_reader :target
+15
View File
@@ -0,0 +1,15 @@
module Msf
###
#
# This module provides methods for WMAP Crawler modules
#
###
module Auxiliary::WmapCrawler
include Auxiliary::WmapModule
def wmap_type
:wmap_crawler
end
end
end
@@ -124,123 +124,4 @@ module Auxiliary::WmapModule
end end
###
#
# This module provides methods for WMAP SSL Scanner modules
#
###
module Auxiliary::WmapScanSSL
include Auxiliary::WmapModule
def wmap_type
:wmap_ssl
end
end
###
#
# This module provides methods for WMAP File Scanner modules
#
###
module Auxiliary::WmapScanFile
include Auxiliary::WmapModule
def wmap_type
:wmap_file
end
end
###
#
# This module provides methods for WMAP Directory Scanner modules
#
###
module Auxiliary::WmapScanDir
include Auxiliary::WmapModule
def wmap_type
:wmap_dir
end
end
###
#
# This module provides methods for WMAP Web Server Scanner modules
#
###
module Auxiliary::WmapScanServer
include Auxiliary::WmapModule
def wmap_type
:wmap_server
end
end
###
#
# This module provides methods for WMAP Query Scanner modules
#
###
module Auxiliary::WmapScanQuery
include Auxiliary::WmapModule
def wmap_type
:wmap_query
end
end
###
#
# This module provides methods for WMAP Unique Query Scanner modules
#
###
module Auxiliary::WmapScanUniqueQuery
include Auxiliary::WmapModule
def wmap_type
:wmap_unique_query
end
def signature(fpath,fquery)
hsig = Hash.new()
hsig = queryparse(fquery)
#
# Signature of the form ',p1,p2,pn' then to be appended to path: path,p1,p2,pn
#
sigstr = fpath + "," + hsig.map{|p| p[0].to_s}.join(",")
end
end
module Auxiliary::WmapScanGeneric
include Auxiliary::WmapModule
def wmap_type
:wmap_generic
end
end
###
#
# This module provides methods for WMAP Crawler modules
#
###
module Auxiliary::WmapCrawler
include Auxiliary::WmapModule
def wmap_type
:wmap_crawler
end
end
end end
+16
View File
@@ -0,0 +1,16 @@
module Msf
###
#
# This module provides methods for WMAP Directory Scanner modules
#
###
module Auxiliary::WmapScanDir
include Auxiliary::WmapModule
def wmap_type
:wmap_dir
end
end
end
+15
View File
@@ -0,0 +1,15 @@
module Msf
###
#
# This module provides methods for WMAP File Scanner modules
#
###
module Auxiliary::WmapScanFile
include Auxiliary::WmapModule
def wmap_type
:wmap_file
end
end
end
@@ -0,0 +1,9 @@
module Msf
module Auxiliary::WmapScanGeneric
include Auxiliary::WmapModule
def wmap_type
:wmap_generic
end
end
end
+17
View File
@@ -0,0 +1,17 @@
module Msf
###
#
# This module provides methods for WMAP Query Scanner modules
#
###
module Auxiliary::WmapScanQuery
include Auxiliary::WmapModule
def wmap_type
:wmap_query
end
end
end
@@ -0,0 +1,16 @@
module Msf
###
#
# This module provides methods for WMAP Web Server Scanner modules
#
###
module Auxiliary::WmapScanServer
include Auxiliary::WmapModule
def wmap_type
:wmap_server
end
end
end
+15
View File
@@ -0,0 +1,15 @@
module Msf
###
#
# This module provides methods for WMAP SSL Scanner modules
#
###
module Auxiliary::WmapScanSSL
include Auxiliary::WmapModule
def wmap_type
:wmap_ssl
end
end
end
@@ -0,0 +1,29 @@
module Msf
###
#
# This module provides methods for WMAP Unique Query Scanner modules
#
###
module Auxiliary::WmapScanUniqueQuery
include Auxiliary::WmapModule
def wmap_type
:wmap_unique_query
end
def signature(fpath,fquery)
hsig = Hash.new()
hsig = queryparse(fquery)
#
# Signature of the form ',p1,p2,pn' then to be appended to path: path,p1,p2,pn
#
sigstr = fpath + "," + hsig.map{|p| p[0].to_s}.join(",")
end
end
end
+1 -1
View File
@@ -37,7 +37,7 @@ class DataStore < Hash
unless opt.nil? unless opt.nil?
if opt.validate_on_assignment? if opt.validate_on_assignment?
unless opt.valid?(v, check_empty: false) unless opt.valid?(v, check_empty: false)
raise OptionValidateError.new(["Value '#{v}' is not valid for option '#{k}'"]) raise Msf::OptionValidateError.new(["Value '#{v}' is not valid for option '#{k}'"])
end end
v = opt.normalize(v) v = opt.normalize(v)
end end
+2 -4
View File
@@ -6,8 +6,7 @@ module Msf
# This class provides export capabilities # This class provides export capabilities
# #
## ##
class DBManager class DBExport
class Export
attr_accessor :workspace attr_accessor :workspace
@@ -193,7 +192,7 @@ class Export
if value if value
unless skip_encoding unless skip_encoding
data = marshalize(value) data = marshalize(value)
data.force_encoding(Encoding::BINARY) if data.respond_to?('force_encoding') data.force_encoding(::Encoding::BINARY) if data.respond_to?('force_encoding')
data.gsub!(/([\x00-\x08\x0b\x0c\x0e-\x1f\x80-\xFF])/n){ |x| "\\x%.2x" % x.unpack("C*")[0] } data.gsub!(/([\x00-\x08\x0b\x0c\x0e-\x1f\x80-\xFF])/n){ |x| "\\x%.2x" % x.unpack("C*")[0] }
el << REXML::Text.new(data) el << REXML::Text.new(data)
else else
@@ -547,4 +546,3 @@ class Export
end end
end end
end
+2 -7
View File
@@ -11,11 +11,6 @@ require 'rex/socket'
# #
require 'metasploit/framework/require' require 'metasploit/framework/require'
require 'msf/base/config' require 'msf/base/config'
require 'msf/core'
require 'msf/core/database_event'
require 'msf/core/db_import_error'
require 'msf/core/host_state'
require 'msf/core/service_state'
require 'metasploit/framework/data_service' require 'metasploit/framework/data_service'
@@ -32,7 +27,7 @@ class Msf::DBManager
autoload :Client, 'msf/core/db_manager/client' autoload :Client, 'msf/core/db_manager/client'
autoload :Connection, 'msf/core/db_manager/connection' autoload :Connection, 'msf/core/db_manager/connection'
autoload :Cred, 'msf/core/db_manager/cred' autoload :Cred, 'msf/core/db_manager/cred'
autoload :DbExport, 'msf/core/db_manager/db_export' autoload :DBExport, 'msf/core/db_manager/db_export'
autoload :Event, 'msf/core/db_manager/event' autoload :Event, 'msf/core/db_manager/event'
autoload :ExploitAttempt, 'msf/core/db_manager/exploit_attempt' autoload :ExploitAttempt, 'msf/core/db_manager/exploit_attempt'
autoload :ExploitedHost, 'msf/core/db_manager/exploited_host' autoload :ExploitedHost, 'msf/core/db_manager/exploited_host'
@@ -72,7 +67,7 @@ class Msf::DBManager
include Msf::DBManager::Client include Msf::DBManager::Client
include Msf::DBManager::Connection include Msf::DBManager::Connection
include Msf::DBManager::Cred include Msf::DBManager::Cred
include Msf::DBManager::DbExport include Msf::DBManager::DBExport
include Msf::DBManager::Event include Msf::DBManager::Event
include Msf::DBManager::ExploitAttempt include Msf::DBManager::ExploitAttempt
include Msf::DBManager::ExploitedHost include Msf::DBManager::ExploitedHost
+4 -5
View File
@@ -1,16 +1,15 @@
require 'msf/core/db_export'
module Msf::DBManager::DbExport module Msf::DBManager::DBExport
def run_db_export(opts) def run_db_export(opts)
wspace = Msf::Util::DBManager.process_opts_workspace(opts, framework) wspace = Msf::Util::DBManager.process_opts_workspace(opts, framework)
exporter = Msf::DBManager::Export.new(wspace) exporter = Msf::DBExport.new(wspace)
output_file = exporter.send("to_#{opts[:format]}_file".intern, opts[:path]) do |mtype, mstatus, mname| output_file = exporter.send("to_#{opts[:format]}_file".intern, opts[:path]) do |mtype, mstatus, mname|
if mtype == :status if mtype == :status
if mstatus == Msf::DBManager::Export::STATUS_START if mstatus == Msf::DBExport::STATUS_START
ilog " >> Starting export of #{mname}" ilog " >> Starting export of #{mname}"
end end
if mstatus == Msf::DBManager::Export::STATUS_COMPLETE if mstatus == Msf::DBExport::STATUS_COMPLETE
ilog " >> Finished export of #{mname}" ilog " >> Finished export of #{mname}"
end end
end end
+1 -1
View File
@@ -311,7 +311,7 @@ module Msf::DBManager::Import
end end
# This is a text string, lets make sure its treated as binary # This is a text string, lets make sure its treated as binary
data.force_encoding(Encoding::ASCII_8BIT) data.force_encoding(::Encoding::ASCII_8BIT)
if data and data.to_s.strip.length == 0 if data and data.to_s.strip.length == 0
raise Msf::DBImportError.new("The data provided to the import function was empty") raise Msf::DBImportError.new("The data provided to the import function was empty")
end end
+1 -2
View File
@@ -1,6 +1,5 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
module Msf module Msf
@@ -537,7 +536,7 @@ protected
return false if self.raw.empty? return false if self.raw.empty?
chars.each_byte do |bad| chars.each_byte do |bad|
return true if self.raw.index(bad.chr(Encoding::ASCII_8BIT)) return true if self.raw.index(bad.chr(::Encoding::ASCII_8BIT))
end end
false false
-8
View File
@@ -1,5 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
module Msf module Msf
@@ -679,10 +678,3 @@ end
end end
require 'msf/core/encoder/xor'
require 'msf/core/encoder/xor_additive_feedback'
require 'msf/core/encoder/alphanum'
require 'msf/core/encoder/nonalpha'
require 'msf/core/encoder/nonupper'
require 'msf/core/encoder/xor_dynamic'
-1
View File
@@ -1,6 +1,5 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
module Msf module Msf
### ###
-1
View File
@@ -1,5 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
module Msf module Msf
-1
View File
@@ -1,5 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
module Msf module Msf
-1
View File
@@ -1,5 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
### ###
# #
@@ -1,5 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
### ###
# #
-1
View File
@@ -1,5 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
class Msf::Encoder::XorDynamic < Msf::Encoder class Msf::Encoder::XorDynamic < Msf::Encoder
-1
View File
@@ -1,4 +1,3 @@
require 'msf/core/module'
module Msf module Msf
class Evasion < Msf::Module class Evasion < Msf::Module
-1
View File
@@ -1,5 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
module Msf module Msf
-38
View File
@@ -1,46 +1,8 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
module Msf module Msf
###
#
# This event subscriber class exposes methods that are called when internal
# framework events occur, such as the loading and creation of a module.
#
###
module GeneralEventSubscriber
#
# Called when a module is loaded
#
def on_module_load(refname, klass)
end
#
# Called when a new module instance is created
#
def on_module_created(instance)
end
#
# Called when a module is run
#
def on_module_run(instance)
end
#
# Called when a module finishes
#
def on_module_complete(instance)
end
#
# Called when a module raises an exception
#
def on_module_error(instance, exception)
end
end
### ###
# #
@@ -1,6 +1,5 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core' require 'rex/exceptions'
module Msf module Msf
### ###
-1
View File
@@ -3,7 +3,6 @@ module Msf
module Exe module Exe
require 'metasm' require 'metasm'
require 'msf/core/exe/segment_injector'
class SegmentAppender < SegmentInjector class SegmentAppender < SegmentInjector
+1 -88
View File
@@ -1,24 +1,7 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
require 'msf/core/module'
module Msf module Msf
###
#
# This module exposes an interface that is used when wanting to receive
# notifications about events pertaining to exploitation.
#
###
module ExploitEvent
#
# This method is called when an exploit succeeds.
#
def on_exploit_success(exploit, session)
end
end
### ###
# #
@@ -29,10 +12,7 @@ end
### ###
class Exploit < Msf::Module class Exploit < Msf::Module
require 'msf/core/post' ##
require 'msf/core/exploit/local'
##
# Exceptions # Exceptions
## ##
@@ -216,77 +196,10 @@ class Exploit < Msf::Module
Passive = "passive" Passive = "passive"
end end
###
#
# The remote exploit class is a specialization of the exploit module class
# that is geared toward exploits that are performed against targets other than
# the local machine. This typically implies exploiting other machines via a
# network connection, though it is not limited to this scope.
#
###
class Remote < Exploit
require 'msf/core/exploit/auto_target'
include Msf::Exploit::AutoTarget
#
# Initializes the socket array.
#
def initialize(info)
super
self.sockets = Array.new
end
#
# Returns the fact that this exploit is a remote exploit.
#
def exploit_type
Exploit::Type::Remote
end
#
# Adds a socket to the list of sockets opened by this exploit.
#
def add_socket(sock)
self.sockets << sock
end
#
# Removes a socket from the list of sockets.
#
def remove_socket(sock)
self.sockets.delete(sock)
end
#
# This method is called once a new session has been created on behalf of
# this exploit instance and all socket connections created by this
# exploit should be closed.
#
def abort_sockets
sockets.delete_if { |sock|
begin
sock.close
rescue ::Exception
end
true
}
end
protected
#
# The list of sockets established by this exploit.
#
attr_accessor :sockets
end
# #
# Load all of the exploit mixins # Load all of the exploit mixins
# #
require 'msf/core/exploit/mixins'
# #
# Returns an array of all of the exploit mixins. Lame algorithm right now. # Returns an array of all of the exploit mixins. Lame algorithm right now.
-1
View File
@@ -1,5 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
module Msf module Msf
module Exploit::Android module Exploit::Android
+1 -1
View File
@@ -93,7 +93,7 @@ module Exploit::Brute
step = payload.nop_sled_size step = payload.nop_sled_size
if step == 0 if step == 0
raise OptionValidateError.new(['BruteStep - The step size for this exploit is invalid']) raise Msf::OptionValidateError.new(['BruteStep - The step size for this exploit is invalid'])
end end
end end
@@ -1,7 +1,6 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'rex/exploitation/cmdstager' require 'rex/exploitation/cmdstager'
require 'msf/core/exploit/cmdstager/http'
module Msf module Msf
@@ -1,8 +1,5 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core/exploit/tcp_server'
require 'msf/core/exploit/http/server'
module Msf::Exploit::CmdStager module Msf::Exploit::CmdStager
module HTTP module HTTP
+4
View File
@@ -0,0 +1,4 @@
module Msf::Exploit::HTTP
end
-5
View File
@@ -13,11 +13,6 @@
# #
### ###
require 'msf/core'
require 'msf/core/exploit/java/rmi/util'
require 'msf/core/exploit/java/rmi/client'
require 'msf/core/exploit/java/http/classloader'
module Msf module Msf
module Exploit::Java module Exploit::Java
-1
View File
@@ -10,7 +10,6 @@
# #
### ###
class Msf::Exploit::Local < Msf::Exploit class Msf::Exploit::Local < Msf::Exploit
require 'msf/core/post_mixin'
include Msf::PostMixin include Msf::PostMixin
# #
-1
View File
@@ -1,5 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core/exploit/local/compile_c'
module Msf module Msf
module Exploit::Local::Linux module Exploit::Local::Linux
@@ -1,5 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core/exploit/local/compile_c'
module Msf module Msf
module Exploit::Local::LinuxKernel module Exploit::Local::LinuxKernel
-136
View File
@@ -1,136 +0,0 @@
# -*- coding: binary -*-
#
# All exploit mixins should be added to the list below
#
# Behavior
require 'msf/core/exploit/auto_check'
require 'msf/core/exploit/check_module'
require 'msf/core/exploit/brute'
require 'msf/core/exploit/brutetargets'
require 'msf/core/exploit/browser_autopwn'
# Payload
require 'msf/core/exploit/egghunter'
require 'msf/core/exploit/omelet'
require 'msf/core/exploit/seh'
require 'msf/core/exploit/kernel_mode'
require 'msf/core/exploit/exe'
require 'msf/core/exploit/ropdb'
require 'msf/core/exploit/php_exe'
require 'msf/core/exploit/viewstate'
# CmdStagers
require 'msf/core/exploit/cmdstager'
# Protocol
require 'msf/core/exploit/tcp'
require 'msf/core/exploit/udp'
require 'msf/core/exploit/ip'
require 'msf/core/exploit/ipv6'
require 'msf/core/exploit/dhcp'
require 'msf/core/exploit/ntlm'
require 'msf/core/exploit/dcerpc'
require 'msf/core/exploit/smb/client'
require 'msf/core/exploit/smb/client/authenticated'
require 'msf/core/exploit/smb/client/local_paths'
require 'msf/core/exploit/smb/client/pipe_auditor'
require 'msf/core/exploit/smb/client/psexec'
require 'msf/core/exploit/smb/client/psexec_ms17_010'
require 'msf/core/exploit/smb/client/remote_paths'
require 'msf/core/exploit/smb/client/webexec'
require 'msf/core/exploit/smb/server'
require 'msf/core/exploit/smb/server/share'
require 'msf/core/exploit/ftp'
require 'msf/core/exploit/tftp'
require 'msf/core/exploit/telnet'
require 'msf/core/exploit/ftpserver'
require 'msf/core/exploit/http/client'
require 'msf/core/exploit/http/server'
require 'msf/core/exploit/smtp'
require 'msf/core/exploit/ssh'
require 'msf/core/exploit/sunrpc'
require 'msf/core/exploit/mssql'
require 'msf/core/exploit/mssql_commands'
require 'msf/core/exploit/mssql_sqli'
require 'msf/core/exploit/mysql'
require 'msf/core/exploit/snmp'
require 'msf/core/exploit/arkeia'
require 'msf/core/exploit/ndmp'
require 'msf/core/exploit/imap'
require 'msf/core/exploit/gdb'
require 'msf/core/exploit/smtp_deliver'
require 'msf/core/exploit/pop2'
require 'msf/core/exploit/tns'
require 'msf/core/exploit/db2'
require 'msf/core/exploit/postgres'
require 'msf/core/exploit/vim_soap'
require 'msf/core/exploit/wdbrpc'
require 'msf/core/exploit/wdbrpc_client'
require 'msf/core/exploit/afp'
require 'msf/core/exploit/realport'
require 'msf/core/exploit/sip'
require 'msf/core/exploit/tincd'
require 'msf/core/exploit/git'
require 'msf/core/exploit/rdp'
require 'msf/core/exploit/ldap'
require 'msf/core/exploit/zeromq'
# Telephony
require 'msf/core/exploit/dialup'
require 'msf/core/exploit/dect_coa'
# Networks
require 'msf/core/exploit/capture'
# FileFormat
require 'msf/core/exploit/fileformat'
require 'msf/core/exploit/pdf_parse'
require 'msf/core/exploit/pdf'
require 'msf/core/exploit/riff'
# Oracle
require 'msf/core/exploit/oracle'
# tekniqz
require 'msf/core/exploit/fmtstr'
require 'msf/core/exploit/file_dropper'
# Java
require 'msf/core/exploit/java'
# WBEM
require 'msf/core/exploit/wbemexec'
# WinRM
require 'msf/core/exploit/winrm'
# WebApp
require 'msf/core/exploit/web'
# Firefox
require 'msf/core/exploit/remote/firefox_privilege_escalation'
require 'msf/core/exploit/remote/firefox_addon_generator'
# Android
require 'msf/core/exploit/android'
# Browser Exploit Server
require 'msf/core/exploit/remote/browser_exploit_server'
require 'msf/core/exploit/browser_autopwn2'
# Custom HTTP Modules
require 'msf/core/exploit/http/wordpress'
require 'msf/core/exploit/http/joomla'
require 'msf/core/exploit/http/drupal'
require 'msf/core/exploit/http/typo3'
require 'msf/core/exploit/http/jboss'
# Kerberos Support
require 'msf/core/exploit/kerberos/client'
# Other
require 'msf/core/exploit/windows_constants'
require 'msf/core/exploit/nuuo'
require 'msf/core/exploit/expect'
require 'msf/core/exploit/sqli'
-1
View File
@@ -11,7 +11,6 @@
# #
### ###
require 'msf/core'
module Msf module Msf
module Exploit::ORACLE module Exploit::ORACLE
-2
View File
@@ -10,8 +10,6 @@ module Msf
module Exploit::PhpEXE module Exploit::PhpEXE
include Exploit::EXE include Exploit::EXE
require 'msf/core/payload'
require 'msf/core/payload/php'
include Payload::Php include Payload::Php
# #
+67
View File
@@ -0,0 +1,67 @@
module Msf
###
#
# The remote exploit class is a specialization of the exploit module class
# that is geared toward exploits that are performed against targets other than
# the local machine. This typically implies exploiting other machines via a
# network connection, though it is not limited to this scope.
#
###
class Exploit::Remote < Exploit
include Msf::Exploit::AutoTarget
#
# Initializes the socket array.
#
def initialize(info)
super
self.sockets = Array.new
end
#
# Returns the fact that this exploit is a remote exploit.
#
def exploit_type
Exploit::Type::Remote
end
#
# Adds a socket to the list of sockets opened by this exploit.
#
def add_socket(sock)
self.sockets << sock
end
#
# Removes a socket from the list of sockets.
#
def remove_socket(sock)
self.sockets.delete(sock)
end
#
# This method is called once a new session has been created on behalf of
# this exploit instance and all socket connections created by this
# exploit should be closed.
#
def abort_sockets
sockets.delete_if { |sock|
begin
sock.close
rescue ::Exception
end
true
}
end
protected
#
# The list of sockets established by this exploit.
#
attr_accessor :sockets
end
end
@@ -1,7 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
require 'msf/core/exploit/tcp'
module Msf module Msf
module Exploit::Remote::AFP module Exploit::Remote::AFP
@@ -1,5 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
module Msf module Msf
@@ -5,7 +5,6 @@
# Framework web site for more information on licensing and terms of use. # Framework web site for more information on licensing and terms of use.
# https://metasploit.com/framework/ # https://metasploit.com/framework/
require 'msf/core/auxiliary'
module Msf module Msf
module Exploit::Remote::BrowserAutopwn module Exploit::Remote::BrowserAutopwn
@@ -5,10 +5,6 @@ require 'cgi'
require 'date' require 'date'
require 'set' require 'set'
require 'rex/exploitation/js' require 'rex/exploitation/js'
require 'msf/core/exploit/jsobfu'
require 'msf/core/exploit/remote/browser_profile_manager'
require 'msf/core/module'
### ###
# #
# The BrowserExploitServer mixin provides methods to do common tasks seen in modern browser # The BrowserExploitServer mixin provides methods to do common tasks seen in modern browser
@@ -1,5 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
module Msf module Msf
@@ -1,10 +1,6 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'rex/proto/dcerpc' require 'rex/proto/dcerpc'
require 'rex/encoder/ndr' require 'rex/encoder/ndr'
require 'msf/core/exploit/dcerpc_epm'
require 'msf/core/exploit/dcerpc_mgmt'
require 'msf/core/exploit/dcerpc_lsa'
module Msf module Msf
### ###
@@ -1,5 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
require 'rex/proto/dns' require 'rex/proto/dns'
@@ -15,7 +14,3 @@ module Exploit::Remote::DNS
end end
end end
require 'msf/core/exploit/dns/common'
require 'msf/core/exploit/dns/client'
require 'msf/core/exploit/dns/enumeration'
require 'msf/core/exploit/dns/server'
@@ -1,5 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
require 'rex/proto/dns' require 'rex/proto/dns'
@@ -1,5 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
require 'rex/proto/dns' require 'rex/proto/dns'
@@ -1,5 +1,4 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
module Msf module Msf
@@ -1,7 +1,5 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core'
require 'rex/proto/dns' require 'rex/proto/dns'
require 'msf/core/exploit/dns/common'
module Msf module Msf
@@ -7,7 +7,6 @@
# #
### ###
require 'msf/core/exploit/jsobfu'
module Msf module Msf
module Exploit::Remote::FirefoxPrivilegeEscalation module Exploit::Remote::FirefoxPrivilegeEscalation
@@ -1,7 +1,6 @@
# -*- coding: binary -*- # -*- coding: binary -*-
module Msf module Msf
require 'msf/core/exploit/tcp'
### ###
# #
@@ -1,7 +1,6 @@
# -*- coding: binary -*- # -*- coding: binary -*-
module Msf module Msf
require 'msf/core/exploit/tcp'
### ###
# #
@@ -1,6 +1,5 @@
# -*- coding: binary -*- # -*- coding: binary -*-
require 'msf/core/exploit/tcp'
module Msf module Msf
@@ -6,12 +6,6 @@ module Msf
module HTTP module HTTP
# This module provides a way of interacting with JBoss installations # This module provides a way of interacting with JBoss installations
module JBoss module JBoss
require 'msf/core/exploit/http/jboss/base'
require 'msf/core/exploit/http/jboss/bean_shell'
require 'msf/core/exploit/http/jboss/bean_shell_scripts'
require 'msf/core/exploit/http/jboss/deployment_file_repository'
require 'msf/core/exploit/http/jboss/deployment_file_repository_scripts'
include Msf::Exploit::Remote::HttpClient include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::Remote::HTTP::JBoss::Base include Msf::Exploit::Remote::HTTP::JBoss::Base
include Msf::Exploit::Remote::HTTP::JBoss::BeanShell include Msf::Exploit::Remote::HTTP::JBoss::BeanShell

Some files were not shown because too many files have changed in this diff Show More