public
Description: Ronin Exploits is a Ruby library for Ronin that provides exploitation and payload crafting functionality.
Homepage: http://ronin.rubyforge.org/exploits/
Clone URL: git://github.com/postmodern/ronin-exploits.git
ronin-exploits / README.txt
100644 276 lines (202 sloc) 7.565 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
= Ronin Exploits
 
* http://ronin.rubyforge.org/exploits/
* http://github.com/postmodern/ronin-exploits
* http://github.com/postmodern/ronin-exploits/issues
* http://groups.google.com/group/ronin-ruby
* irc.freenode.net #ronin
 
== DESCRIPTION:
 
Ronin Exploits is a Ruby library for Ronin that provides exploitation and
payload crafting functionality.
 
Ronin is a Ruby platform for exploit development and security research.
Ronin allows for the rapid development and distribution of code, exploits
or payloads over many common Source-Code-Management (SCM) systems.
 
=== Ruby
 
Ronin's Ruby environment allows security researchers to leverage Ruby with
ease. The Ruby environment contains a multitude of convenience methods
for working with data in Ruby, a Ruby Object Database, a customized Ruby
Console and an extendable command-line interface.
 
=== Extend
 
Ronin's more specialized features are provided by additional Ronin
libraries, which users can choose to install. These libraries can allow
one to write and run Exploits and Payloads, scan for PHP vulnerabilities,
perform Google Dorks or run 3rd party scanners.
 
=== Publish
 
Ronin allows users to publish and share code, exploits, payloads or other
data via Overlays. Overlays are directories of code and data that can be
hosted on any SVN, Hg, Git or Rsync server. Ronin makes it easy to create,
install or update Overlays.
 
== FEATURES:
 
* Ability to define Payloads based on:
  * Contributing authors.
  * Behaviors they control.
  * Helpers they use.
* Ability to define Payload Encoders:
  * Architectures they target.
  * OSes they target.
* Ability to define Exploits based on:
  * Whether they are local or remote.
  * Protocol they use.
  * Contributing authors.
  * Behaviors they control.
  * Disclosure status.
  * Level of weaponization.
  * Architectures they target.
  * OSes they target.
  * Products they target.
  * Helpers they use.
* Provides a simple three phase process of building, verifying and
  deploying Exploits and Payloads.
* Allows adding arbitrary target data to the targets of Exploits.
* Allows combining Payloads with Exploits.
* Allows using a raw-payload with an Exploit.
* Allows the addition of multiple Payload Encoders to an Exploit.
* Allows chaining multiple Payloads together.
* Provides a multitude of exploit and payload generators which can create
  customized skeleton Ruby Exploits and Payloads.
 
== SYNOPSIS:
 
* Generate a skeleton exploit, with some custom information:
 
    $ ronin-gen exploit exploit.rb --name Example \
                                   --controls command_exec \
--status proven \
--authors Postmodern \
--description "This is an example."
 
  * To generate other types of exploits, you can specify +local_exploit+,
    +remote_exploit+, +remote_tcp_exploit+, +remote_udp_exploit+,
    +ftp_exploit+, +http_exploit+ or +web_exploit+, instead of simply
    +exploit+.
 
* Generate a skeleton payload, with some custom information:
 
    $ ronin-gen payload payload.rb --name Example \
                                   --controls file_read file_write \
--authors Postmodern \
--description "This is an example."
 
  * To generate other types of payloads, you can specify +binary_payload+,
    +shellcode+ or +nops+, instead of simply +payload+.
 
* List available payloads:
 
    $ ronin-payloads
 
* Print information about a payload:
 
    $ ronin-payloads -n NAME -v
 
* Build and output a payload:
 
    $ ronin-payload NAME
 
* Build and output a raw unescaped payload:
 
    $ ronin-payload NAME --raw
 
* Load a payload from a file, then build and output it:
 
    $ ronin-payload -f FILE
 
* List available exploits:
 
    $ ronin-exploits
 
* Print information about an exploit:
 
    $ ronin-exploits -n NAME -v
 
* Build and deploy an exploit:
 
    $ ronin-exploit -n NAME --host example.com --port 9999
 
* Load an exploit from a file, then build and deploy it:
 
    $ ronin-exploit -f FILE --host example.com --port 9999
 
* Build and deploy an exploit, with a payload:
 
    $ ronin-exploit -n NAME --host example.com --port 9999 -P PAYLOAD_NAME
 
* Build and deploy an exploit, with a raw payload:
 
    $ ronin-exploit -n NAME --host example.com --port 9999 \
                    --raw-payload \
`echo -en "\x66\x31\xc0\xfe\xc0\xb3\xff\xcd\x80"`
 
== EXAMPLES:
 
* Define a shellcode payload:
 
    ronin_shellcode do
      #
      # Cacheable data.
      #
      cache do
        self.name = 'test'
        self.version = '0.5'
        self.description = %{This is an example shellcode payload.}
 
        author(:name => 'Postmodern', :organization => 'SophSec')
 
        self.arch :i686
        self.os :name => 'Linux'
      end
 
      #
      # Configurable parameters.
      #
      parameter :exit_status,
                :default => 0,
                :description => 'Exit status of shellcode'
 
      #
      # Builds the assembly payload, which will call the SYS_EXIT
      # syscall with the exit_status of the shellcode.
      #
      def build
        @payload = "\x66\x31\xc0\xfe\xc0"
 
        unless @exit_status == 0
          @payload << "\xb3#{@exit_status.chr}"
        else
          @payload << "\x66\x31\xdb"
        end
 
        @payload << "\xcd\x80"
        return @payload
      end
    end
 
* Define a payload encoder:
 
    ronin_payload_encoder do
      #
      # Cacheable data.
      #
      cache do
        self.name = 'base64_encode'
        self.description = %{Example base64 payload encoder}
 
        self.arch :i686
        self.os :name => 'Linux'
      end
 
      #
      # Base64 encodes the specified _data_.
      #
      def encode(data)
        return data.to_s.base64_encode
      end
    end
 
* Define a remote TCP exploit:
 
    ronin_remote_tcp_exploit do
      helper :buffer_overflow
 
      #
      # Cacheable data.
      #
      cache do
        self.name = 'test'
        self.description = %{This is an example exploit.}
 
        self.status = :potential
        self.disclosure = [:in_wild, :public]
 
        author(:name => 'Postmodern', :organization => 'SophSec')
 
        controlling :code_exec
 
        targeting do |target|
          target.arch :i686
          target.os :name => 'Linux'
          target.product :name => 'ExampleWare', :version => '2.4.7b'
        end
      end
 
      #
      # Builds the exploit.
      #
      def build
        @buffer = "USER #{build_buffer}\n"
      end
 
      #
      # Deploys the built exploit.
      #
      def deploy
        tcp_send @buffer
      end
    end
 
== REQUIREMENTS:
 
* {ronin}[http://ronin.rubyforge.org/] >= 0.3.0
* {ronin-gen}[http://ronin.rubyforge.org/gen/] >= 0.2.0
 
== INSTALL:
 
  $ sudo gem install ronin-exploits
 
== LICENSE:
 
Ronin Exploits - A Ruby library for Ronin that provides exploitation and
payload crafting functionality.
 
Copyright (c) 2007-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
 
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA