2014-09-08 15:32:13 -05:00
|
|
|
# -*- coding: binary -*-
|
2006-09-01 15:50:10 +00:00
|
|
|
|
2005-06-03 04:51:51 +00:00
|
|
|
module Rex
|
2008-11-16 21:10:35 +00:00
|
|
|
Root = File.join(File.expand_path(File.dirname(__FILE__)), 'rex')
|
2005-10-30 23:40:27 +00:00
|
|
|
LogSource = "rex"
|
2005-06-03 04:51:51 +00:00
|
|
|
end
|
|
|
|
|
|
2016-07-05 10:33:45 -05:00
|
|
|
#
|
|
|
|
|
# REX Gems
|
|
|
|
|
#
|
2016-09-14 12:07:26 -05:00
|
|
|
|
2016-07-05 10:33:45 -05:00
|
|
|
# Text manipulation library for things like generating random string
|
|
|
|
|
require 'rex/text'
|
|
|
|
|
# Library for Generating Randomized strings valid as Identifiers such as variable names
|
|
|
|
|
require 'rex/random_identifier'
|
|
|
|
|
# library for creating Powershell scripts for exploitation purposes
|
|
|
|
|
require 'rex/powershell'
|
2018-03-19 18:59:39 -05:00
|
|
|
# Library for processing and creating Zip compatible archives
|
2016-07-05 10:33:45 -05:00
|
|
|
require 'rex/zip'
|
|
|
|
|
# Library for parsing offline Windows Registry files
|
|
|
|
|
require 'rex/registry'
|
|
|
|
|
# Library for parsing Java serialized streams
|
|
|
|
|
require 'rex/java'
|
2016-07-15 16:01:21 -05:00
|
|
|
# Library for creating C-style Structs
|
|
|
|
|
require 'rex/struct2'
|
2016-07-21 18:07:23 -05:00
|
|
|
# Library for working with OLE
|
|
|
|
|
require 'rex/ole'
|
2016-09-01 11:38:07 -05:00
|
|
|
# Library for creating and/or parsing MIME messages
|
|
|
|
|
require 'rex/mime'
|
2016-09-14 12:07:26 -05:00
|
|
|
# Library for polymorphic encoders
|
|
|
|
|
require 'rex/encoder'
|
|
|
|
|
# Architecture subsystem
|
|
|
|
|
require 'rex/arch'
|
2016-10-11 17:35:44 -05:00
|
|
|
# Exploit Helper Library
|
|
|
|
|
require 'rex/exploitation'
|
2016-07-05 10:33:45 -05:00
|
|
|
|
2005-06-04 08:23:16 +00:00
|
|
|
# Generic classes
|
2011-05-12 20:03:55 +00:00
|
|
|
require 'rex/file'
|
2005-07-17 00:52:47 +00:00
|
|
|
|
2011-05-12 20:03:55 +00:00
|
|
|
# Thread safety and synchronization
|
|
|
|
|
require 'rex/sync'
|
2005-07-10 20:49:13 +00:00
|
|
|
|
2011-05-12 20:03:55 +00:00
|
|
|
# Assembly
|
|
|
|
|
require 'rex/assembly/nasm'
|
2005-06-03 04:51:51 +00:00
|
|
|
|
2011-05-12 20:03:55 +00:00
|
|
|
# Logging
|
|
|
|
|
require 'rex/logging/log_dispatcher'
|
2005-06-04 08:23:16 +00:00
|
|
|
|
2011-05-12 20:03:55 +00:00
|
|
|
# IO
|
|
|
|
|
require 'rex/io/stream'
|
|
|
|
|
require 'rex/io/stream_abstraction'
|
|
|
|
|
require 'rex/io/stream_server'
|
2005-12-13 06:08:40 +00:00
|
|
|
|
2011-05-12 20:03:55 +00:00
|
|
|
# Sockets
|
|
|
|
|
require 'rex/socket'
|
2005-12-13 06:08:40 +00:00
|
|
|
|
2011-05-12 20:03:55 +00:00
|
|
|
# Compatibility
|
|
|
|
|
require 'rex/compat'
|
2011-05-11 23:28:12 +00:00
|
|
|
|
2021-01-28 10:35:25 +00:00
|
|
|
# SSLScan
|
2013-02-11 17:08:14 -06:00
|
|
|
require 'rex/sslscan/scanner'
|
|
|
|
|
require 'rex/sslscan/result'
|
|
|
|
|
|
2021-02-17 12:33:59 +00:00
|
|
|
# Versions
|
|
|
|
|
require 'rex/version'
|
|
|
|
|
|
2005-09-16 03:29:11 +00:00
|
|
|
# Overload the Kernel.sleep() function to be thread-safe
|
2024-02-01 15:32:08 +00:00
|
|
|
Kernel.class_eval(<<-EOF, __FILE__, __LINE__ + 1)
|
2012-09-11 11:20:03 -04:00
|
|
|
def sleep(seconds=nil)
|
2005-09-16 03:29:11 +00:00
|
|
|
Rex::ThreadSafe.sleep(seconds)
|
|
|
|
|
end
|
2024-02-01 15:32:08 +00:00
|
|
|
EOF
|
2005-09-16 03:29:11 +00:00
|
|
|
|
2005-09-27 05:31:48 +00:00
|
|
|
# Overload the Kernel.select function to be thread-safe
|
2024-02-01 15:32:08 +00:00
|
|
|
Kernel.class_eval(<<-EOF, __FILE__, __LINE__ + 1)
|
2005-09-27 05:31:48 +00:00
|
|
|
def select(rfd = nil, wfd = nil, efd = nil, to = nil)
|
|
|
|
|
Rex::ThreadSafe.select(rfd, wfd, efd, to)
|
|
|
|
|
end
|
2024-02-01 15:32:08 +00:00
|
|
|
EOF
|
2024-05-29 15:03:24 -05:00
|
|
|
|
|
|
|
|
# Add the deprecated File.exists? method to call non-deprecated File.exist?
|
|
|
|
|
File.class_eval(<<-EOF, __FILE__, __LINE__ + 1)
|
|
|
|
|
def File.exists?(fname)
|
|
|
|
|
File.exist?(fname)
|
|
|
|
|
end
|
|
|
|
|
EOF
|