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

View File

@ -84,6 +84,7 @@ PATH
windows_error
xdr
xmlrpc
zeitwerk
GEM
remote: https://rubygems.org/
@ -439,6 +440,7 @@ GEM
activesupport (>= 4.2, < 7.0)
xmlrpc (0.3.1)
yard (0.9.25)
zeitwerk (2.4.0)
PLATFORMS
ruby

View File

@ -1,5 +1,6 @@
#!/usr/bin/env rake
require File.expand_path('../config/application', __FILE__)
require 'msfenv'
require 'metasploit/framework/require'
require 'metasploit/framework/spec/untested_payloads'

View File

@ -29,7 +29,6 @@ require 'action_view/railtie'
require 'metasploit/framework/common_engine'
require 'metasploit/framework/database'
module Metasploit
module Framework
class Application < Rails::Application
@ -52,3 +51,4 @@ end
# Silence warnings about this defaulting to true
I18n.enforce_available_locales = true
require 'msfenv'

View File

@ -1,5 +1,4 @@
# Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Metasploit::Framework::Application.initialize!

View File

@ -17,12 +17,11 @@ require 'packetfu'
require 'rkelly'
require 'robots'
require 'zip'
require 'msf'
#
# Project
#
require 'msf/core'
# Top-level namespace that is shared between {Metasploit::Framework
# metasploit-framework} and pro, which uses Metasploit::Pro.

View File

@ -1,7 +1,4 @@
# -*- coding: binary -*-
require 'msf/core'
require 'msf/core/exploit/tcp'
module Metasploit
module Framework
module AFP

View File

@ -10,6 +10,8 @@ require 'fileutils'
require 'metasploit/model/engine'
require 'metasploit/concern/engine'
require 'metasploit/framework/require'
require 'msf/base/config'
Metasploit::Framework::Require.optionally_require_metasploit_db_gem_engines
# `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
config.before_initialize do
encoding = 'binary'
Encoding.default_external = encoding
Encoding.default_internal = encoding
::Encoding.default_external = encoding
::Encoding.default_internal = encoding
end
config.root = Msf::Config::install_root

View File

@ -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
# assertions in another example.

View File

@ -6,6 +6,7 @@
# # framework.threads created here
# Rex::ThreadFactory.spawn("name", false) { ... }
#
require 'metasploit_data_models'
class Metasploit::Framework::ThreadFactoryProvider < Metasploit::Model::Base
#
# Attributes

View File

@ -1,7 +1,4 @@
# -*- coding: binary -*-
require 'msf/core'
require 'msf/core/exploit/tcp'
module Metasploit
module Framework
module Varnish

5
lib/msf.rb Normal file
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'

View File

@ -14,7 +14,6 @@
# such as exploitation, into easier to manage functions.
# framework-base depends on framework-core
require 'msf/core'
# Configuration
require 'msf/base/config'

View File

@ -1,7 +1,7 @@
# -*- coding: binary -*-
require 'rex'
require 'msf/base'
require 'msf/core'
module Msf
# This module provides an initialization interface for logging.

View File

@ -1,6 +1,5 @@
# -*- coding: binary -*-
require 'msf/core/opt_condition'
module Msf
module Serializer

View File

@ -1,7 +1,6 @@
# -*- coding: binary -*-
require 'msf/base'
require 'securerandom'
require 'msf/core/payload/windows/payload_db_conf'
module Msf
module Sessions

View File

@ -1,7 +1,5 @@
# -*- coding: binary -*-
require 'msf/core/payload/transport_config'
require 'msf/core/payload/uuid/options'
require 'base64'
require 'securerandom'

View File

@ -2,7 +2,7 @@
require 'msf/base/simple'
require 'msf/base/simple/framework/module_paths'
require 'msf/base/simple/noop_job_listener'
require 'msf/core/constants'
module Msf
module Simple

View File

@ -1,4 +1,5 @@
# -*- coding: binary -*-
require 'rails'
module Msf
module Simple
module Framework

View File

@ -30,46 +30,5 @@ module Msf
LogSource = "core"
end
# General
require 'msf/core/constants'
require 'msf/core/exceptions'
require 'msf/core/data_store'
require 'msf/core/option_container'
# Event subscriber interfaces
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'

View File

@ -1,5 +1,4 @@
# -*- coding: binary -*-
require 'msf/core'
###
#

View File

@ -1,5 +1,4 @@
# -*- coding: binary -*-
require 'msf/core/module'
module Msf
@ -19,7 +18,6 @@ class Auxiliary < Msf::Module
class Failed < RuntimeError
end
require 'msf/core/auxiliary/mixins'
include HasActions

View File

@ -1,6 +1,5 @@
# -*- coding: binary -*-
require 'msf/core/exploit'
module Msf
module Auxiliary::Etcd

View File

