-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Expand file tree
/
Copy pathrex.rb
More file actions
94 lines (79 loc) · 2.37 KB
/
rex.rb
File metadata and controls
94 lines (79 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# -*- coding: binary -*-
module Rex
Root = File.join(File.expand_path(File.dirname(__FILE__)), 'rex')
LogSource = "rex"
# library for creating Powershell scripts for exploitation purposes
autoload :Powershell, 'rex/powershell'
# Library for working with OLE
autoload :OLE, 'rex/ole'
# Library for creating and/or parsing MIME messages
autoload :MIME, 'rex/mime'
# Exploit Helper Library
autoload :Exploitation, 'rex/exploitation'
# Binary parsing tools (PE, ELF, Mach-O)
autoload :BinTools, 'rex/bin_tools'
autoload :PeParsey, 'rex/peparsey'
autoload :PeScan, 'rex/pescan'
autoload :ElfParsey, 'rex/elfparsey'
autoload :ElfScan, 'rex/elfscan'
autoload :MachParsey, 'rex/machparsey'
autoload :MachScan, 'rex/machscan'
autoload :ImageSource, 'rex/image_source'
# SSLScan
autoload :SSLScan, 'rex/sslscan/scanner'
end
#
# REX Gems
#
# 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 processing and creating Zip compatible archives
require 'rex/zip'
# Library for parsing offline Windows Registry files
require 'rex/registry'
# Library for parsing Java serialized streams
require 'rex/java'
# Library for creating C-style Structs
require 'rex/struct2'
# Library for polymorphic encoders
require 'rex/encoder'
# Architecture subsystem
require 'rex/arch'
# Generic classes
require 'rex/file'
# Thread safety and synchronization
require 'rex/sync'
# Assembly
require 'rex/assembly/nasm'
# Logging
require 'rex/logging/log_dispatcher'
# IO
require 'rex/io/stream'
require 'rex/io/stream_abstraction'
require 'rex/io/stream_server'
# Sockets
require 'rex/socket'
# Compatibility
require 'rex/compat'
# Versions
require 'rex/version'
# Overload the Kernel.sleep() function to be thread-safe
Kernel.class_eval(<<-EOF, __FILE__, __LINE__ + 1)
def sleep(seconds=nil)
Rex::ThreadSafe.sleep(seconds)
end
EOF
# Overload the Kernel.select function to be thread-safe
Kernel.class_eval(<<-EOF, __FILE__, __LINE__ + 1)
def select(rfd = nil, wfd = nil, efd = nil, to = nil)
Rex::ThreadSafe.select(rfd, wfd, efd, to)
end
EOF
# 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