Reverting the autoload changes until we can upgrade to a new ActiveSupport library or find a workaround
git-svn-id: file:///home/svn/framework3/trunk@12600 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
95d802754b
commit
9ce47c01bd
|
@ -22,20 +22,19 @@ require 'msf/core'
|
|||
require 'msf/base/config'
|
||||
require 'msf/base/logging'
|
||||
|
||||
module Msf
|
||||
# Simple wrapper
|
||||
autoload :Simple, 'msf/base/simple'
|
||||
require 'msf/base/simple'
|
||||
|
||||
# Sessions
|
||||
autoload :Sessions, 'msf/base/sessions'
|
||||
require 'msf/base/sessions/command_shell'
|
||||
require 'msf/base/sessions/tty'
|
||||
|
||||
# Serialization
|
||||
autoload :Serializer, 'msf/base/serializer/readable_text'
|
||||
require 'msf/base/serializer/readable_text'
|
||||
|
||||
# Persistent Storage
|
||||
autoload :PersistentStorage, 'msf/base/persistent_storage'
|
||||
require 'msf/base/persistent_storage'
|
||||
|
||||
# Utilities
|
||||
autoload :Util, 'msf/util'
|
||||
end
|
||||
require 'msf/util'
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
require 'rex'
|
||||
require 'rex/logging'
|
||||
require 'msf/base'
|
||||
|
||||
module Msf
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
module Msf
|
||||
module Sessions
|
||||
autoload :CommandShell, 'msf/base/sessions/command_shell'
|
||||
autoload :CommandShellWindows, 'msf/base/sessions/command_shell'
|
||||
autoload :CommandShellUnix, 'msf/base/sessions/command_shell'
|
||||
|
||||
autoload :Meterpreter, 'msf/base/sessions/meterpreter'
|
||||
autoload :Meterpreter_Java_Java, 'msf/base/sessions/meterpreter_java'
|
||||
autoload :Meterpreter_Php_Php, 'msf/base/sessions/meterpreter_php'
|
||||
autoload :Meterpreter_x64_Win, 'msf/base/sessions/meterpreter_x64_win'
|
||||
autoload :Meterpreter_x86_BSD, 'msf/base/sessions/meterpreter_x86_bsd'
|
||||
autoload :Meterpreter_x86_Linux, 'msf/base/sessions/meterpreter_x86_linux'
|
||||
autoload :Meterpreter_x86_Win, 'msf/base/sessions/meterpreter_x86_win'
|
||||
|
||||
autoload :VncInject, 'msf/base/sessions/vncinject'
|
||||
|
||||
autoload :TTY, 'msf/base/sessions/tty'
|
||||
end
|
||||
end
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
require 'msf/base'
|
||||
require 'msf/base/sessions/scriptable'
|
||||
require 'rex/post/meterpreter'
|
||||
|
||||
module Msf
|
||||
module Sessions
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
require 'msf/base'
|
||||
require 'rex/services/local_relay'
|
||||
|
||||
module Msf
|
||||
module Sessions
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
module Msf::Simple
|
||||
# Buffer management
|
||||
autoload :Buffer, 'msf/base/simple/buffer'
|
||||
autoload :Statistics, 'msf/base/simple/statistics'
|
||||
require 'msf/base/simple/buffer'
|
||||
require 'msf/base/simple/statistics'
|
||||
|
||||
# Simplified module interfaces
|
||||
autoload :Module, 'msf/base/simple/module'
|
||||
autoload :Encoder, 'msf/base/simple/encoder'
|
||||
autoload :Exploit, 'msf/base/simple/exploit'
|
||||
autoload :Nop, 'msf/base/simple/nop'
|
||||
autoload :Payload, 'msf/base/simple/payload'
|
||||
autoload :Auxiliary, 'msf/base/simple/auxiliary'
|
||||
autoload :Post, 'msf/base/simple/post'
|
||||
require 'msf/base/simple/module'
|
||||
require 'msf/base/simple/encoder'
|
||||
require 'msf/base/simple/exploit'
|
||||
require 'msf/base/simple/nop'
|
||||
require 'msf/base/simple/payload'
|
||||
require 'msf/base/simple/auxiliary'
|
||||
require 'msf/base/simple/post'
|
||||
|
||||
# Simplified framework interface
|
||||
autoload :Framework, 'msf/base/simple/framework'
|
||||
end
|
||||
require 'msf/base/simple/framework'
|
||||
|
|
|
@ -14,39 +14,10 @@ require 'msf/sanity'
|
|||
|
||||
# The framework-core depends on Rex
|
||||
require 'rex'
|
||||
require 'rex/ui'
|
||||
|
||||
# Set the log source, and initialize demand-loaded requires
|
||||
module Msf
|
||||
LogSource = "core"
|
||||
|
||||
# Event subscriber interfaces
|
||||
autoload :UiEventSubscriber, 'msf/events'
|
||||
|
||||
# Wrappers
|
||||
autoload :EncodedPayload, 'msf/core/encoded_payload'
|
||||
|
||||
# Pseudo-modules
|
||||
autoload :Handler, 'msf/core/handler'
|
||||
|
||||
# Mixins
|
||||
autoload :Encoder, 'msf/core/encoder'
|
||||
autoload :EncoderState, 'msf/core/encoder'
|
||||
autoload :Auxiliary, 'msf/core/auxiliary'
|
||||
autoload :Nop, 'msf/core/nop'
|
||||
autoload :Payload, 'msf/core/payload'
|
||||
autoload :ExploitEvent, 'msf/core/exploit'
|
||||
autoload :Exploit, 'msf/core/exploit'
|
||||
autoload :Post, 'msf/core/post'
|
||||
|
||||
# Drivers
|
||||
autoload :ExploitDriver, 'msf/core/exploit_driver'
|
||||
|
||||
# Framework context and core classes
|
||||
autoload :Framework, 'msf/core/framework'
|
||||
|
||||
# Session stuff
|
||||
autoload :Session, 'msf/core/session'
|
||||
autoload :SessionEvent, 'msf/core/session'
|
||||
end
|
||||
|
||||
# General
|
||||
|
@ -55,5 +26,35 @@ 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/db_manager'
|
||||
require 'msf/core/event_dispatcher'
|
||||
require 'msf/core/module_manager'
|
||||
require 'msf/core/plugin_manager'
|
||||
require 'msf/core/session'
|
||||
require 'msf/core/session_manager'
|
||||
|
||||
|
||||
# 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'
|
||||
|
||||
|
||||
# Drivers
|
||||
require 'msf/core/exploit_driver'
|
||||
|
||||
|
|
|
@ -5,35 +5,17 @@
|
|||
#
|
||||
# Auxiliary mixins
|
||||
#
|
||||
module Msf
|
||||
class Auxiliary
|
||||
# Main types of auxiliary modules
|
||||
autoload :AuthBrute, 'msf/core/auxiliary/auth_brute'
|
||||
autoload :Dos, 'msf/core/auxiliary/dos'
|
||||
autoload :Fuzzer, 'msf/core/auxiliary/fuzzer'
|
||||
autoload :Scanner, 'msf/core/auxiliary/scanner'
|
||||
autoload :Timed, 'msf/core/auxiliary/timed'
|
||||
require 'msf/core/auxiliary/auth_brute'
|
||||
require 'msf/core/auxiliary/dos'
|
||||
require 'msf/core/auxiliary/fuzzer'
|
||||
require 'msf/core/auxiliary/report'
|
||||
require 'msf/core/auxiliary/scanner'
|
||||
require 'msf/core/auxiliary/timed'
|
||||
require 'msf/core/auxiliary/wmapmodule'
|
||||
require 'msf/core/auxiliary/crawler'
|
||||
|
||||
# WMAP
|
||||
autoload :WMAPModule, 'msf/core/auxiliary/wmapmodule'
|
||||
autoload :WMAPScanSSL, 'msf/core/auxiliary/wmapmodule'
|
||||
autoload :WMAPScanFile, 'msf/core/auxiliary/wmapmodule'
|
||||
autoload :WMAPScanDir, 'msf/core/auxiliary/wmapmodule'
|
||||
autoload :WMAPScanServer, 'msf/core/auxiliary/wmapmodule'
|
||||
autoload :WMAPScanQuery, 'msf/core/auxiliary/wmapmodule'
|
||||
autoload :WMAPScanUniqueQuery, 'msf/core/auxiliary/wmapmodule'
|
||||
autoload :WMAPScanGeneric, 'msf/core/auxiliary/wmapmodule'
|
||||
autoload :WMAPCrawler, 'msf/core/auxiliary/wmapmodule'
|
||||
autoload :HttpCrawler, 'msf/core/auxiliary/crawler'
|
||||
|
||||
# Miscallaneous
|
||||
autoload :Report, 'msf/core/auxiliary/report'
|
||||
autoload :CommandShell, 'msf/core/auxiliary/commandshell'
|
||||
autoload :Nmap, 'msf/core/auxiliary/nmap'
|
||||
|
||||
# Protocol augmenters for Aux modules
|
||||
autoload :Login, 'msf/core/auxiliary/login'
|
||||
autoload :RServices, 'msf/core/auxiliary/rservices'
|
||||
autoload :Cisco, 'msf/core/auxiliary/cisco'
|
||||
end
|
||||
end
|
||||
require 'msf/core/auxiliary/commandshell'
|
||||
require 'msf/core/auxiliary/login'
|
||||
require 'msf/core/auxiliary/rservices'
|
||||
require 'msf/core/auxiliary/cisco'
|
||||
require 'msf/core/auxiliary/nmap'
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
require 'rex/parser/nmap_xml'
|
||||
require 'open3'
|
||||
|
||||
module Msf
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
|
||||
autoload :FileUtils, 'fileutils'
|
||||
autoload :Zip, 'zip'
|
||||
autoload :URI, 'uri'
|
||||
autoload :PacketFu, 'packetfu'
|
||||
|
||||
require 'rex/parser/nmap_xml'
|
||||
require 'rex/parser/nexpose_xml'
|
||||
require 'rex/parser/retina_xml'
|
||||
require 'rex/parser/netsparker_xml'
|
||||
require 'rex/parser/nessus_xml'
|
||||
require 'rex/parser/ip360_xml'
|
||||
require 'rex/parser/ip360_aspl_xml'
|
||||
require 'rex/socket'
|
||||
require 'zip'
|
||||
require 'packetfu'
|
||||
require 'uri'
|
||||
require 'tmpdir'
|
||||
require 'fileutils'
|
||||
|
||||
module Msf
|
||||
|
||||
|
@ -2064,7 +2070,7 @@ class DBManager
|
|||
end
|
||||
|
||||
# Returns one of: :nexpose_simplexml :nexpose_rawxml :nmap_xml :openvas_xml
|
||||
# :nessus_xml :nessus_xml_v2 :qualys_scan_xml, :qualys_asset_xml, :msf_xml :nessus_nbe :amap_mlog
|
||||
# :nessus_xml :nessus_xml_v2 :qualys_xml :msf_xml :nessus_nbe :amap_mlog
|
||||
# :amap_log :ip_list, :msf_zip, :libpcap
|
||||
# If there is no match, an error is raised instead.
|
||||
def import_filetype_detect(data)
|
||||
|
@ -2134,11 +2140,8 @@ class DBManager
|
|||
@import_filedata[:type] = "Nessus XML (v2)"
|
||||
return :nessus_xml_v2
|
||||
when "SCAN"
|
||||
@import_filedata[:type] = "Qualys Scan XML"
|
||||
return :qualys_scan_xml
|
||||
when "ASSET_DATA_REPORT"
|
||||
@import_filedata[:type] = "Qualys Asset XML"
|
||||
return :qualys_asset_xml
|
||||
@import_filedata[:type] = "Qualys XML"
|
||||
return :qualys_xml
|
||||
when /MetasploitExpressV[1234]/
|
||||
@import_filedata[:type] = "Metasploit XML"
|
||||
return :msf_xml
|
||||
|
@ -4378,114 +4381,10 @@ class DBManager
|
|||
REXML::Document.parse_stream(data, parser)
|
||||
end
|
||||
|
||||
def find_qualys_asset_vuln_refs(doc)
|
||||
vuln_refs = {}
|
||||
doc.elements.each("/ASSET_DATA_REPORT/GLOSSARY/VULN_DETAILS_LIST/VULN_DETAILS") do |vuln|
|
||||
next unless vuln.elements['QID'] && vuln.elements['QID'].first
|
||||
qid = vuln.elements['QID'].first.to_s
|
||||
vuln_refs[qid] ||= []
|
||||
if vuln.elements["CVE_ID_LIST/CVE_ID/ID"]
|
||||
vuln.elements["CVE_ID_LIST/CVE_ID/ID"].each do |ref|
|
||||
next unless ref
|
||||
next unless ref.to_s[/^C..-[0-9\-]{9}/]
|
||||
vuln_refs[qid] << ref.to_s.gsub(/^C../, "CVE")
|
||||
end
|
||||
end
|
||||
if vuln.elements["BUGTRAQ_ID_LIST/BUGTRAQ_ID/ID"]
|
||||
vuln.elements["BUGTRAQ_ID_LIST/BUGTRAQ_ID/ID"].each do |ref|
|
||||
next unless ref
|
||||
next unless ref.to_s[/^[0-9]{1,9}/]
|
||||
vuln_refs[qid] << "BID-#{ref}"
|
||||
end
|
||||
end
|
||||
end
|
||||
return vuln_refs
|
||||
end
|
||||
|
||||
# Pull out vulnerabilities that have at least one matching
|
||||
# ref -- many "vulns" are not vulns, just audit information.
|
||||
def find_qualys_asset_vulns(host,wspace,hobj,vuln_refs,&block)
|
||||
host.elements.each("VULN_INFO_LIST/VULN_INFO") do |vi|
|
||||
next unless vi.elements["QID"]
|
||||
vi.elements.each("QID") do |qid|
|
||||
next if vuln_refs[qid.text].nil? || vuln_refs[qid.text].empty?
|
||||
handle_qualys(wspace, hobj, nil, nil, qid.text, nil, vuln_refs[qid.text], nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Takes QID numbers and finds the discovered services in
|
||||
# a qualys_asset_xml.
|
||||
def find_qualys_asset_ports(i,host,wspace,hobj)
|
||||
return unless (i == 82023 || i == 82004)
|
||||
proto = i == 82023 ? 'tcp' : 'udp'
|
||||
qid = host.elements["VULN_INFO_LIST/VULN_INFO/QID[@id='qid_#{i}']"]
|
||||
qid_result = qid.parent.elements["RESULT[@format='table']"] if qid
|
||||
hports = qid_result.first.to_s if qid_result
|
||||
if hports
|
||||
hports.scan(/([0-9]+)\t(.*?)\t.*?\t([^\t\n]*)/) do |match|
|
||||
if match[2] == nil or match[2].strip == 'unknown'
|
||||
name = match[1].strip
|
||||
else
|
||||
name = match[2].strip
|
||||
end
|
||||
handle_qualys(wspace, hobj, match[0].to_s, proto, 0, nil, nil, name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
# Import Qualys's Asset Data Report format
|
||||
# Import Qualys' xml output
|
||||
#
|
||||
def import_qualys_asset_xml(args={}, &block)
|
||||
data = args[:data]
|
||||
wspace = args[:wspace] || workspace
|
||||
bl = validate_ips(args[:blacklist]) ? args[:blacklist].split : []
|
||||
doc = rexmlify(data)
|
||||
vuln_refs = find_qualys_asset_vuln_refs(doc)
|
||||
|
||||
# 2nd pass, actually grab the hosts.
|
||||
doc.elements.each("/ASSET_DATA_REPORT/HOST_LIST/HOST") do |host|
|
||||
hobj = nil
|
||||
addr = host.elements["IP"].text if host.elements["IP"]
|
||||
next unless validate_ips(addr)
|
||||
if bl.include? addr
|
||||
next
|
||||
else
|
||||
yield(:address,addr) if block
|
||||
end
|
||||
hname = ( # Prefer NetBIOS over DNS
|
||||
(host.elements["NETBIOS"].text if host.elements["NETBIOS"]) ||
|
||||
(host.elements["DNS"].text if host.elements["DNS"]) ||
|
||||
"" )
|
||||
hobj = report_host(:workspace => wspace, :host => addr, :name => hname, :state => Msf::HostState::Alive)
|
||||
report_import_note(wspace,hobj)
|
||||
|
||||
if host.elements["OPERATING_SYSTEM"]
|
||||
hos = host.elements["OPERATING_SYSTEM"].text
|
||||
report_note(
|
||||
:workspace => wspace,
|
||||
:host => hobj,
|
||||
:type => 'host.os.qualys_fingerprint',
|
||||
:data => { :os => hos }
|
||||
)
|
||||
end
|
||||
|
||||
# Report open ports.
|
||||
find_qualys_asset_ports(82023,host,wspace,hobj) # TCP
|
||||
find_qualys_asset_ports(82004,host,wspace,hobj) # UDP
|
||||
|
||||
# Report vulns
|
||||
find_qualys_asset_vulns(host,wspace,hobj,vuln_refs,&block)
|
||||
|
||||
end # host
|
||||
|
||||
end
|
||||
|
||||
#
|
||||
# Import Qualys' Scan xml output
|
||||
#
|
||||
def import_qualys_scan_xml_file(args={})
|
||||
def import_qualys_xml_file(args={})
|
||||
filename = args[:filename]
|
||||
wspace = args[:wspace] || workspace
|
||||
|
||||
|
@ -4493,10 +4392,10 @@ class DBManager
|
|||
::File.open(filename, 'rb') do |f|
|
||||
data = f.read(f.stat.size)
|
||||
end
|
||||
import_qualys_scan_xml(args.merge(:data => data))
|
||||
import_qualys_xml(args.merge(:data => data))
|
||||
end
|
||||
|
||||
def import_qualys_scan_xml(args={}, &block)
|
||||
def import_qualys_xml(args={}, &block)
|
||||
data = args[:data]
|
||||
wspace = args[:wspace] || workspace
|
||||
bl = validate_ips(args[:blacklist]) ? args[:blacklist].split : []
|
||||
|
@ -4950,7 +4849,7 @@ protected
|
|||
#
|
||||
def handle_qualys(wspace, hobj, port, protocol, qid, severity, refs, name=nil)
|
||||
addr = hobj.address
|
||||
port = port.to_i if port
|
||||
port = port.to_i
|
||||
|
||||
info = { :workspace => wspace, :host => hobj, :port => port, :proto => protocol }
|
||||
if name and name != 'unknown'
|
||||
|
|
|
@ -156,48 +156,6 @@ class Exploit < Msf::Module
|
|||
###
|
||||
class Remote < Exploit
|
||||
|
||||
# Protocol - layer 3
|
||||
autoload :Ip, 'msf/core/exploit/ip'
|
||||
autoload :Ipv6, 'msf/core/exploit/ipv6'
|
||||
# Protocol - layer 4
|
||||
autoload :Tcp, 'msf/core/exploit/tcp'
|
||||
autoload :TcpServer, 'msf/core/exploit/tcp'
|
||||
autoload :Udp, 'msf/core/exploit/udp'
|
||||
# Protocol - layer 5
|
||||
autoload :Ftp, 'msf/core/exploit/ftp'
|
||||
autoload :FtpServer, 'msf/core/exploit/ftpserver'
|
||||
autoload :Telnet, 'msf/core/exploit/telnet'
|
||||
autoload :HttpClient, 'msf/core/exploit/http/client'
|
||||
autoload :HttpServer, 'msf/core/exploit/http/server'
|
||||
autoload :Smtp, 'msf/core/exploit/smtp'
|
||||
autoload :Imap, 'msf/core/exploit/imap'
|
||||
autoload :Pop2, 'msf/core/exploit/pop2'
|
||||
autoload :SMTPDeliver, 'msf/core/exploit/smtp_deliver'
|
||||
autoload :SMB, 'msf/core/exploit/smb'
|
||||
autoload :SMBServer, 'msf/core/exploit/smb'
|
||||
autoload :DCERPC, 'msf/core/exploit/dcerpc'
|
||||
autoload :SunRPC, 'msf/core/exploit/sunrpc'
|
||||
|
||||
autoload :MSSQL, 'msf/core/exploit/mssql'
|
||||
autoload :MSSQL_COMMANDS, 'msf/core/exploit/mssql_commands'
|
||||
autoload :MSSQL_SQLI, 'msf/core/exploit/mssql_sqli'
|
||||
|
||||
autoload :MYSQL, 'msf/core/exploit/mysql'
|
||||
autoload :TNS, 'msf/core/exploit/tns'
|
||||
autoload :DB2, 'msf/core/exploit/db2'
|
||||
autoload :Postgres, 'msf/core/exploit/postgres'
|
||||
|
||||
autoload :SNMPClient, 'msf/core/exploit/snmp'
|
||||
autoload :Arkeia, 'msf/core/exploit/arkeia'
|
||||
autoload :NDMP, 'msf/core/exploit/ndmp'
|
||||
|
||||
autoload :WDBRPC, 'msf/core/exploit/wdbrpc'
|
||||
autoload :WDBRPC_Client, 'msf/core/exploit/wdbrpc_client'
|
||||
|
||||
autoload :BrowserAutopwn, 'msf/core/exploit/browser_autopwn'
|
||||
|
||||
autoload :Dialup, 'msf/core/exploit/dialup'
|
||||
|
||||
#
|
||||
# Initializes the socket array.
|
||||
#
|
||||
|
|
|
@ -205,7 +205,7 @@ module Exploit::Capture
|
|||
capture_file.setfilter(filter) if filter
|
||||
while (pkt = capture_file.next) do
|
||||
pcap.inject(pkt)
|
||||
Kernel.select(nil, nil, nil, (delay * 1.0)/1000)
|
||||
Kernel.select(nil, nil, nil, delay/1000)
|
||||
end
|
||||
GC.start
|
||||
end
|
||||
|
@ -373,13 +373,9 @@ module Exploit::Capture
|
|||
end
|
||||
|
||||
def check_pcaprub_loaded
|
||||
if not @pcaprub_loaded
|
||||
unless @pcaprub_loaded
|
||||
print_status("The Pcaprub module is not available: #{@pcaprub_error}")
|
||||
raise RuntimeError, "Pcaprub not available"
|
||||
#Those methods have been added later
|
||||
elsif (not Pcap.respond_to? "lookupaddrs")
|
||||
print_status("The Pcaprub module is not up-to-date")
|
||||
raise RuntimeError, "The Pcaprub module is missing some functions"
|
||||
else
|
||||
true
|
||||
end
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
# $Id$
|
||||
##
|
||||
|
||||
require 'rex/exploitation/cmdstager'
|
||||
require 'msf/core/exploit/exe'
|
||||
|
||||
module Msf
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
# $Id$
|
||||
##
|
||||
|
||||
require 'rex/text'
|
||||
require 'msf/core/exploit/tftp'
|
||||
require 'msf/core/exploit/cmdstager'
|
||||
|
||||
|
|
|
@ -13,8 +13,6 @@ module Msf
|
|||
###
|
||||
module Exploit::CmdStagerVBS
|
||||
|
||||
autoload :ADODB, 'msf/core/exploit/cmdstager_vbs_adodb'
|
||||
|
||||
include Msf::Exploit::CmdStager
|
||||
|
||||
def initialize(info = {})
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
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'
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
# $Id$
|
||||
##
|
||||
|
||||
require 'rex/proto/dhcp'
|
||||
|
||||
module Msf
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# $Id$
|
||||
|
||||
require 'rex/exploitation/egghunter'
|
||||
|
||||
module Msf
|
||||
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
require 'digest'
|
||||
require 'rex/proto/ntlm/crypt'
|
||||
require 'rex/proto/ntlm/constants'
|
||||
require 'rex/proto/ntlm/utils'
|
||||
require 'rex/proto/ntlm/exceptions'
|
||||
module Msf
|
||||
|
||||
###
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
require 'rex/service_manager'
|
||||
require 'rex/exploitation/obfuscatejs'
|
||||
require 'rex/exploitation/encryptjs'
|
||||
require 'rex/exploitation/heaplib'
|
||||
|
||||
module Msf
|
||||
|
||||
|
@ -12,7 +16,6 @@ module Exploit::Remote::HttpServer
|
|||
include Msf::Exploit::Remote::TcpServer
|
||||
include Msf::Auxiliary::Report
|
||||
|
||||
|
||||
def initialize(info = {})
|
||||
super
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
module Msf
|
||||
|
||||
require 'rex/payloads/win32/kernel'
|
||||
|
||||
module Exploit::KernelMode
|
||||
|
||||
|
|
|
@ -3,56 +3,84 @@
|
|||
# All exploit mixins should be added to the list below
|
||||
#
|
||||
|
||||
class Msf::Exploit
|
||||
|
||||
# Behavior
|
||||
autoload :Brute, 'msf/core/exploit/brute'
|
||||
autoload :BruteTargets, 'msf/core/exploit/brutetargets'
|
||||
require 'msf/core/exploit/brute'
|
||||
require 'msf/core/exploit/brutetargets'
|
||||
require 'msf/core/exploit/browser_autopwn'
|
||||
|
||||
# Payload
|
||||
autoload :Egghunter, 'msf/core/exploit/egghunter'
|
||||
autoload :Omelet, 'msf/core/exploit/omelet'
|
||||
autoload :Seh, 'msf/core/exploit/seh'
|
||||
autoload :KernelMode, 'msf/core/exploit/kernel_mode'
|
||||
autoload :EXE, 'msf/core/exploit/exe'
|
||||
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'
|
||||
|
||||
# CmdStagers
|
||||
autoload :CmdStager, 'msf/core/exploit/cmdstager'
|
||||
autoload :CmdStagerVBS, 'msf/core/exploit/cmdstager_vbs'
|
||||
autoload :CmdStagerDebugWrite, 'msf/core/exploit/cmdstager_debug_write'
|
||||
autoload :CmdStagerDebugAsm, 'msf/core/exploit/cmdstager_debug_asm'
|
||||
autoload :CmdStagerTFTP, 'msf/core/exploit/cmdstager_tftp'
|
||||
require 'msf/core/exploit/cmdstager'
|
||||
require 'msf/core/exploit/cmdstager_vbs'
|
||||
require 'msf/core/exploit/cmdstager_vbs_adodb'
|
||||
require 'msf/core/exploit/cmdstager_debug_write'
|
||||
require 'msf/core/exploit/cmdstager_debug_asm'
|
||||
require 'msf/core/exploit/cmdstager_tftp'
|
||||
|
||||
# Protocol utils
|
||||
autoload :NTLM, 'msf/core/exploit/ntlm'
|
||||
# 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/smb'
|
||||
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/dcerpc'
|
||||
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/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/wdbrpc'
|
||||
require 'msf/core/exploit/wdbrpc_client'
|
||||
|
||||
# Protocol - layer 2
|
||||
autoload :DHCPServer, 'msf/core/exploit/dhcp'
|
||||
autoload :TFTPServer, 'msf/core/exploit/tftp'
|
||||
|
||||
# Telephony
|
||||
autoload :DECT_COA, 'msf/core/exploit/dect_coa'
|
||||
require 'msf/core/exploit/dialup'
|
||||
require 'msf/core/exploit/dect_coa'
|
||||
|
||||
# Networks
|
||||
autoload :Lorcon, 'msf/core/exploit/lorcon'
|
||||
autoload :Lorcon2, 'msf/core/exploit/lorcon2'
|
||||
autoload :Capture, 'msf/core/exploit/capture'
|
||||
require 'msf/core/exploit/lorcon'
|
||||
require 'msf/core/exploit/lorcon2'
|
||||
require 'msf/core/exploit/capture'
|
||||
|
||||
# FileFormat
|
||||
autoload :FILEFORMAT, 'msf/core/exploit/fileformat'
|
||||
autoload :PDF_Parse, 'msf/core/exploit/pdf_parse'
|
||||
autoload :PDF, 'msf/core/exploit/pdf'
|
||||
autoload :RIFF, 'msf/core/exploit/riff'
|
||||
require 'msf/core/exploit/fileformat'
|
||||
require 'msf/core/exploit/pdf_parse'
|
||||
require 'msf/core/exploit/pdf'
|
||||
require 'msf/core/exploit/riff'
|
||||
|
||||
# Oracle
|
||||
autoload :ORACLE, 'msf/core/exploit/oracle'
|
||||
require 'msf/core/exploit/oracle'
|
||||
|
||||
# tekniqz
|
||||
autoload :FormatString, 'msf/core/exploit/fmtstr'
|
||||
require 'msf/core/exploit/fmtstr'
|
||||
|
||||
# Java
|
||||
autoload :Java, 'msf/core/exploit/java'
|
||||
require 'msf/core/exploit/java'
|
||||
|
||||
# WBEM
|
||||
autoload :WbemExec, 'msf/core/exploit/wbemexec'
|
||||
end
|
||||
require 'msf/core/exploit/wbemexec'
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
require 'msf/core'
|
||||
require 'msf/core/exploit/mssql_commands'
|
||||
require 'rex/proto/ntlm/crypt'
|
||||
require 'rex/proto/ntlm/constants'
|
||||
require 'rex/proto/ntlm/utils'
|
||||
require 'rex/proto/ntlm/exceptions'
|
||||
|
||||
|
||||
module Msf
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
require 'rex/proto/ntlm/constants'
|
||||
require 'rex/proto/ntlm/crypt'
|
||||
require 'rex/proto/ntlm/base'
|
||||
require 'rex/proto/ntlm/message'
|
||||
|
||||
module Msf
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# $Id$
|
||||
|
||||
require 'rex/exploitation/omelet'
|
||||
|
||||
module Msf
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
require 'rex/exploitation/seh'
|
||||
|
||||
module Msf
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
$:.unshift(File.join(File.dirname(__FILE__), '..', '..', '..'))
|
||||
|
||||
require 'test/unit'
|
||||
require 'rex'
|
||||
require 'msf/core'
|
||||
require 'msf/core/exploit/seh'
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
require 'rex/proto/smb'
|
||||
require 'rex/proto/ntlm'
|
||||
require 'rex/proto/dcerpc'
|
||||
require 'rex/encoder/ndr'
|
||||
|
||||
|
||||
module Msf
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
module Msf
|
||||
|
||||
require 'msf/core/exploit/tcp'
|
||||
require 'rex/mime'
|
||||
|
||||
###
|
||||
#
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
require 'rex/proto/sunrpc'
|
||||
|
||||
module Msf
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
# $Id$
|
||||
##
|
||||
|
||||
require 'rex/proto/tftp'
|
||||
|
||||
module Msf
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
require 'msf/core'
|
||||
|
||||
module Msf
|
||||
|
||||
|
@ -224,7 +225,7 @@ protected
|
|||
|
||||
# Wait the payload to acquire a session if this isn't a passive-style
|
||||
# exploit.
|
||||
return if not delay
|
||||
return if not
|
||||
|
||||
if (force_wait_for_session == true) or
|
||||
(exploit.passive? == false and exploit.handler_enabled?)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'rex/io/stream_abstraction'
|
||||
require 'rex/sync/ref'
|
||||
|
||||
module Msf
|
||||
module Handler
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'rex/io/stream_abstraction'
|
||||
require 'rex/sync/ref'
|
||||
|
||||
module Msf
|
||||
module Handler
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
require 'rex/socket'
|
||||
require 'thread'
|
||||
|
||||
module Msf
|
||||
|
|
|
@ -105,13 +105,12 @@ class Module
|
|||
true
|
||||
end
|
||||
|
||||
autoload :Author, 'msf/core/module/author'
|
||||
autoload :Platform, 'msf/core/module/platform'
|
||||
autoload :PlatformList, 'msf/core/module/platform_list'
|
||||
autoload :Reference, 'msf/core/module/reference'
|
||||
autoload :Target, 'msf/core/module/target'
|
||||
autoload :HasActions, 'msf/core/module/has_actions'
|
||||
autoload :AuxiliaryAction, 'msf/core/module/auxiliary_action'
|
||||
require 'msf/core/module/author'
|
||||
require 'msf/core/module/platform_list'
|
||||
require 'msf/core/module/reference'
|
||||
require 'msf/core/module/target'
|
||||
require 'msf/core/module/auxiliary_action'
|
||||
require 'msf/core/module/has_actions'
|
||||
|
||||
#
|
||||
# Creates an instance of an abstract module using the supplied information
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
require 'resolv'
|
||||
require 'msf/core'
|
||||
require 'rex/socket'
|
||||
|
||||
module Msf
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require 'msf/core'
|
||||
autoload :Metasm, 'metasm'
|
||||
require 'metasm'
|
||||
|
||||
module Msf
|
||||
|
||||
|
@ -14,19 +14,19 @@ class Payload < Msf::Module
|
|||
|
||||
require 'rex/payloads'
|
||||
|
||||
autoload :Single, 'msf/core/payload/single'
|
||||
autoload :Generic, 'msf/core/payload/generic'
|
||||
autoload :Stager, 'msf/core/payload/stager'
|
||||
require 'msf/core/payload/single'
|
||||
require 'msf/core/payload/generic'
|
||||
require 'msf/core/payload/stager'
|
||||
|
||||
# Platform specific includes
|
||||
autoload :Aix, 'msf/core/payload/aix'
|
||||
autoload :Bsd, 'msf/core/payload/bsd'
|
||||
autoload :Linux, 'msf/core/payload/linux'
|
||||
autoload :Osx, 'msf/core/payload/osx'
|
||||
autoload :Solaris, 'msf/core/payload/solaris'
|
||||
autoload :Windows, 'msf/core/payload/windows'
|
||||
autoload :Netware, 'msf/core/payload/netware'
|
||||
autoload :Java, 'msf/core/payload/java'
|
||||
require 'msf/core/payload/aix'
|
||||
require 'msf/core/payload/bsd'
|
||||
require 'msf/core/payload/linux'
|
||||
require 'msf/core/payload/osx'
|
||||
require 'msf/core/payload/solaris'
|
||||
require 'msf/core/payload/windows'
|
||||
require 'msf/core/payload/netware'
|
||||
require 'msf/core/payload/java'
|
||||
|
||||
##
|
||||
#
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
|
||||
require 'msf/core'
|
||||
require 'rex/peparsey'
|
||||
|
||||
module Msf
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
|
||||
require 'msf/core'
|
||||
require 'rex/peparsey'
|
||||
|
||||
module Msf
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
require 'rex/sync/ref'
|
||||
|
||||
module Msf
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
require "xmlrpc/client"
|
||||
require "rex"
|
||||
|
||||
module Msf
|
||||
module RPC
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
require 'pp'
|
||||
require 'rex'
|
||||
require 'msf/ui/web/driver'
|
||||
|
||||
module Msf
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
require "xmlrpc/server"
|
||||
require 'rex/service_manager'
|
||||
require "rex"
|
||||
|
||||
|
||||
module Msf
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'rex'
|
||||
require 'rex/ui/text/output/buffer'
|
||||
|
||||
module Msf
|
||||
module RPC
|
||||
|
|
|
@ -84,12 +84,15 @@ module Session
|
|||
end
|
||||
|
||||
# Direct descendents
|
||||
autoload :Interactive, 'msf/core/session/interactive'
|
||||
autoload :Basic, 'msf/core/session/basic'
|
||||
autoload :Comm, 'msf/core/session/comm'
|
||||
require 'msf/core/session/interactive'
|
||||
require 'msf/core/session/basic'
|
||||
require 'msf/core/session/comm'
|
||||
|
||||
# Provider interfaces
|
||||
autoload :Provider, 'msf/core/session/provider'
|
||||
require 'msf/core/session/provider/single_command_execution'
|
||||
require 'msf/core/session/provider/multi_command_execution'
|
||||
require 'msf/core/session/provider/single_command_shell'
|
||||
require 'msf/core/session/provider/multi_command_shell'
|
||||
|
||||
def self.type
|
||||
"unknown"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
require 'rex/socket'
|
||||
|
||||
module Msf
|
||||
module Session
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'rex/ui'
|
||||
require 'rex/io/ring_buffer'
|
||||
|
||||
module Msf
|
||||
module Session
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
module Msf
|
||||
module Session
|
||||
module Provider
|
||||
autoload :SingleCommandExecution, 'msf/core/session/provider/single_command_execution'
|
||||
autoload :MultiCommandExecution, 'msf/core/session/provider/multi_command_execution'
|
||||
autoload :SingleCommandShell, 'msf/core/session/provider/single_command_shell'
|
||||
autoload :MultiCommandShell, 'msf/core/session/provider/multi_command_shell'
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,8 +1,10 @@
|
|||
module Msf
|
||||
module Ui
|
||||
autoload :Banner, 'msf/ui/banner'
|
||||
autoload :Driver, 'msf/ui/driver'
|
||||
autoload :Common, 'msf/ui/common'
|
||||
autoload :Console, 'msf/ui/console'
|
||||
end
|
||||
end
|
||||
|
||||
require 'rex/ui'
|
||||
require 'msf/ui/banner'
|
||||
require 'msf/ui/driver'
|
||||
require 'msf/ui/common'
|
||||
require 'msf/ui/console'
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
|
||||
require 'rexml/document'
|
||||
require 'rex/parser/nmap_xml'
|
||||
require 'msf/core/db_export'
|
||||
|
||||
module Msf
|
||||
|
@ -1274,8 +1276,6 @@ class Db
|
|||
warnings = 0
|
||||
framework.db.import_file(:filename => filename) do |type,data|
|
||||
case type
|
||||
when :debug
|
||||
print_status("DEBUG: #{data.inspect}")
|
||||
when :filetype
|
||||
print_status("Importing '#{data}' data")
|
||||
when :address
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
require 'rex/parser/arguments'
|
||||
|
||||
module Msf
|
||||
module Ui
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
# $Id$
|
||||
##
|
||||
|
||||
require 'rex/parser/arguments'
|
||||
|
||||
module Msf
|
||||
module Ui
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
require 'rex/proto/http'
|
||||
require 'msf/core'
|
||||
require 'msf/base'
|
||||
require 'msf/ui'
|
||||
|
@ -6,6 +7,7 @@ module Msf
|
|||
module Ui
|
||||
module Web
|
||||
|
||||
require 'rex/io/bidirectional_pipe'
|
||||
require 'msf/ui/web/console'
|
||||
|
||||
|
||||
|
|
|
@ -10,15 +10,16 @@
|
|||
|
||||
|
||||
require 'msf/core'
|
||||
require 'rex'
|
||||
|
||||
module Msf
|
||||
module Util
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
# Executable generation and encoding
|
||||
autoload :EXE, 'msf/util/exe'
|
||||
require 'msf/util/exe'
|
||||
|
||||
# Parse SVN entries
|
||||
autoload :SVN, 'msf/util/svn'
|
||||
|
||||
end
|
||||
end
|
||||
require 'msf/util/svn'
|
||||
|
|
|
@ -13,15 +13,17 @@
|
|||
#
|
||||
###
|
||||
|
||||
require 'rex'
|
||||
|
||||
autoload :Metasm, 'metasm'
|
||||
require 'digest/sha1'
|
||||
|
||||
module Msf
|
||||
module Util
|
||||
class EXE
|
||||
|
||||
require 'rex'
|
||||
require 'rex/peparsey'
|
||||
require 'rex/pescan'
|
||||
require 'rex/zip'
|
||||
require 'metasm'
|
||||
require 'digest/sha1'
|
||||
|
||||
##
|
||||
#
|
||||
# Helper functions common to multiple generators
|
||||
|
@ -558,70 +560,28 @@ class EXE
|
|||
return mo
|
||||
end
|
||||
|
||||
#
|
||||
# Create a 32-bit Linux ELF containing the payload provided in +code+
|
||||
#
|
||||
# For the default template, this method just appends the payload. For
|
||||
# user-provided templates, modifies the header to mark all executable
|
||||
# segments as writable and overwrites the entrypoint (usually _start) with
|
||||
# the payload.
|
||||
#
|
||||
def self.to_linux_x86_elf(framework, code, opts={})
|
||||
unless opts[:template]
|
||||
default = true
|
||||
end
|
||||
|
||||
# Allow the user to specify their own template
|
||||
set_template_default(opts, "template_x86_linux.bin")
|
||||
|
||||
elf = ''
|
||||
File.open(opts[:template], "rb") { |fd|
|
||||
elf = fd.read(fd.stat.size)
|
||||
}
|
||||
|
||||
# The old way to do it is like other formats, just overwrite a big
|
||||
# block of rwx mem with our shellcode.
|
||||
#bo = elf.index( "\x90\x90\x90\x90" * 1024 )
|
||||
#co = elf.index( " " * 512 )
|
||||
#elf[bo, 2048] = [code].pack('a2048') if bo
|
||||
|
||||
if default
|
||||
# The new template is just an ELF header with its entry point set to
|
||||
# the end of the file, so just append shellcode to it and fixup
|
||||
# p_filesz and p_memsz in the header for a working ELF executable.
|
||||
elf = ''
|
||||
File.open(opts[:template], "rb") { |fd|
|
||||
elf = fd.read(fd.stat.size)
|
||||
}
|
||||
|
||||
elf << code
|
||||
elf[0x44,4] = [elf.length + code.length].pack('V')
|
||||
elf[0x48,4] = [elf.length + code.length].pack('V')
|
||||
else
|
||||
# If this isn't our normal template, we have to do some fancy
|
||||
# header patching to mark the .text section rwx before putting our
|
||||
# payload into the entry point.
|
||||
|
||||
# read in the template and parse it
|
||||
e = Metasm::ELF.decode_file(opts[:template])
|
||||
|
||||
# This will become a modified copy of the template's original phdr
|
||||
new_phdr = Metasm::EncodedData.new
|
||||
e.segments.each { |s|
|
||||
# Be lazy and mark any executable segment as writable. Doing
|
||||
# it this way means we don't have to care about which one
|
||||
# contains .text
|
||||
if s.flags.include? "X"
|
||||
s.flags += [ "W" ]
|
||||
end
|
||||
new_phdr << s.encode(e)
|
||||
}
|
||||
|
||||
# Copy the original file
|
||||
elf = File.read(opts[:template])
|
||||
|
||||
# Replace the header with our rwx modified version
|
||||
elf[e.header.phoff, new_phdr.data.length] = new_phdr.data
|
||||
|
||||
# Replace code at the entrypoint with our payload
|
||||
entry_off = e.addr_to_off(e.label_addr('entrypoint'))
|
||||
elf[entry_off, code.length] = code
|
||||
end
|
||||
|
||||
return elf
|
||||
end
|
||||
|
|
70
lib/rex.rb
70
lib/rex.rb
|
@ -40,77 +40,53 @@ end
|
|||
# Generic classes
|
||||
require 'rex/constants'
|
||||
require 'rex/exceptions'
|
||||
|
||||
module Rex
|
||||
# Generic modules
|
||||
autoload :FileUtils, 'rex/file'
|
||||
autoload :Find, 'rex/file'
|
||||
autoload :Quickfile, 'rex/file'
|
||||
autoload :Text, 'rex/text'
|
||||
autoload :Job, 'rex/job_container'
|
||||
autoload :JobContainer, 'rex/job_container'
|
||||
autoload :Transformer, 'rex/transformer'
|
||||
autoload :ExtTime, 'rex/time'
|
||||
autoload :Zip, 'rex/zip'
|
||||
require 'rex/transformer'
|
||||
require 'rex/text'
|
||||
require 'rex/time'
|
||||
require 'rex/job_container'
|
||||
require 'rex/file'
|
||||
|
||||
# Thread safety and synchronization
|
||||
autoload :ReadWriteLock, 'rex/sync/read_write_lock'
|
||||
autoload :ThreadSafe, 'rex/sync/thread_safe'
|
||||
autoload :Ref, 'rex/sync/ref'
|
||||
autoload :Sync, 'rex/sync/event'
|
||||
require 'rex/sync'
|
||||
|
||||
# Thread factory
|
||||
autoload :ThreadFactory, 'rex/thread_factory'
|
||||
require 'rex/thread_factory'
|
||||
|
||||
# Encoding
|
||||
autoload :Encoder, 'rex/encoder'
|
||||
autoload :Encoders, 'rex/encoders'
|
||||
autoload :Encoding, 'rex/encoding'
|
||||
require 'rex/encoder/xor'
|
||||
require 'rex/encoding/xor'
|
||||
|
||||
# Architecture subsystem
|
||||
autoload :Arch, 'rex/arch'
|
||||
require 'rex/arch'
|
||||
|
||||
# Assembly
|
||||
autoload :Assembly, 'rex/assembly/nasm'
|
||||
require 'rex/assembly/nasm'
|
||||
|
||||
# Logging
|
||||
autoload :Logging, 'rex/logging'
|
||||
require 'rex/logging/log_dispatcher'
|
||||
|
||||
# IO
|
||||
autoload :IO, 'rex/io'
|
||||
require 'rex/io/stream'
|
||||
require 'rex/io/stream_abstraction'
|
||||
require 'rex/io/stream_server'
|
||||
|
||||
# Sockets
|
||||
autoload :Socket, 'rex/socket'
|
||||
|
||||
# Platforms
|
||||
autoload :Platforms, 'rex/platforms'
|
||||
require 'rex/socket'
|
||||
|
||||
# Protocols
|
||||
autoload :Proto, 'rex/proto'
|
||||
|
||||
# Service handling
|
||||
autoload :Service, 'rex/service'
|
||||
autoload :ServiceManager, 'rex/service_manager'
|
||||
require 'rex/proto'
|
||||
|
||||
# Parsers
|
||||
autoload :Parser, 'rex/parser'
|
||||
require 'rex/parser/arguments'
|
||||
require 'rex/parser/ini'
|
||||
|
||||
|
||||
# Compatibility
|
||||
autoload :Compat, 'rex/compat'
|
||||
require 'rex/compat'
|
||||
|
||||
# User interface
|
||||
autoload :Ui, 'rex/ui'
|
||||
|
||||
# Meterpreter
|
||||
autoload :Post, 'rex/post'
|
||||
autoload :Script, 'rex/script'
|
||||
|
||||
# PE Parsing
|
||||
autoload :PeParsey, 'rex/peparsey'
|
||||
|
||||
# Exploit techniques
|
||||
autoload :Exploitation, 'rex/exploitation'
|
||||
end
|
||||
# Platforms
|
||||
require 'rex/platforms'
|
||||
|
||||
|
||||
# Overload the Kernel.sleep() function to be thread-safe
|
||||
|
|
|
@ -2,6 +2,7 @@ require 'rex/constants'
|
|||
|
||||
module Rex
|
||||
|
||||
|
||||
###
|
||||
#
|
||||
# This module provides generalized methods for performing operations that are
|
||||
|
@ -14,8 +15,8 @@ module Arch
|
|||
#
|
||||
# Architecture classes
|
||||
#
|
||||
autoload :X86, 'rex/arch/x86'
|
||||
autoload :Sparc, 'rex/arch/sparc'
|
||||
require 'rex/arch/x86'
|
||||
require 'rex/arch/sparc'
|
||||
|
||||
#
|
||||
# This routine adjusts the stack pointer for a given architecture.
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
##
|
||||
# $Id$
|
||||
#
|
||||
# This file maps encoders for autoload
|
||||
##
|
||||
|
||||
module Rex::Encoder
|
||||
# Encoder support code
|
||||
autoload :Xor, 'rex/encoder/xor'
|
||||
autoload :Alpha2, 'rex/encoder/alpha2'
|
||||
autoload :NonAlpha, 'rex/encoder/nonalpha'
|
||||
autoload :NonUpper, 'rex/encoder/nonupper'
|
||||
|
||||
# Hrm? Is these in the wrong module?
|
||||
autoload :XDR, 'rex/encoder/xdr'
|
||||
autoload :NDR, 'rex/encoder/ndr'
|
||||
end
|
|
@ -18,16 +18,14 @@
|
|||
module Rex
|
||||
module Encoder
|
||||
module Alpha2
|
||||
end end end
|
||||
|
||||
#
|
||||
# autoload the Alpha2 encoders
|
||||
# include the Alpha2 encodings
|
||||
#
|
||||
autoload :Generic, 'rex/encoder/alpha2/generic'
|
||||
autoload :AlphaMixed, 'rex/encoder/alpha2/alpha_mixed'
|
||||
autoload :AlphaUpper, 'rex/encoder/alpha2/alpha_upper'
|
||||
autoload :UnicodeMixed, 'rex/encoder/alpha2/unicode_mixed'
|
||||
autoload :UnicodeUpper, 'rex/encoder/alpha2/unicode_upper'
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
require 'rex/encoder/alpha2/generic'
|
||||
require 'rex/encoder/alpha2/alpha_mixed'
|
||||
require 'rex/encoder/alpha2/alpha_upper'
|
||||
require 'rex/encoder/alpha2/unicode_mixed'
|
||||
require 'rex/encoder/alpha2/unicode_upper'
|
|
@ -10,9 +10,6 @@ module Encoder
|
|||
###
|
||||
class Xor
|
||||
|
||||
autoload :Dword, 'rex/encoder/xor/dword'
|
||||
autoload :DwordAdditive, 'rex/encoder/xor/dword_additive'
|
||||
|
||||
attr_accessor :raw, :encoded, :badchars, :opts, :key, :fkey # :nodoc:
|
||||
|
||||
#
|
||||
|
@ -68,5 +65,5 @@ class Xor
|
|||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end end
|
||||
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
##
|
||||
# $Id$
|
||||
#
|
||||
# This file maps encoders for autoload
|
||||
##
|
||||
require 'rex'
|
||||
|
||||
module Rex::Encoders
|
||||
autoload :XorDword, 'rex/encoders/xor_dword'
|
||||
autoload :XorDwordAdditive, 'rex/encoders/xor_dword_additive'
|
||||
end
|
|
@ -1,10 +0,0 @@
|
|||
##
|
||||
# $Id$
|
||||
#
|
||||
# This file maps encodings for autoload
|
||||
##
|
||||
|
||||
module Rex::Encoding
|
||||
# Encoding support code
|
||||
autoload :Xor, 'rex/encoding/xor'
|
||||
end
|
|
@ -1,19 +1,20 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
#
|
||||
# make sure the namespace is created
|
||||
#
|
||||
|
||||
module Rex
|
||||
module Encoding
|
||||
module Xor
|
||||
end end end
|
||||
|
||||
#
|
||||
# autoload the Xor encodings
|
||||
# include the Xor encodings
|
||||
#
|
||||
autoload :Generic, 'rex/encoding/xor/generic'
|
||||
autoload :Byte, 'rex/encoding/xor/byte'
|
||||
autoload :Word, 'rex/encoding/xor/word'
|
||||
autoload :Dword, 'rex/encoding/xor/dword'
|
||||
autoload :DwordAdditive, 'rex/encoding/xor/dword_additive'
|
||||
autoload :Qword, 'rex/encoding/xor/qword'
|
||||
|
||||
autoload :Exception, 'rex/encoding/xor/exceptions'
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
require 'rex/encoding/xor/generic'
|
||||
require 'rex/encoding/xor/byte'
|
||||
require 'rex/encoding/xor/word'
|
||||
require 'rex/encoding/xor/dword'
|
||||
require 'rex/encoding/xor/qword'
|
|
@ -1,23 +0,0 @@
|
|||
module Rex
|
||||
module Exploitation
|
||||
autoload :Seh, 'rex/exploitation/seh'
|
||||
autoload :OpcodeDb, 'rex/exploitation/opcodedb'
|
||||
|
||||
# CMD stagers
|
||||
autoload :CmdStagerBase, 'rex/exploitation/cmdstager/base'
|
||||
autoload :CmdStagerDebugAsm, 'rex/exploitation/cmdstager/debug_asm'
|
||||
autoload :CmdStagerDebugWrite, 'rex/exploitation/cmdstager/debug_write'
|
||||
autoload :CmdStagerTFTP, 'rex/exploitation/cmdstager/tftp'
|
||||
autoload :CmdStagerVBS, 'rex/exploitation/cmdstager/vbs'
|
||||
|
||||
# Shellcode slicing
|
||||
autoload :Egghunter, 'rex/exploitation/egghunter'
|
||||
autoload :Omelet, 'rex/exploitation/omelet'
|
||||
|
||||
# Javascript fun
|
||||
autoload :EncryptJS, 'rex/exploitation/encryptjs'
|
||||
autoload :HeapLib, 'rex/exploitation/heaplib'
|
||||
autoload :ObfuscateJS, 'rex/exploitation/obfuscatejs'
|
||||
autoload :JavascriptOSDetect, 'rex/exploitation/javascriptosdetect'
|
||||
end
|
||||
end
|
|
@ -1,6 +1,6 @@
|
|||
##
|
||||
# $Id$
|
||||
##
|
||||
require 'rex/text'
|
||||
require 'rex/arch'
|
||||
require 'msf/core/framework'
|
||||
|
||||
module Rex
|
||||
module Exploitation
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
##
|
||||
# $Id$
|
||||
# $Id: debug_asm.rb 12595 2011-05-12 18:33:49Z jduck $
|
||||
##
|
||||
|
||||
require 'rex/text'
|
||||
require 'rex/arch'
|
||||
require 'msf/core/framework'
|
||||
|
||||
module Rex
|
||||
module Exploitation
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
##
|
||||
# $Id$
|
||||
# $Id: debug_write.rb 12595 2011-05-12 18:33:49Z jduck $
|
||||
##
|
||||
|
||||
require 'rex/text'
|
||||
require 'rex/arch'
|
||||
require 'msf/core/framework'
|
||||
|
||||
module Rex
|
||||
module Exploitation
|
||||
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
# $Id$
|
||||
##
|
||||
|
||||
require 'rex/text'
|
||||
require 'rex/arch'
|
||||
require 'msf/core/framework'
|
||||
|
||||
module Rex
|
||||
module Exploitation
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
##
|
||||
# $Id$
|
||||
# $Id: vbs.rb 12595 2011-05-12 18:33:49Z jduck $
|
||||
##
|
||||
|
||||
require 'rex/text'
|
||||
require 'rex/arch'
|
||||
require 'msf/core/framework'
|
||||
|
||||
module Rex
|
||||
module Exploitation
|
||||
|
||||
|
|
|
@ -103,8 +103,12 @@ class Omelet
|
|||
nr_eggs_hex = "%02x" % nr_eggs
|
||||
eggsize_hex = "%02x" % eggsize
|
||||
|
||||
hextag = eggtag.unpack('C*').map { |b| "%02x" % b }.join
|
||||
hextag << "01"
|
||||
hextag = ''
|
||||
eggtag.each_byte do |thischar|
|
||||
decchar = "%02x" % thischar
|
||||
hextag = decchar + hextag
|
||||
end
|
||||
hextag = hextag + "01"
|
||||
|
||||
# search forward or backward ?
|
||||
setflag = nil
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
##
|
||||
# $Id$
|
||||
#
|
||||
# This file simply provides an autoload interface for the children
|
||||
# of Rex::IO
|
||||
#
|
||||
##
|
||||
module Rex::IO
|
||||
autoload :Stream, 'rex/io/stream'
|
||||
autoload :StreamAbstraction, 'rex/io/stream_abstraction'
|
||||
autoload :StreamServer, 'rex/io/stream_server'
|
||||
|
||||
autoload :BidirectionalPipe, 'rex/io/bidirectional_pipe'
|
||||
autoload :DatagramAbstraction, 'rex/io/datagram_abstraction'
|
||||
autoload :RingBuffer, 'rex/io/ring_buffer'
|
||||
end
|
|
@ -1,17 +1,4 @@
|
|||
##
|
||||
# $Id: $
|
||||
#
|
||||
# maps autoload for logging classes
|
||||
##
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require 'rex/constants' # for LEV_'s
|
||||
|
||||
module Rex
|
||||
module Logging
|
||||
autoload :LogSink, 'rex/logging/log_sink'
|
||||
autoload :Sinks, 'rex/logging/sinks'
|
||||
end
|
||||
end
|
||||
|
||||
# This defines a global so it must be loaded always
|
||||
require 'rex/logging/log_dispatcher'
|
|
@ -1,4 +1,5 @@
|
|||
require 'rex/sync'
|
||||
require 'rex/logging/log_sink'
|
||||
|
||||
module Rex
|
||||
module Logging
|
||||
|
|
|
@ -37,3 +37,6 @@ end
|
|||
|
||||
end
|
||||
end
|
||||
|
||||
require 'rex/logging/sinks/flatfile'
|
||||
require 'rex/logging/sinks/stderr'
|
|
@ -1,16 +0,0 @@
|
|||
##
|
||||
# $Id$
|
||||
#
|
||||
# Map log sinks for autload
|
||||
##
|
||||
|
||||
module Rex
|
||||
module Logging
|
||||
module Sinks
|
||||
|
||||
autoload :Flatfile, 'rex/logging/sinks/flatfile'
|
||||
autoload :Stderr, 'rex/logging/sinks/stderr'
|
||||
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,5 +1,3 @@
|
|||
require 'rex/logging'
|
||||
|
||||
module Rex
|
||||
module Logging
|
||||
module Sinks
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
##
|
||||
# $Id$
|
||||
#
|
||||
# This file maps parsers for autoload
|
||||
##
|
||||
|
||||
module Rex
|
||||
module Parser
|
||||
# General parsers
|
||||
autoload :Arguments, 'rex/parser/arguments'
|
||||
autoload :Ini, 'rex/parser/ini'
|
||||
|
||||
# Data import parsers
|
||||
autoload :NmapXMLStreamParser, 'rex/parser/nmap_xml'
|
||||
autoload :NexposeXMLStreamParser, 'rex/parser/nexpose_xml'
|
||||
autoload :RetinaXMLStreamParser, 'rex/parser/retina_xml'
|
||||
autoload :NetSparkerXMLStreamParser, 'rex/parser/netsparker_xml'
|
||||
autoload :NessusXMLStreamParser, 'rex/parser/nessus_xml'
|
||||
autoload :IP360XMLStreamParser, 'rex/parser/ip360_xml'
|
||||
autoload :IP360ASPLXMLStreamParser, 'rex/parser/ip360_aspl_xml'
|
||||
autoload :AppleBackupManifestDB, 'rex/parser/apple_backup_manifestdb'
|
||||
end
|
||||
end
|
|
@ -59,8 +59,7 @@ class NmapXMLStreamParser
|
|||
end
|
||||
|
||||
def reset_state
|
||||
@host = { "status" => nil, "addrs" => {}, "ports" => [], "scripts" => {} }
|
||||
@state = nil
|
||||
@host = { "status" => nil, "addrs" => {}, "ports" => [] }
|
||||
end
|
||||
|
||||
def tag_start(name, attributes)
|
||||
|
@ -99,7 +98,6 @@ class NmapXMLStreamParser
|
|||
@host["status_reason"] = attributes["reason"]
|
||||
when "port"
|
||||
@host["ports"].push(attributes)
|
||||
@state = :in_port_tag
|
||||
when "state"
|
||||
# <state> refers to the state of a port; values are "open", "closed", or "filtered"
|
||||
@host["ports"].last["state"] = attributes["state"]
|
||||
|
@ -108,21 +106,8 @@ class NmapXMLStreamParser
|
|||
# be any collisions on attribute names here, so just merge them.
|
||||
@host["ports"].last.merge!(attributes)
|
||||
when "script"
|
||||
# Associate scripts under a port tag with the appropriate port.
|
||||
# Other scripts from <hostscript> tags can only be associated with
|
||||
# the host and scripts from <postscript> tags don't really belong
|
||||
# to anything, so ignore them
|
||||
if @state == :in_port_tag
|
||||
@host["ports"].last["scripts"] ||= {}
|
||||
@host["ports"].last["scripts"][attributes["id"]] = attributes["output"]
|
||||
elsif @host
|
||||
@host["scripts"] ||= {}
|
||||
@host["scripts"][attributes["id"]] = attributes["output"]
|
||||
else
|
||||
# post scripts are used for things like comparing all the found
|
||||
# ssh keys to see if multiple hosts have the same key
|
||||
# fingerprint. Ignore them.
|
||||
end
|
||||
when "trace"
|
||||
@host["trace"] = {"port" => attributes["port"], "proto" => attributes["proto"], "hops" => [] }
|
||||
when "hop"
|
||||
|
@ -134,8 +119,6 @@ class NmapXMLStreamParser
|
|||
|
||||
def tag_end(name)
|
||||
case name
|
||||
when "port"
|
||||
@state = nil
|
||||
when "host"
|
||||
on_found_host.call(@host) if on_found_host
|
||||
reset_state
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
module Rex::Payloads
|
||||
autoload :Win32, 'rex/payloads/win32'
|
||||
end
|
||||
require 'rex/payloads/win32'
|
|
@ -1,4 +1,2 @@
|
|||
module Rex::Payloads::Win32
|
||||
autoload :Common, 'rex/payloads/win32/common'
|
||||
autoload :Kernel, 'rex/payloads/win32/kernel'
|
||||
end
|
||||
require 'rex/payloads/win32/common'
|
||||
require 'rex/payloads/win32/kernel'
|
|
@ -1,12 +1,13 @@
|
|||
module Rex
|
||||
module Payloads
|
||||
module Win32
|
||||
module Kernel
|
||||
|
||||
autoload :Common, 'rex/payloads/win32/kernel/common'
|
||||
autoload :Recovery, 'rex/payloads/win32/kernel/recovery'
|
||||
autoload :Stager, 'rex/payloads/win32/kernel/stager'
|
||||
autoload :Migration, 'rex/payloads/win32/kernel/migration'
|
||||
require 'rex/payloads/win32/kernel/common'
|
||||
require 'rex/payloads/win32/kernel/recovery'
|
||||
require 'rex/payloads/win32/kernel/stager'
|
||||
require 'rex/payloads/win32/kernel/migration'
|
||||
|
||||
module Kernel
|
||||
|
||||
#
|
||||
# Constructs a kernel-mode payload using the supplied options. The options
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
#!/usr/bin/env ruby
|
||||
#
|
||||
|
||||
# $Id$
|
||||
#
|
||||
|
||||
module Rex
|
||||
module PeParsey
|
||||
autoload :Pe, 'rex/peparsey/pe'
|
||||
autoload :PeMemDump, 'rex/peparsey/pe_memdump'
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
require 'rex/peparsey/pe'
|
||||
require 'rex/peparsey/pe_memdump'
|
|
@ -1,12 +1,13 @@
|
|||
#!/usr/bin/env ruby
|
||||
#
|
||||
|
||||
# $Id$
|
||||
#
|
||||
|
||||
module Rex
|
||||
module PeScan
|
||||
autoload :Analyze, 'rex/pescan/analyze'
|
||||
autoload :Scanner, 'rex/pescan/scanner'
|
||||
autoload :Search, 'rex/pescan/search'
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
require 'rex/pescan/analyze'
|
||||
require 'rex/pescan/scanner'
|
||||
require 'rex/pescan/search'
|
|
@ -1,11 +1 @@
|
|||
##
|
||||
# $Id: $
|
||||
#
|
||||
# This file maps Platforms for autoload
|
||||
##
|
||||
|
||||
module Rex
|
||||
module Platforms
|
||||
autoload :Windows, 'rex/platforms/windows'
|
||||
end
|
||||
end
|
||||
require 'rex/platforms/windows'
|
|
@ -1,14 +1,8 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
# General independent containers
|
||||
require 'rex/post/dir'
|
||||
require 'rex/post/file'
|
||||
require 'rex/post/file_stat'
|
||||
require 'rex/post/io'
|
||||
require 'rex/post/permission'
|
||||
require 'rex/post/process'
|
||||
require 'rex/post/thread'
|
||||
|
||||
# Post-exploitation clients
|
||||
require 'rex/post/dispatch_ninja'
|
||||
require 'rex/post/meterpreter'
|
||||
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/perl
|
||||
use strict;
|
||||
|
||||
|
||||
foreach my $f ('atime', 'blockdev?', 'chardev?', 'ctime', 'directory?',
|
||||
'executable?', 'executable_real?', 'file?', 'ftype', 'grpowned?',
|
||||
'mtime', 'owned?', 'pipe?', 'readable?', 'readable_real?', 'setuid?',
|
||||
'setgid?', 'size', 'socket?', 'sticky?', 'symlink?', 'writeable?',
|
||||
'writeable_real?', 'zero?') {
|
||||
|
||||
my $t = "\t";
|
||||
print "${t}def File.$f(name)\n\t${t}stat(name).$f\n${t}end\n";
|
||||
}
|
|
@ -1,23 +1,12 @@
|
|||
##
|
||||
# $Id$
|
||||
#
|
||||
# This file maps Proto items for autoload
|
||||
##
|
||||
require 'rex/proto/http'
|
||||
require 'rex/proto/smb'
|
||||
require 'rex/proto/ntlm'
|
||||
require 'rex/proto/dcerpc'
|
||||
require 'rex/proto/drda'
|
||||
|
||||
module Rex
|
||||
module Proto
|
||||
|
||||
autoload :Http, 'rex/proto/http'
|
||||
autoload :SMB, 'rex/proto/smb'
|
||||
autoload :NTLM, 'rex/proto/ntlm'
|
||||
autoload :DCERPC, 'rex/proto/dcerpc'
|
||||
autoload :DRDA, 'rex/proto/drda'
|
||||
|
||||
autoload :SunRPC, 'rex/proto/sunrpc'
|
||||
autoload :DHCP, 'rex/proto/dhcp'
|
||||
autoload :TFTP, 'rex/proto/tftp'
|
||||
autoload :RFB, 'rex/proto/rfb'
|
||||
|
||||
attr_accessor :alias
|
||||
|
||||
end
|
||||
|
|
|
@ -1,15 +1,6 @@
|
|||
module Rex
|
||||
module Proto
|
||||
module DCERPC
|
||||
|
||||
autoload :Exceptions, 'rex/proto/dcerpc/exceptions'
|
||||
autoload :UUID, 'rex/proto/dcerpc/uuid'
|
||||
autoload :Response, 'rex/proto/dcerpc/response'
|
||||
autoload :Client, 'rex/proto/dcerpc/client'
|
||||
autoload :Packet, 'rex/proto/dcerpc/packet'
|
||||
autoload :Handle, 'rex/proto/dcerpc/handle'
|
||||
autoload :NDR, 'rex/proto/dcerpc/ndr'
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
require 'rex/proto/dcerpc/uuid'
|
||||
require 'rex/proto/dcerpc/response'
|
||||
require 'rex/proto/dcerpc/client'
|
||||
require 'rex/proto/dcerpc/packet'
|
||||
require 'rex/proto/dcerpc/handle'
|
||||
require 'rex/proto/dcerpc/ndr'
|
|
@ -1,10 +1,5 @@
|
|||
module Rex
|
||||
module Proto
|
||||
module DRDA
|
||||
autoload :Constants, 'rex/proto/drda/constants'
|
||||
autoload :Utils, 'rex/proto/drda/utils'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
require 'rex/proto/drda/constants'
|
||||
require 'rex/proto/drda/packet'
|
||||
require 'rex/proto/drda/utils'
|
||||
|
||||
|
||||
|
|
|
@ -1,18 +1,5 @@
|
|||
# These are required by all uses of Rex::Proto::Http
|
||||
require 'rex/proto/http/packet'
|
||||
require 'rex/proto/http/request'
|
||||
require 'rex/proto/http/response'
|
||||
|
||||
# These are specific to use case
|
||||
module Rex
|
||||
module Proto
|
||||
module Http
|
||||
|
||||
autoload :Client, 'rex/proto/http/client'
|
||||
|
||||
autoload :Server, 'rex/proto/http/server'
|
||||
autoload :Handler, 'rex/proto/http/handler'
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
require 'rex/proto/http/client'
|
||||
require 'rex/proto/http/server'
|
|
@ -1,5 +1,4 @@
|
|||
require 'rex/proto/http'
|
||||
require 'rex/text'
|
||||
|
||||
module Rex
|
||||
module Proto
|
||||
|
|
|
@ -1,13 +1,7 @@
|
|||
module Rex
|
||||
module Proto
|
||||
module NTLM
|
||||
autoload :Constants, 'rex/proto/ntlm/constants'
|
||||
autoload :Exceptions, 'rex/proto/ntlm/exceptions'
|
||||
require 'rex/proto/ntlm/constants'
|
||||
require 'rex/proto/ntlm/exceptions'
|
||||
require 'rex/proto/ntlm/crypt'
|
||||
require 'rex/proto/ntlm/utils'
|
||||
require 'rex/proto/ntlm/base'
|
||||
require 'rex/proto/ntlm/message'
|
||||
|
||||
autoload :Base, 'rex/proto/ntlm/base'
|
||||
autoload :Crypt, 'rex/proto/ntlm/crypt'
|
||||
autoload :Message, 'rex/proto/ntlm/message'
|
||||
autoload :Utils, 'rex/proto/ntlm/utils'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -45,8 +45,6 @@
|
|||
|
||||
#this module defines the message class , useful for easily handling type 1/2/3 ntlm messages
|
||||
|
||||
require 'rex/text'
|
||||
|
||||
require 'rex/proto/ntlm/base'
|
||||
require 'rex/proto/ntlm/constants'
|
||||
require 'rex/proto/ntlm/crypt'
|
||||
|
|
|
@ -1,15 +1,7 @@
|
|||
module Rex
|
||||
module Proto
|
||||
module SMB
|
||||
|
||||
autoload :Constants, 'rex/proto/smb/constants'
|
||||
autoload :Exceptions, 'rex/proto/smb/exceptions'
|
||||
autoload :Evasions, 'rex/proto/smb/evasions'
|
||||
autoload :Crypt, 'rex/proto/smb/crypt'
|
||||
autoload :Utils, 'rex/proto/smb/utils'
|
||||
autoload :Client, 'rex/proto/smb/client'
|
||||
autoload :SimpleClient, 'rex/proto/smb/simpleclient'
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
require 'rex/proto/smb/constants'
|
||||
require 'rex/proto/smb/exceptions'
|
||||
require 'rex/proto/smb/evasions'
|
||||
require 'rex/proto/smb/crypt'
|
||||
require 'rex/proto/smb/utils'
|
||||
require 'rex/proto/smb/client'
|
||||
require 'rex/proto/smb/simpleclient'
|
|
@ -1,5 +1,6 @@
|
|||
require 'singleton'
|
||||
require 'rex'
|
||||
require 'rex/service'
|
||||
|
||||
module Rex
|
||||
|
||||
|
|
|
@ -12,23 +12,19 @@ module Rex
|
|||
###
|
||||
module Socket
|
||||
|
||||
# Plumbing / Aux
|
||||
autoload :Parameters, 'rex/socket/parameters'
|
||||
autoload :Comm, 'rex/socket/comm'
|
||||
module Comm
|
||||
end
|
||||
|
||||
# Underlying protocol-specific
|
||||
autoload :Ip, 'rex/socket/ip'
|
||||
autoload :Udp, 'rex/socket/udp'
|
||||
autoload :Tcp, 'rex/socket/tcp'
|
||||
autoload :TcpServer, 'rex/socket/tcp_server'
|
||||
autoload :SslTcp, 'rex/socket/ssl_tcp'
|
||||
autoload :SslTcpServer, 'rex/socket/ssl_tcp_server'
|
||||
require 'rex/socket/parameters'
|
||||
require 'rex/socket/tcp'
|
||||
require 'rex/socket/tcp_server'
|
||||
|
||||
# Utilities
|
||||
autoload :SwitchBoard, 'rex/socket/switch_board'
|
||||
autoload :SubnetWalker, 'rex/socket/subnet_walker'
|
||||
autoload :Range, 'rex/socket/range_walker'
|
||||
autoload :RangeWalker, 'rex/socket/range_walker'
|
||||
require 'rex/socket/comm'
|
||||
require 'rex/socket/comm/local'
|
||||
|
||||
require 'rex/socket/switch_board'
|
||||
require 'rex/socket/subnet_walker'
|
||||
require 'rex/socket/range_walker'
|
||||
|
||||
##
|
||||
#
|
||||
|
|
|
@ -14,8 +14,6 @@ module Socket
|
|||
###
|
||||
module Comm
|
||||
|
||||
autoload :Local, 'rex/socket/comm/local'
|
||||
|
||||
###
|
||||
#
|
||||
# This mixin provides stubs for event notification handlers that can be
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
require 'rex/compat'
|
||||
require 'rex/socket'
|
||||
require 'singleton'
|
||||
require 'rex/socket'
|
||||
require 'rex/socket/tcp'
|
||||
require 'rex/socket/ssl_tcp'
|
||||
require 'rex/socket/ssl_tcp_server'
|
||||
require 'rex/socket/udp'
|
||||
require 'rex/socket/ip'
|
||||
require 'timeout'
|
||||
|
||||
###
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module Rex
|
||||
autoload :ReadWriteLock, 'rex/sync/read_write_lock'
|
||||
autoload :ThreadSafe, 'rex/sync/thread_safe'
|
||||
autoload :Ref, 'rex/sync/ref'
|
||||
autoload :Sync, 'rex/sync/event'
|
||||
end
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require 'rex/sync/thread_safe'
|
||||
require 'rex/sync/ref'
|
||||
require 'rex/sync/read_write_lock'
|
||||
require 'rex/sync/event'
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue