ronin-support 0.1.0.pre1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.document +4 -0
- data/.rspec +1 -0
- data/.yardopts +1 -0
- data/COPYING.txt +504 -0
- data/ChangeLog.md +4 -0
- data/Gemfile +23 -0
- data/README.md +98 -0
- data/Rakefile +29 -0
- data/gemspec.yml +20 -0
- data/lib/ronin/extensions.rb +28 -0
- data/lib/ronin/extensions/file.rb +63 -0
- data/lib/ronin/extensions/ip_addr.rb +220 -0
- data/lib/ronin/extensions/kernel.rb +45 -0
- data/lib/ronin/extensions/meta.rb +22 -0
- data/lib/ronin/extensions/meta/object.rb +24 -0
- data/lib/ronin/extensions/string.rb +200 -0
- data/lib/ronin/formatting.rb +26 -0
- data/lib/ronin/formatting/binary.rb +22 -0
- data/lib/ronin/formatting/digest.rb +22 -0
- data/lib/ronin/formatting/extensions.rb +25 -0
- data/lib/ronin/formatting/extensions/binary.rb +24 -0
- data/lib/ronin/formatting/extensions/binary/file.rb +35 -0
- data/lib/ronin/formatting/extensions/binary/integer.rb +147 -0
- data/lib/ronin/formatting/extensions/binary/string.rb +363 -0
- data/lib/ronin/formatting/extensions/digest.rb +23 -0
- data/lib/ronin/formatting/extensions/digest/file.rb +117 -0
- data/lib/ronin/formatting/extensions/digest/string.rb +80 -0
- data/lib/ronin/formatting/extensions/http.rb +23 -0
- data/lib/ronin/formatting/extensions/http/integer.rb +57 -0
- data/lib/ronin/formatting/extensions/http/string.rb +102 -0
- data/lib/ronin/formatting/extensions/text.rb +23 -0
- data/lib/ronin/formatting/extensions/text/array.rb +125 -0
- data/lib/ronin/formatting/extensions/text/string.rb +206 -0
- data/lib/ronin/formatting/http.rb +22 -0
- data/lib/ronin/formatting/text.rb +22 -0
- data/lib/ronin/network.rb +29 -0
- data/lib/ronin/network/esmtp.rb +22 -0
- data/lib/ronin/network/extensions.rb +29 -0
- data/lib/ronin/network/extensions/esmtp.rb +22 -0
- data/lib/ronin/network/extensions/esmtp/net.rb +100 -0
- data/lib/ronin/network/extensions/http.rb +22 -0
- data/lib/ronin/network/extensions/http/net.rb +661 -0
- data/lib/ronin/network/extensions/imap.rb +22 -0
- data/lib/ronin/network/extensions/imap/net.rb +124 -0
- data/lib/ronin/network/extensions/pop3.rb +22 -0
- data/lib/ronin/network/extensions/pop3/net.rb +92 -0
- data/lib/ronin/network/extensions/smtp.rb +22 -0
- data/lib/ronin/network/extensions/smtp/net.rb +110 -0
- data/lib/ronin/network/extensions/ssl.rb +22 -0
- data/lib/ronin/network/extensions/ssl/net.rb +147 -0
- data/lib/ronin/network/extensions/tcp.rb +22 -0
- data/lib/ronin/network/extensions/tcp/net.rb +304 -0
- data/lib/ronin/network/extensions/telnet.rb +22 -0
- data/lib/ronin/network/extensions/telnet/net.rb +156 -0
- data/lib/ronin/network/extensions/udp.rb +22 -0
- data/lib/ronin/network/extensions/udp/net.rb +226 -0
- data/lib/ronin/network/http.rb +24 -0
- data/lib/ronin/network/http/exceptions.rb +22 -0
- data/lib/ronin/network/http/exceptions/unknown_request.rb +29 -0
- data/lib/ronin/network/http/http.rb +290 -0
- data/lib/ronin/network/http/proxy.rb +307 -0
- data/lib/ronin/network/imap.rb +49 -0
- data/lib/ronin/network/network.rb +41 -0
- data/lib/ronin/network/pop3.rb +49 -0
- data/lib/ronin/network/smtp.rb +24 -0
- data/lib/ronin/network/smtp/email.rb +143 -0
- data/lib/ronin/network/smtp/smtp.rb +68 -0
- data/lib/ronin/network/ssl.rb +47 -0
- data/lib/ronin/network/tcp.rb +22 -0
- data/lib/ronin/network/telnet.rb +109 -0
- data/lib/ronin/network/udp.rb +22 -0
- data/lib/ronin/path.rb +132 -0
- data/lib/ronin/support.rb +28 -0
- data/lib/ronin/support/inflector.rb +40 -0
- data/lib/ronin/support/version.rb +27 -0
- data/lib/ronin/templates.rb +23 -0
- data/lib/ronin/templates/erb.rb +75 -0
- data/lib/ronin/templates/template.rb +161 -0
- data/ronin-support.gemspec +10 -0
- data/spec/extensions/file_spec.rb +24 -0
- data/spec/extensions/ip_addr_spec.rb +171 -0
- data/spec/extensions/kernel_spec.rb +30 -0
- data/spec/extensions/string_spec.rb +177 -0
- data/spec/formatting/binary/helpers/hexdumps.rb +16 -0
- data/spec/formatting/binary/helpers/hexdumps/ascii.bin +0 -0
- data/spec/formatting/binary/helpers/hexdumps/hexdump_decimal_shorts.txt +17 -0
- data/spec/formatting/binary/helpers/hexdumps/hexdump_hex_bytes.txt +17 -0
- data/spec/formatting/binary/helpers/hexdumps/hexdump_hex_shorts.txt +17 -0
- data/spec/formatting/binary/helpers/hexdumps/hexdump_octal_bytes.txt +17 -0
- data/spec/formatting/binary/helpers/hexdumps/hexdump_octal_shorts.txt +17 -0
- data/spec/formatting/binary/helpers/hexdumps/hexdump_repeated.txt +6 -0
- data/spec/formatting/binary/helpers/hexdumps/od_decimal_bytes.txt +17 -0
- data/spec/formatting/binary/helpers/hexdumps/od_decimal_ints.txt +17 -0
- data/spec/formatting/binary/helpers/hexdumps/od_decimal_quads.txt +17 -0
- data/spec/formatting/binary/helpers/hexdumps/od_decimal_shorts.txt +17 -0
- data/spec/formatting/binary/helpers/hexdumps/od_hex_bytes.txt +17 -0
- data/spec/formatting/binary/helpers/hexdumps/od_hex_ints.txt +17 -0
- data/spec/formatting/binary/helpers/hexdumps/od_hex_quads.txt +17 -0
- data/spec/formatting/binary/helpers/hexdumps/od_hex_shorts.txt +17 -0
- data/spec/formatting/binary/helpers/hexdumps/od_octal_bytes.txt +17 -0
- data/spec/formatting/binary/helpers/hexdumps/od_octal_ints.txt +17 -0
- data/spec/formatting/binary/helpers/hexdumps/od_octal_quads.txt +17 -0
- data/spec/formatting/binary/helpers/hexdumps/od_octal_shorts.txt +17 -0
- data/spec/formatting/binary/helpers/hexdumps/od_repeated.txt +6 -0
- data/spec/formatting/binary/helpers/hexdumps/repeated.bin +1 -0
- data/spec/formatting/binary/integer_spec.rb +140 -0
- data/spec/formatting/binary/string_spec.rb +306 -0
- data/spec/formatting/digest/string_spec.rb +82 -0
- data/spec/formatting/http/integer_spec.rb +42 -0
- data/spec/formatting/http/string_spec.rb +76 -0
- data/spec/formatting/text/array_spec.rb +105 -0
- data/spec/formatting/text/string_spec.rb +180 -0
- data/spec/network/http/http_spec.rb +280 -0
- data/spec/network/http/proxy_spec.rb +150 -0
- data/spec/network/network_spec.rb +8 -0
- data/spec/network/ssl_spec.rb +14 -0
- data/spec/path_spec.rb +84 -0
- data/spec/spec_helper.rb +4 -0
- data/spec/support_spec.rb +8 -0
- data/spec/templates/classes/example_erb.rb +11 -0
- data/spec/templates/classes/example_template.rb +35 -0
- data/spec/templates/erb_spec.rb +21 -0
- data/spec/templates/helpers/data.rb +9 -0
- data/spec/templates/helpers/data/includes/_relative.erb +1 -0
- data/spec/templates/helpers/data/templates/example.erb +1 -0
- data/spec/templates/template_spec.rb +54 -0
- metadata +286 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Ronin - A Ruby platform for exploit development and security research.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2006-2010 Hal Brodigan (postmodern.mod3 at gmail.com)
|
|
5
|
+
#
|
|
6
|
+
# This library is free software; you can redistribute it and/or
|
|
7
|
+
# modify it under the terms of the GNU Lesser General Public
|
|
8
|
+
# License as published by the Free Software Foundation; either
|
|
9
|
+
# version 2.1 of the License, or (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# This library is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14
|
+
# Lesser General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU Lesser General Public
|
|
17
|
+
# License along with this library; if not, write to the Free Software
|
|
18
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
19
|
+
# Boston, MA 02110-1301 USA
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
module Kernel
|
|
23
|
+
#
|
|
24
|
+
# Calls the given block and ignores any raised exceptions.
|
|
25
|
+
#
|
|
26
|
+
# @yield []
|
|
27
|
+
# The block to be called.
|
|
28
|
+
#
|
|
29
|
+
# @return [Object, nil]
|
|
30
|
+
# The return-value of the given block. If `nil` is returned, an
|
|
31
|
+
# exception occurred and was ignored.
|
|
32
|
+
#
|
|
33
|
+
# @example
|
|
34
|
+
# attempt do
|
|
35
|
+
# Resolv.getaddress('might.not.exist.com')
|
|
36
|
+
# end
|
|
37
|
+
#
|
|
38
|
+
def attempt
|
|
39
|
+
begin
|
|
40
|
+
yield() if block_given?
|
|
41
|
+
rescue Exception
|
|
42
|
+
return nil
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Ronin - A Ruby platform for exploit development and security research.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2006-2010 Hal Brodigan (postmodern.mod3 at gmail.com)
|
|
5
|
+
#
|
|
6
|
+
# This library is free software; you can redistribute it and/or
|
|
7
|
+
# modify it under the terms of the GNU Lesser General Public
|
|
8
|
+
# License as published by the Free Software Foundation; either
|
|
9
|
+
# version 2.1 of the License, or (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# This library is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14
|
+
# Lesser General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU Lesser General Public
|
|
17
|
+
# License along with this library; if not, write to the Free Software
|
|
18
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
19
|
+
# Boston, MA 02110-1301 USA
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
require 'ronin/extensions/meta/object'
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# metaprogramming assistant -- metaid.rb
|
|
2
|
+
class Object # :nodoc:
|
|
3
|
+
# The hidden singleton lurks behind everyone
|
|
4
|
+
def metaclass; class << self; self; end; end
|
|
5
|
+
def meta_eval(&blk); metaclass.instance_eval(&blk); end
|
|
6
|
+
|
|
7
|
+
# A class_eval version of meta_eval
|
|
8
|
+
def metaclass_eval(&blk); metaclass.class_eval(&blk); end
|
|
9
|
+
|
|
10
|
+
# A class_def version of meta_def
|
|
11
|
+
def metaclass_def(name, &blk)
|
|
12
|
+
metaclass_eval { define_method(name, &blk) }
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Adds methods to a metaclass
|
|
16
|
+
def meta_def(name, &blk)
|
|
17
|
+
meta_eval { define_method(name, &blk) }
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Defines an instance method within a class
|
|
21
|
+
def class_def(name, &blk)
|
|
22
|
+
class_eval { define_method(name, &blk) }
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Ronin - A Ruby platform for exploit development and security research.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2006-2010 Hal Brodigan (postmodern.mod3 at gmail.com)
|
|
5
|
+
#
|
|
6
|
+
# This library is free software; you can redistribute it and/or
|
|
7
|
+
# modify it under the terms of the GNU Lesser General Public
|
|
8
|
+
# License as published by the Free Software Foundation; either
|
|
9
|
+
# version 2.1 of the License, or (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# This library is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14
|
+
# Lesser General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU Lesser General Public
|
|
17
|
+
# License along with this library; if not, write to the Free Software
|
|
18
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
19
|
+
# Boston, MA 02110-1301 USA
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
class String
|
|
23
|
+
|
|
24
|
+
#
|
|
25
|
+
# Enumerates over every sub-string within the string.
|
|
26
|
+
#
|
|
27
|
+
# @param [Integer] min
|
|
28
|
+
# Minimum length of each sub-string.
|
|
29
|
+
#
|
|
30
|
+
# @yield [substring,(index)]
|
|
31
|
+
# The given block will receive every sub-string contained within the
|
|
32
|
+
# string. If the block accepts two arguments, then the index of
|
|
33
|
+
# the sub-string will also be passed in.
|
|
34
|
+
#
|
|
35
|
+
# @yieldparam [String] substring
|
|
36
|
+
# A sub-string from the string.
|
|
37
|
+
#
|
|
38
|
+
# @yieldparam [Integer] index
|
|
39
|
+
# The optional index of the sub-string.
|
|
40
|
+
#
|
|
41
|
+
# @return [String]
|
|
42
|
+
# The original string
|
|
43
|
+
#
|
|
44
|
+
def each_substring(min=0,&block)
|
|
45
|
+
return enum_for(:each_substring,min) unless block
|
|
46
|
+
|
|
47
|
+
(0..(self.length - min)).each do |i|
|
|
48
|
+
((i + min)..self.length).each do |j|
|
|
49
|
+
sub_string = self[i...j]
|
|
50
|
+
|
|
51
|
+
if block.arity == 2
|
|
52
|
+
block.call(sub_string,i)
|
|
53
|
+
else
|
|
54
|
+
block.call(sub_string)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
return self
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
#
|
|
63
|
+
# Enumerates over the unique sub-strings contained in the string.
|
|
64
|
+
#
|
|
65
|
+
# @param [Integer] min
|
|
66
|
+
# Minimum length of each unique sub-string.
|
|
67
|
+
#
|
|
68
|
+
# @yield [substring,(index)]
|
|
69
|
+
# The given block will receive every unique sub-string contained
|
|
70
|
+
# within the string. If the block accepts two arguments, then the
|
|
71
|
+
# index of the unique sub-string will also be passed in.
|
|
72
|
+
#
|
|
73
|
+
# @yieldparam [String] substring
|
|
74
|
+
# A unique sub-string from the string.
|
|
75
|
+
#
|
|
76
|
+
# @yieldparam [Integer] index
|
|
77
|
+
# The optional index of the unique sub-string.
|
|
78
|
+
#
|
|
79
|
+
# @return [String]
|
|
80
|
+
# The original string
|
|
81
|
+
#
|
|
82
|
+
# @see each_substring
|
|
83
|
+
#
|
|
84
|
+
def each_unique_substring(min=0,&block)
|
|
85
|
+
return enum_for(:each_unique_substring,min) unless block
|
|
86
|
+
|
|
87
|
+
unique_strings = {}
|
|
88
|
+
|
|
89
|
+
each_substring(min) do |sub_string,index|
|
|
90
|
+
unless unique_strings.has_key?(sub_string)
|
|
91
|
+
unique_strings[sub_string] = index
|
|
92
|
+
|
|
93
|
+
if block.arity == 2
|
|
94
|
+
block.call(sub_string,index)
|
|
95
|
+
else
|
|
96
|
+
block.call(sub_string)
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
return self
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
#
|
|
105
|
+
# Returns the common prefix of the string and the specified other
|
|
106
|
+
# string. If no common prefix can be found an empty string will be
|
|
107
|
+
# returned.
|
|
108
|
+
#
|
|
109
|
+
def common_prefix(other)
|
|
110
|
+
min_length = [length, other.length].min
|
|
111
|
+
|
|
112
|
+
min_length.times do |i|
|
|
113
|
+
if self[i] != other[i]
|
|
114
|
+
return self[0...i]
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
return self[0...min_length]
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
#
|
|
122
|
+
# Returns the common postfix of the string and the specified other
|
|
123
|
+
# string. If no common postfix can be found an empty string will be
|
|
124
|
+
# returned.
|
|
125
|
+
#
|
|
126
|
+
def common_postfix(other)
|
|
127
|
+
min_length = [length, other.length].min
|
|
128
|
+
|
|
129
|
+
(min_length - 1).times do |i|
|
|
130
|
+
index = (length - i - 1)
|
|
131
|
+
other_index = (other.length - i - 1)
|
|
132
|
+
|
|
133
|
+
if self[index] != other[other_index]
|
|
134
|
+
return self[(index + 1)..-1]
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
return ''
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
#
|
|
142
|
+
# Returns the uncommon substring within the specified other string,
|
|
143
|
+
# which does not occur within the string. If no uncommon substring can be
|
|
144
|
+
# found, an empty string will be returned.
|
|
145
|
+
#
|
|
146
|
+
def uncommon_substring(other)
|
|
147
|
+
prefix = common_prefix(other)
|
|
148
|
+
postfix = self[prefix.length..-1].common_postfix(other[prefix.length..-1])
|
|
149
|
+
|
|
150
|
+
return self[prefix.length...(length - postfix.length)]
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
#
|
|
154
|
+
# Dumps the string as a C-style string.
|
|
155
|
+
#
|
|
156
|
+
# @return [String]
|
|
157
|
+
# The C-style encoded version of the String.
|
|
158
|
+
#
|
|
159
|
+
# @example
|
|
160
|
+
# "hello\x00\073\x90\r\n".dump
|
|
161
|
+
# # => "hello\0;\x90\r\n"
|
|
162
|
+
#
|
|
163
|
+
def dump
|
|
164
|
+
c_string = ''
|
|
165
|
+
|
|
166
|
+
each_byte do |b|
|
|
167
|
+
c_string << case b
|
|
168
|
+
when 0x00
|
|
169
|
+
"\\0"
|
|
170
|
+
when 0x07
|
|
171
|
+
"\\a"
|
|
172
|
+
when 0x08
|
|
173
|
+
"\\b"
|
|
174
|
+
when 0x09
|
|
175
|
+
"\\t"
|
|
176
|
+
when 0x0a
|
|
177
|
+
"\\n"
|
|
178
|
+
when 0x0b
|
|
179
|
+
"\\v"
|
|
180
|
+
when 0x0c
|
|
181
|
+
"\\f"
|
|
182
|
+
when 0x0d
|
|
183
|
+
"\\r"
|
|
184
|
+
when 0x22
|
|
185
|
+
"\\\""
|
|
186
|
+
when 0x5c
|
|
187
|
+
"\\\\"
|
|
188
|
+
when (0x20..0x7e)
|
|
189
|
+
b.chr
|
|
190
|
+
else
|
|
191
|
+
("\\x%.2x" % b)
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
return "\"#{c_string}\""
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
alias inspect dump
|
|
199
|
+
|
|
200
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Ronin - A Ruby platform for exploit development and security research.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2006-2010 Hal Brodigan (postmodern.mod3 at gmail.com)
|
|
5
|
+
#
|
|
6
|
+
# This library is free software; you can redistribute it and/or
|
|
7
|
+
# modify it under the terms of the GNU Lesser General Public
|
|
8
|
+
# License as published by the Free Software Foundation; either
|
|
9
|
+
# version 2.1 of the License, or (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# This library is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14
|
+
# Lesser General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU Lesser General Public
|
|
17
|
+
# License along with this library; if not, write to the Free Software
|
|
18
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
19
|
+
# Boston, MA 02110-1301 USA
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
require 'ronin/formatting/extensions'
|
|
23
|
+
require 'ronin/formatting/digest'
|
|
24
|
+
require 'ronin/formatting/binary'
|
|
25
|
+
require 'ronin/formatting/text'
|
|
26
|
+
require 'ronin/formatting/http'
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Ronin - A Ruby platform for exploit development and security research.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2006-2010 Hal Brodigan (postmodern.mod3 at gmail.com)
|
|
5
|
+
#
|
|
6
|
+
# This library is free software; you can redistribute it and/or
|
|
7
|
+
# modify it under the terms of the GNU Lesser General Public
|
|
8
|
+
# License as published by the Free Software Foundation; either
|
|
9
|
+
# version 2.1 of the License, or (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# This library is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14
|
+
# Lesser General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU Lesser General Public
|
|
17
|
+
# License along with this library; if not, write to the Free Software
|
|
18
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
19
|
+
# Boston, MA 02110-1301 USA
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
require 'ronin/formatting/extensions/binary'
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Ronin - A Ruby platform for exploit development and security research.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2006-2010 Hal Brodigan (postmodern.mod3 at gmail.com)
|
|
5
|
+
#
|
|
6
|
+
# This library is free software; you can redistribute it and/or
|
|
7
|
+
# modify it under the terms of the GNU Lesser General Public
|
|
8
|
+
# License as published by the Free Software Foundation; either
|
|
9
|
+
# version 2.1 of the License, or (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# This library is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14
|
+
# Lesser General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU Lesser General Public
|
|
17
|
+
# License along with this library; if not, write to the Free Software
|
|
18
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
19
|
+
# Boston, MA 02110-1301 USA
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
require 'ronin/formatting/extensions/digest'
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Ronin - A Ruby platform for exploit development and security research.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2006-2010 Hal Brodigan (postmodern.mod3 at gmail.com)
|
|
5
|
+
#
|
|
6
|
+
# This library is free software; you can redistribute it and/or
|
|
7
|
+
# modify it under the terms of the GNU Lesser General Public
|
|
8
|
+
# License as published by the Free Software Foundation; either
|
|
9
|
+
# version 2.1 of the License, or (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# This library is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14
|
+
# Lesser General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU Lesser General Public
|
|
17
|
+
# License along with this library; if not, write to the Free Software
|
|
18
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
19
|
+
# Boston, MA 02110-1301 USA
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
require 'ronin/formatting/extensions/binary'
|
|
23
|
+
require 'ronin/formatting/extensions/text'
|
|
24
|
+
require 'ronin/formatting/extensions/digest'
|
|
25
|
+
require 'ronin/formatting/extensions/http'
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Ronin - A Ruby platform for exploit development and security research.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2006-2010 Hal Brodigan (postmodern.mod3 at gmail.com)
|
|
5
|
+
#
|
|
6
|
+
# This library is free software; you can redistribute it and/or
|
|
7
|
+
# modify it under the terms of the GNU Lesser General Public
|
|
8
|
+
# License as published by the Free Software Foundation; either
|
|
9
|
+
# version 2.1 of the License, or (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# This library is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14
|
+
# Lesser General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU Lesser General Public
|
|
17
|
+
# License along with this library; if not, write to the Free Software
|
|
18
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
19
|
+
# Boston, MA 02110-1301 USA
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
require 'ronin/formatting/extensions/binary/integer'
|
|
23
|
+
require 'ronin/formatting/extensions/binary/string'
|
|
24
|
+
require 'ronin/formatting/extensions/binary/file'
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Ronin - A Ruby platform for exploit development and security research.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2006-2010 Hal Brodigan (postmodern.mod3 at gmail.com)
|
|
5
|
+
#
|
|
6
|
+
# This library is free software; you can redistribute it and/or
|
|
7
|
+
# modify it under the terms of the GNU Lesser General Public
|
|
8
|
+
# License as published by the Free Software Foundation; either
|
|
9
|
+
# version 2.1 of the License, or (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# This library is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14
|
+
# Lesser General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU Lesser General Public
|
|
17
|
+
# License along with this library; if not, write to the Free Software
|
|
18
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
19
|
+
# Boston, MA 02110-1301 USA
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
require 'ronin/formatting/extensions/binary/string'
|
|
23
|
+
|
|
24
|
+
class File
|
|
25
|
+
|
|
26
|
+
#
|
|
27
|
+
# Converts the hexdump at the given path back into raw-data.
|
|
28
|
+
#
|
|
29
|
+
# @see String#unhexdump.
|
|
30
|
+
#
|
|
31
|
+
def File.unhexdump(path,options={})
|
|
32
|
+
File.read(path).unhexdump(options)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|