ronin-gen 0.1.1 → 0.2.0
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.tar.gz.sig +0 -0
- data/History.txt +14 -0
- data/Manifest.txt +4 -4
- data/README.txt +32 -30
- data/Rakefile +11 -1
- data/bin/ronin-gen +2 -2
- data/bin/ronin-gen-extension +1 -1
- data/bin/ronin-gen-overlay +1 -1
- data/lib/ronin/generators.rb +0 -2
- data/lib/ronin/generators/dir_generator.rb +38 -7
- data/lib/ronin/generators/generator.rb +93 -88
- data/lib/ronin/generators/platform/extension.rb +7 -11
- data/lib/ronin/generators/platform/overlay.rb +91 -106
- data/lib/ronin/generators/platform/static.rb +0 -2
- data/lib/ronin/generators/version.rb +1 -3
- data/lib/ronin/ui/command_line/commands/gen.rb +8 -19
- data/lib/ronin/ui/command_line/commands/gen_extension.rb +1 -24
- data/lib/ronin/ui/command_line/commands/gen_overlay.rb +1 -65
- data/spec/generated_overlay_examples.rb +6 -0
- data/spec/generators/classes/dir_generator.rb +2 -4
- data/spec/generators/classes/file_generator.rb +4 -4
- data/spec/generators/classes/templated_generator.rb +3 -7
- data/spec/generators/classes/touch_generator.rb +1 -3
- data/spec/generators/generator_spec.rb +8 -10
- data/spec/generators/helpers/static/generators/templated.txt.erb +1 -1
- data/spec/generators/platform/extension_spec.rb +1 -4
- data/spec/generators/platform/overlay_spec.rb +2 -4
- data/spec/spec_helper.rb +1 -1
- data/spec/ui/command_line/commands/gen_extension_spec.rb +1 -1
- data/spec/ui/command_line/commands/gen_overlay_spec.rb +4 -4
- data/static/ronin/generators/platform/Rakefile.erb +5 -0
- data/static/ronin/{platform/generators → generators/platform}/extension.rb +0 -0
- data/static/ronin/{platform/generators → generators/platform}/spec/spec_helper.rb +1 -1
- data/tasks/spec.rb +1 -0
- data/tasks/yard.rb +13 -0
- metadata +33 -14
- metadata.gz.sig +0 -0
- data/TODO.txt +0 -3
- data/lib/ronin/generators/platform/spec.rb +0 -46
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
=== 0.2.0 / 2009-09-24
|
2
|
+
|
3
|
+
* Require ronin >= 0.3.0.
|
4
|
+
* Require rspec >= 1.2.8.
|
5
|
+
* Require yard >= 0.2.3.5.
|
6
|
+
* Updated the project summary and 3-point description of Ronin Gen.
|
7
|
+
* Moved to YARD based documentation.
|
8
|
+
* Refactored Ronin::Generators::Generator to inherit from Thor.
|
9
|
+
* Refactored Ronin::Generators::DirGenerator.
|
10
|
+
* Refactored Ronin::Generators::Platform::Extension.
|
11
|
+
* Refactored Ronin::Generators::Platform::Overlay.
|
12
|
+
* Rewrote the Ronin::UI::CommandLine generator commands to simply inherit
|
13
|
+
from the new Thor based generator classes within Ronin::Generators.
|
14
|
+
|
1
15
|
=== 0.1.1 / 2009-07-02
|
2
16
|
|
3
17
|
* Use Hoe >= 2.0.0.
|
data/Manifest.txt
CHANGED
@@ -3,7 +3,6 @@ COPYING.txt
|
|
3
3
|
Manifest.txt
|
4
4
|
README.txt
|
5
5
|
Rakefile
|
6
|
-
TODO.txt
|
7
6
|
bin/ronin-gen
|
8
7
|
bin/ronin-gen-overlay
|
9
8
|
bin/ronin-gen-extension
|
@@ -14,12 +13,12 @@ lib/ronin/generators/version.rb
|
|
14
13
|
lib/ronin/generators/platform/static.rb
|
15
14
|
lib/ronin/generators/platform/overlay.rb
|
16
15
|
lib/ronin/generators/platform/extension.rb
|
17
|
-
lib/ronin/generators/platform/spec.rb
|
18
16
|
lib/ronin/generators/platform/extension.rb
|
19
17
|
lib/ronin/ui/command_line/commands/gen.rb
|
20
18
|
lib/ronin/ui/command_line/commands/gen_overlay.rb
|
21
19
|
lib/ronin/ui/command_line/commands/gen_extension.rb
|
22
20
|
tasks/spec.rb
|
21
|
+
tasks/yard.rb
|
23
22
|
spec/spec_helper.rb
|
24
23
|
spec/generated_overlay_examples.rb
|
25
24
|
spec/generated_extension_examples.rb
|
@@ -35,5 +34,6 @@ spec/generators/platform/overlay_spec.rb
|
|
35
34
|
spec/generators/platform/extension_spec.rb
|
36
35
|
spec/ui/command_line/commands/gen_overlay_spec.rb
|
37
36
|
spec/ui/command_line/commands/gen_extension_spec.rb
|
38
|
-
static/ronin/platform/
|
39
|
-
static/ronin/
|
37
|
+
static/ronin/generators/platform/Rakefile.erb
|
38
|
+
static/ronin/generators/platform/extension.rb
|
39
|
+
static/ronin/generators/platform/spec/spec_helper.rb
|
data/README.txt
CHANGED
@@ -2,61 +2,63 @@
|
|
2
2
|
|
3
3
|
* http://ronin.rubyforge.org/gen/
|
4
4
|
* http://github.com/postmodern/ronin-gen
|
5
|
-
* irc.freenode.net
|
5
|
+
* irc.freenode.net #ronin
|
6
6
|
* Postmodern (postmodern.mod3 at gmail.com)
|
7
7
|
|
8
8
|
== DESCRIPTION:
|
9
9
|
|
10
10
|
Ronin Gen is a Ruby library for Ronin that provides various generators.
|
11
11
|
|
12
|
-
Ronin is a Ruby platform
|
13
|
-
|
14
|
-
|
12
|
+
Ronin is a Ruby platform for exploit development and security research.
|
13
|
+
Ronin allows for the rapid development and distribution of code, exploits
|
14
|
+
or payloads over many common Source-Code-Management (SCM) systems.
|
15
15
|
|
16
|
-
===
|
16
|
+
=== Ruby
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
commercial software.
|
18
|
+
Ronin's Ruby environment allows security researchers to leverage Ruby with
|
19
|
+
ease. The Ruby environment contains a multitude of convenience methods
|
20
|
+
for working with data in Ruby, a Ruby Object Database, a customized Ruby
|
21
|
+
Console and an extendable command-line interface.
|
23
22
|
|
24
|
-
===
|
23
|
+
=== Extend
|
25
24
|
|
26
|
-
Ronin
|
27
|
-
|
28
|
-
|
25
|
+
Ronin's more specialized features are provided by additional Ronin
|
26
|
+
libraries, which users can choose to install. These libraries can allow
|
27
|
+
one to write and run Exploits and Payloads, scan for PHP vulnerabilities,
|
28
|
+
perform Google Dorks or run 3rd party scanners.
|
29
29
|
|
30
|
-
===
|
30
|
+
=== Publish
|
31
31
|
|
32
|
-
Ronin
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
users to form their own communities, independent of the main developers
|
37
|
-
of Ronin.
|
32
|
+
Ronin allows users to publish and share code, exploits, payloads or other
|
33
|
+
data via Overlays. Overlays are directories of code and data that can be
|
34
|
+
hosted on any SVN, Hg, Git or Rsync server. Ronin makes it easy to create,
|
35
|
+
install or update Overlays.
|
38
36
|
|
39
37
|
== FEATURES:
|
40
38
|
|
39
|
+
* Provides {Ronin::Generators::Generator}, a Thor based generator class that
|
40
|
+
can be used to create new generators.
|
41
|
+
* Provides {Ronin::Generators::DirGenerator}, a Thor based generator that
|
42
|
+
can be used to create new directory generators.
|
41
43
|
* Generators for Overlays and Extensions.
|
42
44
|
|
43
|
-
==
|
45
|
+
== SYNOPSIS:
|
44
46
|
|
45
|
-
*
|
47
|
+
* Generate a skeleton Overlay:
|
46
48
|
|
47
|
-
|
49
|
+
$ ronin-gen overlay PATH [options]
|
48
50
|
|
49
|
-
|
51
|
+
* Generate a skeleton Extension:
|
50
52
|
|
51
|
-
|
53
|
+
$ ronin-gen extension PATH
|
52
54
|
|
53
|
-
|
55
|
+
== REQUIREMENTS:
|
54
56
|
|
55
|
-
|
57
|
+
* {ronin}[http://ronin.rubyforge.org/] >= 0.3.0
|
56
58
|
|
57
|
-
|
59
|
+
== INSTALL:
|
58
60
|
|
59
|
-
$ ronin-gen
|
61
|
+
$ sudo gem install ronin-gen
|
60
62
|
|
61
63
|
== LICENSE:
|
62
64
|
|
data/Rakefile
CHANGED
@@ -4,12 +4,22 @@ require 'rubygems'
|
|
4
4
|
require 'hoe'
|
5
5
|
require 'hoe/signing'
|
6
6
|
require './tasks/spec.rb'
|
7
|
+
require './tasks/yard.rb'
|
7
8
|
|
8
9
|
Hoe.spec('ronin-gen') do
|
9
10
|
self.rubyforge_name = 'ronin'
|
10
11
|
self.developer('Postmodern', 'postmodern.mod3@gmail.com')
|
11
12
|
self.remote_rdoc_dir = 'docs/ronin-gen'
|
12
|
-
self.extra_deps = [
|
13
|
+
self.extra_deps = [
|
14
|
+
['ronin', '>=0.3.0']
|
15
|
+
]
|
16
|
+
|
17
|
+
self.extra_dev_deps = [
|
18
|
+
['rspec', '>=1.2.8'],
|
19
|
+
['yard', '>=0.2.3.5']
|
20
|
+
]
|
21
|
+
|
22
|
+
self.spec_extras = {:has_rdoc => 'yard'}
|
13
23
|
end
|
14
24
|
|
15
25
|
# vim: syntax=Ruby
|
data/bin/ronin-gen
CHANGED
@@ -13,7 +13,7 @@ require 'ronin/ui/command_line'
|
|
13
13
|
if (ARGV.length > 0 && ARGV.first[0..0] != '-')
|
14
14
|
ARGV[0] = "gen_#{ARGV.first}"
|
15
15
|
|
16
|
-
Ronin::UI::CommandLine.
|
16
|
+
Ronin::UI::CommandLine.start
|
17
17
|
else
|
18
|
-
Ronin::UI::CommandLine::Commands::Gen.
|
18
|
+
Ronin::UI::CommandLine::Commands::Gen.start
|
19
19
|
end
|
data/bin/ronin-gen-extension
CHANGED
data/bin/ronin-gen-overlay
CHANGED
data/lib/ronin/generators.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
#
|
2
|
-
#--
|
3
2
|
# Ronin Gen - A Ruby library for Ronin that provides various generators.
|
4
3
|
#
|
5
4
|
# Copyright (c) 2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
@@ -17,7 +16,6 @@
|
|
17
16
|
# You should have received a copy of the GNU General Public License
|
18
17
|
# along with this program; if not, write to the Free Software
|
19
18
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
20
|
-
#++
|
21
19
|
#
|
22
20
|
|
23
21
|
require 'ronin/generators/generator'
|
@@ -1,5 +1,4 @@
|
|
1
1
|
#
|
2
|
-
#--
|
3
2
|
# Ronin Gen - A Ruby library for Ronin that provides various generators.
|
4
3
|
#
|
5
4
|
# Copyright (c) 2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
@@ -17,24 +16,56 @@
|
|
17
16
|
# You should have received a copy of the GNU General Public License
|
18
17
|
# along with this program; if not, write to the Free Software
|
19
18
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
20
|
-
#++
|
21
19
|
#
|
22
20
|
|
23
21
|
require 'ronin/generators/generator'
|
24
22
|
|
23
|
+
require 'fileutils'
|
24
|
+
|
25
25
|
module Ronin
|
26
26
|
module Generators
|
27
27
|
class DirGenerator < Generator
|
28
28
|
|
29
|
+
argument :path, :type => :string, :require => true
|
30
|
+
|
31
|
+
#
|
32
|
+
# Invokes the generator.
|
33
|
+
#
|
34
|
+
# @param [String] path
|
35
|
+
# The directory to generate within.
|
36
|
+
#
|
37
|
+
# @param [Hash] options
|
38
|
+
# Additional command-line options for the generator.
|
29
39
|
#
|
30
|
-
#
|
31
|
-
# generator.
|
40
|
+
# @param [Array] arguments
|
41
|
+
# Additional command-line arguments for the generator.
|
32
42
|
#
|
33
|
-
|
43
|
+
# @example
|
44
|
+
# gen.generate('path/to/dir')
|
45
|
+
#
|
46
|
+
def self.generate(path,options={},arguments=[])
|
34
47
|
path = File.expand_path(path)
|
35
|
-
FileUtils.mkdir_p(path)
|
36
48
|
|
37
|
-
|
49
|
+
generator = self.new([path] + arguments, options)
|
50
|
+
generator.invoke()
|
51
|
+
end
|
52
|
+
|
53
|
+
no_tasks do
|
54
|
+
#
|
55
|
+
# Invokes the tasks of the generator.
|
56
|
+
#
|
57
|
+
# @param [Array] names
|
58
|
+
# The task names to invoke.
|
59
|
+
#
|
60
|
+
def invoke(*names,&block)
|
61
|
+
if self.path
|
62
|
+
self.destination_root = self.path
|
63
|
+
end
|
64
|
+
|
65
|
+
inside() do |path|
|
66
|
+
super(*names,&block)
|
67
|
+
end
|
68
|
+
end
|
38
69
|
end
|
39
70
|
|
40
71
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
#
|
2
|
-
#--
|
3
2
|
# Ronin Gen - A Ruby library for Ronin that provides various generators.
|
4
3
|
#
|
5
4
|
# Copyright (c) 2009 Hal Brodigan (postmodern.mod3 at example.com)
|
@@ -17,141 +16,147 @@
|
|
17
16
|
# You should have received a copy of the GNU General Public License
|
18
17
|
# along with this program; if not, write to the Free Software
|
19
18
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
20
|
-
#++
|
21
19
|
#
|
22
20
|
|
21
|
+
require 'ronin/templates/template'
|
23
22
|
require 'ronin/static/finders'
|
24
|
-
require 'ronin/templates/erb'
|
25
23
|
|
26
|
-
require '
|
24
|
+
require 'extlib'
|
25
|
+
require 'erb'
|
26
|
+
require 'thor'
|
27
27
|
|
28
28
|
module Ronin
|
29
29
|
module Generators
|
30
|
-
class Generator
|
30
|
+
class Generator < Thor::Group
|
31
31
|
|
32
|
+
include Thor::Actions
|
33
|
+
include Templates::Template
|
32
34
|
include Static::Finders
|
33
|
-
include Templates::Erb
|
34
35
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
def run(path)
|
39
|
-
path = File.expand_path(path)
|
40
|
-
@path = path
|
41
|
-
|
42
|
-
generate!
|
43
|
-
|
44
|
-
@path = nil
|
45
|
-
return path
|
36
|
+
def self.inherited(super_class)
|
37
|
+
class_name = super_class.name.split('::').last.snake_case
|
38
|
+
super_class.namespace("ronin #{class_name}")
|
46
39
|
end
|
47
40
|
|
48
|
-
protected
|
49
|
-
|
50
41
|
#
|
51
|
-
#
|
42
|
+
# Defines the default source root of the generator as the current
|
43
|
+
# working directory.
|
52
44
|
#
|
53
|
-
|
45
|
+
# @since 0.2.0
|
46
|
+
#
|
47
|
+
def self.source_root
|
48
|
+
Dir.pwd
|
54
49
|
end
|
55
50
|
|
56
51
|
#
|
57
|
-
#
|
58
|
-
# the +path+ instance variable.
|
52
|
+
# Invokes the generator.
|
59
53
|
#
|
60
|
-
|
61
|
-
|
62
|
-
return File.expand_path(File.join(@path,sub_path))
|
63
|
-
end
|
64
|
-
|
54
|
+
# @param [Hash] options
|
55
|
+
# Class options to use with the generator.
|
65
56
|
#
|
66
|
-
#
|
57
|
+
# @param [Array] arguments
|
58
|
+
# Additional arguments for the generator.
|
67
59
|
#
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
60
|
+
# @example
|
61
|
+
# gen.generate
|
62
|
+
#
|
63
|
+
# @since 0.2.0
|
64
|
+
#
|
65
|
+
def self.generate(options={},arguments=[])
|
66
|
+
generator = self.new(arguments, options)
|
67
|
+
generator.invoke()
|
75
68
|
end
|
76
69
|
|
70
|
+
desc "default generator task"
|
71
|
+
|
77
72
|
#
|
78
|
-
#
|
73
|
+
# Default generator method.
|
79
74
|
#
|
80
|
-
#
|
75
|
+
# @since 0.2.0
|
81
76
|
#
|
82
|
-
def
|
83
|
-
FileUtils.touch(expand_path(sub_path))
|
84
|
-
|
85
|
-
print_path(sub_path)
|
86
|
-
return sub_path
|
77
|
+
def generate
|
87
78
|
end
|
88
79
|
|
80
|
+
protected
|
81
|
+
|
89
82
|
#
|
90
|
-
#
|
91
|
-
# it will be passed a newly created File object.
|
83
|
+
# Touches a file.
|
92
84
|
#
|
93
|
-
#
|
94
|
-
#
|
95
|
-
# end
|
85
|
+
# @param [String] destination
|
86
|
+
# The relative path to the file to touch.
|
96
87
|
#
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
88
|
+
# @example
|
89
|
+
# touch 'TODO.txt'
|
90
|
+
#
|
91
|
+
# @since 0.2.0
|
92
|
+
#
|
93
|
+
def touch(destination)
|
94
|
+
create_file(destination)
|
102
95
|
end
|
103
96
|
|
104
97
|
#
|
105
|
-
# Creates
|
106
|
-
# given, it will be passed the _sub_path_ after the directory has
|
107
|
-
# been created.
|
98
|
+
# Creates an empty directory.
|
108
99
|
#
|
109
|
-
#
|
110
|
-
#
|
100
|
+
# @param [String] destination
|
101
|
+
# The relative path of the directory to create.
|
111
102
|
#
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
103
|
+
# @example
|
104
|
+
# directory 'sub/dir'
|
105
|
+
#
|
106
|
+
# @since 0.2.0
|
107
|
+
#
|
108
|
+
def mkdir(destination)
|
109
|
+
empty_directory(destination)
|
118
110
|
end
|
119
111
|
|
120
112
|
#
|
121
|
-
# Copies
|
113
|
+
# Copies a static-file.
|
122
114
|
#
|
123
|
-
#
|
124
|
-
#
|
115
|
+
# @param [String] static_file
|
116
|
+
# The relative path to the static file.
|
125
117
|
#
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
FileUtils.cp(static_file,expand_path(sub_path))
|
130
|
-
|
131
|
-
print_path(sub_path)
|
132
|
-
return sub_path
|
133
|
-
end
|
134
|
-
|
118
|
+
# @param [String] destination
|
119
|
+
# The destination to copy the static file to.
|
135
120
|
#
|
136
|
-
#
|
121
|
+
# @example
|
122
|
+
# copy_file 'ronin/platform/generators/extension.rb',
|
123
|
+
# 'myext/extension.rb'
|
137
124
|
#
|
138
|
-
#
|
139
|
-
# # => "..."
|
125
|
+
# @since 0.2.0
|
140
126
|
#
|
141
|
-
def
|
142
|
-
|
127
|
+
def copy_file(static_file,destination)
|
128
|
+
super(find_static_file(static_file),destination)
|
143
129
|
end
|
144
130
|
|
145
131
|
#
|
146
|
-
# Renders the ERB template
|
147
|
-
#
|
132
|
+
# Renders the ERB template at the specified _template_path_ and
|
133
|
+
# saves the result at the given _destination_.
|
134
|
+
#
|
135
|
+
# @param [String] template_path
|
136
|
+
# The relative path to the template.
|
137
|
+
#
|
138
|
+
# @param [String, nil] destination
|
139
|
+
# The destination to write the result of the rendered template to.
|
140
|
+
#
|
141
|
+
# @return [nil, String]
|
142
|
+
# If destination is +nil+, the result of the rendered template
|
143
|
+
# will be returned.
|
144
|
+
#
|
145
|
+
# @example
|
146
|
+
# template 'ronin/platform/generators/Rakefile.erb', 'Rakefile.erb'
|
147
|
+
#
|
148
|
+
# @example
|
149
|
+
# template '_helpers.erb'
|
148
150
|
#
|
149
|
-
#
|
150
|
-
# # => nil
|
151
|
+
# @since 0.2.0
|
151
152
|
#
|
152
|
-
def
|
153
|
-
|
154
|
-
|
153
|
+
def template(template_path,destination=nil)
|
154
|
+
enter_template(template_path) do |path|
|
155
|
+
if destination
|
156
|
+
super(path,destination)
|
157
|
+
else
|
158
|
+
ERB.new(File.read(path)).result(binding).chomp
|
159
|
+
end
|
155
160
|
end
|
156
161
|
end
|
157
162
|
|