@ -1,5 +1,4 @@
# -*- coding: binary -*-
require 'msf/core/auxiliary/mdns'
module Msf
# This module provides methods for working with LLMNR

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'

View File

@ -1,6 +1,5 @@
# -*- coding: binary -*-
require 'msf/core/exploit'
require 'rex/proto/mqtt'
module Msf

View File

@ -1,6 +1,5 @@
# -*- coding: binary -*-
require 'rex/proto/ntp'
require 'msf/core/exploit'
module Msf
###

View File

@ -1,5 +1,4 @@
# -*- coding: binary -*-
require 'msf/core/exploit'
module Msf
###
#

View File

@ -11,12 +11,6 @@ module Msf
module Analysis
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
attr_reader :target

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

View File

@ -124,123 +124,4 @@ module Auxiliary::WmapModule
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

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

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

View File

@ -0,0 +1,9 @@
module Msf
module Auxiliary::WmapScanGeneric
include Auxiliary::WmapModule
def wmap_type
:wmap_generic
end
end
end

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

View File

@ -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

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

View File

@ -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

View File

@ -37,7 +37,7 @@ class DataStore < Hash
unless opt.nil?
if opt.validate_on_assignment?
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
v = opt.normalize(v)
end

View File

@ -6,8 +6,7 @@ module Msf
# This class provides export capabilities
#
##
class DBManager
class Export
class DBExport
attr_accessor :workspace
@ -193,7 +192,7 @@ class Export
if value
unless skip_encoding
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] }
el << REXML::Text.new(data)
else
@ -547,4 +546,3 @@ class Export
end
end
end

View File

@ -11,11 +11,6 @@ require 'rex/socket'
#
require 'metasploit/framework/require'
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'
@ -32,7 +27,7 @@ class Msf::DBManager
autoload :Client, 'msf/core/db_manager/client'
autoload :Connection, 'msf/core/db_manager/connection'
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 :ExploitAttempt, 'msf/core/db_manager/exploit_attempt'
autoload :ExploitedHost, 'msf/core/db_manager/exploited_host'
@ -72,7 +67,7 @@ class Msf::DBManager
include Msf::DBManager::Client
include Msf::DBManager::Connection
include Msf::DBManager::Cred
include Msf::DBManager::DbExport
include Msf::DBManager::DBExport
include Msf::DBManager::Event
include Msf::DBManager::ExploitAttempt
include Msf::DBManager::ExploitedHost

View File

@ -1,16 +1,15 @@
require 'msf/core/db_export'
module Msf::DBManager::DbExport
module Msf::DBManager::DBExport
def run_db_export(opts)
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|
if mtype == :status
if mstatus == Msf::DBManager::Export::STATUS_START
if mstatus == Msf::DBExport::STATUS_START
ilog " >> Starting export of #{mname}"
end
if mstatus == Msf::DBManager::Export::STATUS_COMPLETE
if mstatus == Msf::DBExport::STATUS_COMPLETE
ilog " >> Finished export of #{mname}"
end
end

View File

@ -311,7 +311,7 @@ module Msf::DBManager::Import
end
# 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
raise Msf::DBImportError.new("The data provided to the import function was empty")
end

View File

@ -1,6 +1,5 @@
# -*- coding: binary -*-
require 'msf/core'
module Msf
@ -537,7 +536,7 @@ protected
return false if self.raw.empty?
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
false

View File

@ -1,5 +1,4 @@
# -*- coding: binary -*-
require 'msf/core'
module Msf
@ -679,10 +678,3 @@ 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'

View File

@ -1,6 +1,5 @@
# -*- coding: binary -*-
require 'msf/core'
module Msf
###

View File

@ -1,5 +1,4 @@
# -*- coding: binary -*-
require 'msf/core'
module Msf

View File

@ -1,5 +1,4 @@
# -*- coding: binary -*-
require 'msf/core'
module Msf

View File

@ -1,5 +1,4 @@
# -*- coding: binary -*-
require 'msf/core'
###
#

View File

@ -1,5 +1,4 @@
# -*- coding: binary -*-
require 'msf/core'
###
#

View File

@ -1,5 +1,4 @@
# -*- coding: binary -*-
require 'msf/core'
class Msf::Encoder::XorDynamic < Msf::Encoder

View File

@ -1,4 +1,3 @@
require 'msf/core/module'
module Msf
class Evasion < Msf::Module

View File

@ -1,5 +1,4 @@
# -*- coding: binary -*-
require 'msf/core'
module Msf

View File

@ -1,46 +1,8 @@
# -*- coding: binary -*-
require 'msf/core'
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
###
#

View File

@ -1,6 +1,5 @@
# -*- coding: binary -*-
require 'msf/core'
require 'rex/exceptions'
module Msf
###

View File

@ -3,7 +3,6 @@ module Msf
module Exe
require 'metasm'
require 'msf/core/exe/segment_injector'
class SegmentAppender < SegmentInjector

View File

@ -1,24 +1,7 @@
# -*- coding: binary -*-
require 'msf/core'
require 'msf/core/module'
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
require 'msf/core/post'
require 'msf/core/exploit/local'
##
##
# Exceptions
##
@ -216,77 +196,10 @@ class Exploit < Msf::Module
Passive = "passive"
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
#
require 'msf/core/exploit/mixins'
#
# Returns an array of all of the exploit mixins. Lame algorithm right now.

View File

@ -1,5 +1,4 @@
# -*- coding: binary -*-
require 'msf/core'
module Msf
module Exploit::Android

View File

@ -93,7 +93,7 @@ module Exploit::Brute
step = payload.nop_sled_size
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

View File

@ -1,7 +1,6 @@
# -*- coding: binary -*-
require 'rex/exploitation/cmdstager'
require 'msf/core/exploit/cmdstager/http'
module Msf

View File

@ -1,8 +1,5 @@
# -*- coding: binary -*-
require 'msf/core/exploit/tcp_server'
require 'msf/core/exploit/http/server'
module Msf::Exploit::CmdStager
module HTTP

View File

@ -0,0 +1,4 @@
module Msf::Exploit::HTTP
end

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 Exploit::Java

View File

@ -10,7 +10,6 @@
#
###
class Msf::Exploit::Local < Msf::Exploit
require 'msf/core/post_mixin'
include Msf::PostMixin
#

View File

@ -1,5 +1,4 @@
# -*- coding: binary -*-
require 'msf/core/exploit/local/compile_c'
module Msf
module Exploit::Local::Linux

View File

@ -1,5 +1,4 @@
# -*- coding: binary -*-
require 'msf/core/exploit/local/compile_c'
module Msf
module Exploit::Local::LinuxKernel

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'

View File

@ -11,7 +11,6 @@
#
###
require 'msf/core'
module Msf
module Exploit::ORACLE

View File

@ -10,8 +10,6 @@ module Msf
module Exploit::PhpEXE
include Exploit::EXE
require 'msf/core/payload'
require 'msf/core/payload/php'
include Payload::Php
#

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

View File

@ -1,7 +1,4 @@
# -*- coding: binary -*-
require 'msf/core'
require 'msf/core/exploit/tcp'
module Msf
module Exploit::Remote::AFP

View File

@ -1,5 +1,4 @@
# -*- coding: binary -*-
require 'msf/core'
module Msf

View File

@ -5,7 +5,6 @@
# Framework web site for more information on licensing and terms of use.
# https://metasploit.com/framework/
require 'msf/core/auxiliary'
module Msf
module Exploit::Remote::BrowserAutopwn

View File

@ -5,10 +5,6 @@ require 'cgi'
require 'date'
require 'set'
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

View File

@ -1,5 +1,4 @@
# -*- coding: binary -*-
require 'msf/core'
module Msf

View File

@ -1,10 +1,6 @@
# -*- coding: binary -*-
require 'rex/proto/dcerpc'
require 'rex/encoder/ndr'
require 'msf/core/exploit/dcerpc_epm'
require 'msf/core/exploit/dcerpc_mgmt'
require 'msf/core/exploit/dcerpc_lsa'
module Msf
###

View File

@ -1,5 +1,4 @@
# -*- coding: binary -*-
require 'msf/core'
require 'rex/proto/dns'
@ -15,7 +14,3 @@ module Exploit::Remote::DNS
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'

View File

@ -1,5 +1,4 @@
# -*- coding: binary -*-
require 'msf/core'
require 'rex/proto/dns'

View File

@ -1,5 +1,4 @@
# -*- coding: binary -*-
require 'msf/core'
require 'rex/proto/dns'

View File

@ -1,5 +1,4 @@
# -*- coding: binary -*-
require 'msf/core'
module Msf

View File

@ -1,7 +1,5 @@
# -*- coding: binary -*-
require 'msf/core'
require 'rex/proto/dns'
require 'msf/core/exploit/dns/common'
module Msf

View File

@ -7,7 +7,6 @@
#
###
require 'msf/core/exploit/jsobfu'
module Msf
module Exploit::Remote::FirefoxPrivilegeEscalation

View File

@ -1,7 +1,6 @@
# -*- coding: binary -*-
module Msf
require 'msf/core/exploit/tcp'
###
#

View File

@ -1,7 +1,6 @@
# -*- coding: binary -*-
module Msf
require 'msf/core/exploit/tcp'
###
#

View File

@ -1,6 +1,5 @@
# -*- coding: binary -*-
require 'msf/core/exploit/tcp'
module Msf

View File

@ -6,12 +6,6 @@ module Msf
module HTTP
# This module provides a way of interacting with JBoss installations
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::HTTP::JBoss::Base
include Msf::Exploit::Remote::HTTP::JBoss::BeanShell

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