ronin 1.0.0.pre2 → 1.0.0.pre3

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/ChangeLog.md CHANGED
@@ -1,3 +1,82 @@
1
+ ### 1.0.0 / 2011-02-01
2
+
3
+ * Require Ruby >= 1.8.7.
4
+ * Require i18n ~> 0.4.1.
5
+ * Require tzinfo ~> 0.3.22.
6
+ * Require activesupport ~> 3.0.0.
7
+ * Require dm-do-adapter ~> 1.0.2.
8
+ * Require dm-sqlite-adapter ~> 1.0.2.
9
+ * Require dm-core ~> 1.0.2.
10
+ * Require dm-types ~> 1.0.2.
11
+ * Require dm-constraints ~> 1.0.2.
12
+ * Require dm-migrations ~> 1.0.2.
13
+ * Require dm-validations ~> 1.0.2.
14
+ * Require dm-serializer ~> 1.0.2.
15
+ * Require dm-aggregates ~> 1.0.2.
16
+ * Require dm-timestamps ~> 1.0.2.
17
+ * Require dm-tags ~> 1.0.2.
18
+ * Require dm-is-predefined ~> 0.3.0.
19
+ * Require uri-query_params ~> 0.5.2.
20
+ * Require open_namespace ~> 0.3.0.
21
+ * Require parameters ~> 0.2.3.
22
+ * Require data_paths ~> 0.2.1.
23
+ * Require contextify ~> 0.2.0.
24
+ * Require pullr ~> 0.1.2.
25
+ * Require thor ~> 0.14.3.
26
+ * Require ripl ~> 0.2.0.
27
+ * Require ripl-multi_line ~> 0.2.0.
28
+ * Require ripl-auto_indent ~> 0.1.0.
29
+ * Require ripl-short_errors ~> 0.1.0.
30
+ * Require ripl-color_result ~> 0.2.0.
31
+ * Require ronin-support ~> 0.1.0.
32
+ * Require bundler ~> 1.0.0.
33
+ * Require rspec ~> 2.0.0.
34
+ * Require yard ~> 0.6.4.
35
+ * Added `ronin/bootstrap` which only loads configuration and the Database.
36
+ * Added {Ronin::Database::Migrations}.
37
+ * Added {Ronin::Address}:
38
+ * Added {Ronin::MACAddress}.
39
+ * Added {Ronin::IPAddress}.
40
+ * Added {Ronin::HostName}.
41
+ * Added {Ronin::Port}:
42
+ * Added {Ronin::TCPPort}.
43
+ * Added {Ronin::UDPPort}.
44
+ * Added {Ronin::Service}.
45
+ * Added {Ronin::OpenPort}.
46
+ * Added {Ronin::OSGuess}.
47
+ * Added {Ronin::UserName}.
48
+ * Added {Ronin::URL}:
49
+ * Added {Ronin::URLScheme}.
50
+ * Added {Ronin::URLQueryParam}.
51
+ * Added {Ronin::EmailAddress}.
52
+ * Added {Ronin::Credential}.
53
+ * Added {Ronin::ServiceCredential}.
54
+ * Added {Ronin::WebCredential}.
55
+ * Added {Ronin::Organization}.
56
+ * Added {Ronin::Campaign}.
57
+ * Added {Ronin::Target}.
58
+ * Added {Ronin::Engine}.
59
+ * Added {Ronin::UI::Output::Terminal::Raw}.
60
+ * Added {Ronin::UI::Output::Terminal::Color}.
61
+ * Renamed `Ronin::Product` to {Ronin::Software}.
62
+ * Renamed `Ronin::UI::CommandLine` to {Ronin::UI::CLI}.
63
+ * Renamed `Ronin::Platform::Overlay` to {Ronin::Repository}.
64
+ * Renamed `Ronin::Platform::CachedFile` to {Ronin::CachedFile}.
65
+ * Renamed `Ronin::Platform::Cacheable` to {Ronin::Model::Cacheable}.
66
+ * Removed `Ronin::Platform::Extension`.
67
+ * Removed `Ronin::Platform`.
68
+ * Switched from [Jeweler](https://github.com/technicalpickles/jeweler)
69
+ to [Ore](http://github.com/ruby-ore/ore) and [Bundler](http://gembundler.com).
70
+ * Use [OpenNamespace](http://github.com/postmodern/open_namespace) to auto-load
71
+ everything in the {Ronin} namespace.
72
+ * Switched from DataMapper auto-migrations to explicit-migrations.
73
+ * Switched {Ronin::UI::Console} from IRB to
74
+ [Ripl](https://github.com/cldwalker/ripl):
75
+ * Enabled result coloring with
76
+ [ripl-color_result](https://github.com/janlelis/ripl-color_result).
77
+ * Enabled short errors with
78
+ [ripl-short_error](https://github.com/janlelis/ripl-misc/blob/master/lib/ripl/short_errors.rb).
79
+
1
80
  ### 0.3.0 / 2009-09-24
2
81
 
3
82
  * Require yard >= 0.2.3.5.
data/Gemfile CHANGED
@@ -13,7 +13,7 @@ group :development do
13
13
  gem 'rake', '~> 0.8.7'
14
14
 
15
15
  platforms :jruby do
16
- gem 'maruku', '~> 0.6.0'
16
+ gem 'BlueCloth'
17
17
  end
18
18
 
19
19
  platforms :ruby do
@@ -24,7 +24,7 @@ group :development do
24
24
  gem 'dm-visualizer', '~> 0.1.0'
25
25
 
26
26
  gem 'ore-core', '~> 0.1.0'
27
- gem 'ore-tasks', '~> 0.2.0'
27
+ gem 'ore-tasks', '~> 0.3.0'
28
28
  gem 'rspec', '~> 2.0.0'
29
29
  end
30
30
 
data/gemspec.yml CHANGED
@@ -11,22 +11,28 @@ email: postmodern.mod3@gmail.com
11
11
  homepage: http://github.com/ronin-ruby/ronin
12
12
  has_yard: true
13
13
  post_install_message: |
14
- Thank you for installing Ronin, a Ruby platform for exploit development
15
- and security research. To list the available commands:
14
+ *************************************************************************
16
15
 
17
- $ ronin help
16
+ Thank you for installing Ronin, a Ruby platform for exploit development
17
+ and security research. To list the available commands:
18
18
 
19
- To jump into the Ronin Ruby Console:
19
+ $ ronin help
20
20
 
21
- $ ronin
21
+ To jump into the Ronin Ruby Console:
22
22
 
23
- Additional functionality can be added to Ronin by installing additional
24
- libraries:
23
+ $ ronin
25
24
 
26
- * ronin-asm * ronin-php
27
- * ronin-dorks * ronin-scanners
28
- * ronin-exploits * ronin-sql
29
- * ronin-gen * ronin-web
25
+ Additional functionality can be added to Ronin by installing additional
26
+ libraries:
27
+
28
+ * ronin-asm * ronin-php
29
+ * ronin-dorks * ronin-scanners
30
+ * ronin-exploits * ronin-sql
31
+ * ronin-gen * ronin-web
32
+
33
+ *************************************************************************
34
+
35
+ required_ruby_version: >= 1.8.7
30
36
 
31
37
  dependencies:
32
38
  i18n: ~> 0.4.1
@@ -61,11 +67,11 @@ dependencies:
61
67
  ripl-short_errors: ~> 0.1.0
62
68
  ripl-color_result: ~> 0.2.0
63
69
  # Ronin dependencies:
64
- ronin-support: ~> 0.1.0.pre
70
+ ronin-support: ~> 0.1.0.pre2
65
71
 
66
72
  development_dependencies:
67
73
  bundler: ~> 1.0.0
68
- yard: ~> 0.6.1
74
+ yard: ~> 0.6.4
69
75
  yard-contextify: ~> 0.1.0
70
76
  yard-parameters: ~> 0.1.0
71
77
  yard-dm: ~> 0.1.1
@@ -60,6 +60,21 @@ module Ronin
60
60
  all('addresses.address' => addr)
61
61
  end
62
62
 
63
+ #
64
+ # Searches for all campaigns targeting an {Organization}.
65
+ #
66
+ # @param [Array<String>, String] names
67
+ # The organization name(s) to search for.
68
+ #
69
+ # @return [Array<Campaign>]
70
+ # The campaigns that target the specified organizations.
71
+ #
72
+ # @since 1.0.0
73
+ #
74
+ def self.targeting_orgs(names)
75
+ all('organizations.name' => names)
76
+ end
77
+
63
78
  #
64
79
  # Determines if an address is targeted by the campaign.
65
80
  #
@@ -29,18 +29,66 @@ module Ronin
29
29
 
30
30
  include Model
31
31
 
32
- # The primary key of the email address
32
+ # The primary key of the email address.
33
33
  property :id, Serial
34
34
 
35
- # The user-name component of the email address
35
+ # The user-name component of the email address.
36
36
  belongs_to :user_name, :unique => :user_host
37
37
 
38
- # The host-name component of the email address
38
+ # The host-name component of the email address.
39
39
  belongs_to :host_name, :unique => :user_host
40
40
 
41
+ # Any IP addresses associated with the host name.
42
+ has 0..n, :ip_addresses, :through => :host_name
43
+
41
44
  # Tracks when the email address was created at.
42
45
  timestamps :created_at
43
46
 
47
+ #
48
+ # Searches for email addresses associated with the given host names.
49
+ #
50
+ # @param [Array<String>, String] names
51
+ # The host name(s) to search for.
52
+ #
53
+ # @return [Array<EmailAddress>]
54
+ # The matching email addresses.
55
+ #
56
+ # @since 1.0.0
57
+ #
58
+ def self.with_hosts(names)
59
+ all('host_name.address' => names)
60
+ end
61
+
62
+ #
63
+ # Searches for email addresses associated with the given IP address(es).
64
+ #
65
+ # @param [Array<String>, String] ips
66
+ # The IP address(es) to search for.
67
+ #
68
+ # @return [Array<EmailAddress>]
69
+ # The matching email addresses.
70
+ #
71
+ # @since 1.0.0
72
+ #
73
+ def self.with_ips(ips)
74
+ all('ip_addresses.address' => ips)
75
+ end
76
+
77
+ #
78
+ # Searches for email addresses associated with the given user names.
79
+ #
80
+ # @param [Array<String>, String] names
81
+ # The user name(s) to search for.
82
+ #
83
+ # @return [Array<EmailAddress>]
84
+ # The matching email addresses.
85
+ #
86
+ # @since 1.0.0
87
+ #
88
+ def self.with_users(names)
89
+ all('user_name.name' => names)
90
+ end
91
+
44
92
  #
45
93
  # Parses an email address.
46
94
  #
@@ -91,7 +91,7 @@ module Ronin
91
91
  #
92
92
  # To ensure that your sub-command is accessible to the `ronin`
93
93
  # command, make sure that the ruby file the sub-command is defined
94
- # within is in the `ronin/ui/command_line/commands` directory of a
94
+ # within is in the `ronin/ui/cli/commands` directory of a
95
95
  # Ronin library. If the sub-command class is named 'MyCommand'
96
96
  # it's ruby file must also be named 'my_command.rb'.
97
97
  #
@@ -174,11 +174,7 @@ module Ronin
174
174
  # @since 1.0.0
175
175
  #
176
176
  def self.banner
177
- if $0 == 'ronin'
178
- super
179
- else
180
- self.basename
181
- end
177
+ "ronin #{self_task.formatted_usage(self,false,true)}"
182
178
  end
183
179
 
184
180
  #
@@ -32,17 +32,18 @@ module Ronin
32
32
 
33
33
  self.model = Campaign
34
34
 
35
- query_option :name, :type => :string,
36
- :aliases => '-n',
37
- :method => :named
35
+ query_option :named, :type => :string,
36
+ :aliases => '-n'
38
37
 
39
- query_option :description, :type => :string, :aliases => '-d'
38
+ query_option :describing, :type => :string, :aliases => '-d'
40
39
 
41
- query_option :targeting, :type => :array, :aliases => '-T'
40
+ query_option :targeting, :type => :array,
41
+ :aliases => '-T',
42
+ :banner => 'ADDR [...]'
42
43
 
43
- query_option :organizations, :type => :array, :aliases => '-O' do |campaigns,orgs|
44
- campaigns.all('organizations.name' => orgs)
45
- end
44
+ query_option :targeting_orgs, :type => :array,
45
+ :aliases => '-O',
46
+ :banner => 'NAME [...]'
46
47
 
47
48
  class_option :list, :type => :boolean,
48
49
  :default => true,
@@ -34,15 +34,13 @@ module Ronin
34
34
 
35
35
  self.model = Credential
36
36
 
37
- query_option :user, :type => :string,
38
- :aliases => '-u',
39
- :banner => 'USER',
40
- :method => :for_user
37
+ query_option :for_user, :type => :string,
38
+ :aliases => '-u',
39
+ :banner => 'USER'
41
40
 
42
- query_option :password, :type => :string,
43
- :aliases => '-p',
44
- :banner => 'PASS',
45
- :method => :with_password
41
+ query_option :with_password, :type => :string,
42
+ :aliases => '-p',
43
+ :banner => 'PASS'
46
44
 
47
45
  class_option :list, :type => :boolean,
48
46
  :default => true,
@@ -32,21 +32,17 @@ module Ronin
32
32
 
33
33
  self.model = EmailAddress
34
34
 
35
- query_option :hosts, :type => :array, :aliases => '-H' do |emails,hosts|
36
- emails.all('host_name.address' => hosts)
37
- end
35
+ query_option :with_hosts, :type => :array,
36
+ :aliases => '-H',
37
+ :banner => 'HOST [...]'
38
38
 
39
- query_option :ip, :type => :array, :aliases => '-I' do |emails,ips|
40
- hosts.all('host_name.ip_addresses.address' => ips)
41
- end
39
+ query_option :with_ips, :type => :array,
40
+ :aliases => '-I',
41
+ :banner => 'IP [...]'
42
42
 
43
- query_option :ports, :type => :array, :aliases => '-p' do |emails,ports|
44
- emails.all('host_name.ports.number' => ports)
45
- end
46
-
47
- query_option :users, :type => :array, :aliases => '-u' do |emails,users|
48
- emails.all('user_name.name' => users)
49
- end
43
+ query_option :with_users, :type => :array,
44
+ :aliases => '-u',
45
+ :banner => 'NAME [...]'
50
46
 
51
47
  class_option :list, :type => :boolean,
52
48
  :default => true,
@@ -19,7 +19,7 @@
19
19
  #
20
20
 
21
21
  require 'ronin/ui/cli/command'
22
- require 'ronin/ui/cli/command_line'
22
+ require 'ronin/ui/cli/cli'
23
23
 
24
24
  module Ronin
25
25
  module UI
@@ -39,12 +39,12 @@ module Ronin
39
39
  def execute
40
40
  if self.command
41
41
  begin
42
- CommandLine.command(self.command).start(['--help'])
42
+ CLI.command(self.command).start(['--help'])
43
43
  rescue UnknownCommand
44
44
  print_error "unknown command #{command.dump}"
45
45
  end
46
46
  else
47
- print_array CommandLine.commands.keys.sort,
47
+ print_array CLI.commands.keys.sort,
48
48
  :title => 'Available commands'
49
49
  end
50
50
  end
@@ -21,6 +21,8 @@
21
21
  require 'ronin/ui/cli/command'
22
22
  require 'ronin/database'
23
23
 
24
+ require 'set'
25
+
24
26
  module Ronin
25
27
  module UI
26
28
  module CLI
@@ -46,13 +48,13 @@ module Ronin
46
48
  #
47
49
  # The query options for the command.
48
50
  #
49
- # @return [Hash]
51
+ # @return [Set]
50
52
  # The query options and their query method names.
51
53
  #
52
54
  # @since 1.0.0
53
55
  #
54
56
  def self.query_options
55
- @@query_options ||= {}
57
+ @query_options ||= Set[]
56
58
  end
57
59
 
58
60
  #
@@ -63,7 +65,7 @@ module Ronin
63
65
  def execute
64
66
  Database.setup
65
67
 
66
- print_query(new_query)
68
+ print_resources(query)
67
69
  end
68
70
 
69
71
  protected
@@ -92,53 +94,13 @@ module Ronin
92
94
  # @param [Hash] options
93
95
  # Additional options.
94
96
  #
95
- # @option options [Symbol] :method (name)
96
- # Custom query method name.
97
- #
98
97
  # @since 1.0.0
99
98
  #
100
- def self.query_option(name,options={},&block)
101
- self.query_options[name] = if block
102
- block
103
- elsif options[:method]
104
- options.delete(:method)
105
- else
106
- name
107
- end
108
-
99
+ def self.query_option(name,options={})
100
+ query_options << name
109
101
  class_option(name,options)
110
102
  end
111
103
 
112
- #
113
- # Performs a custom query.
114
- #
115
- # @param [DataMapper::Collection] query
116
- # The current query.
117
- #
118
- # @yield [query,*arguments]
119
- # The given block will be passed the current query to modify.
120
- #
121
- # @yieldparam [DataMapper::Collection] query
122
- # The current query.
123
- #
124
- # @yieldparam [Array] arguments
125
- # Optional arguments that will be passed to the block.
126
- #
127
- # @return [DataMapper::Collection]
128
- # The modified query.
129
- #
130
- # @since 1.0.0
131
- #
132
- def custom_query(query,arguments=[],&block)
133
- if block.arity == 1
134
- block.call(query)
135
- elsif block.arity == 2
136
- block.call(query,arguments)
137
- else
138
- block.call(query,*arguments)
139
- end
140
- end
141
-
142
104
  #
143
105
  # Invokes a query method on a query.
144
106
  #
@@ -158,7 +120,7 @@ module Ronin
158
120
  #
159
121
  def query_method(query,name,arguments=[])
160
122
  query_method = begin
161
- query.model.instance_method(name)
123
+ query.model.method(name)
162
124
  rescue NameError
163
125
  raise("Undefined query method #{query.model}.#{name}")
164
126
  end
@@ -187,24 +149,21 @@ module Ronin
187
149
  #
188
150
  # @since 1.0.0
189
151
  #
190
- def new_query(&block)
191
- query = self.class.model.all
152
+ def query
153
+ new_query = self.class.model.all
192
154
 
193
- self.class.query_options.each do |name,value|
194
- unless options[name].nil?
195
- query = if value.kind_of?(Proc)
196
- custom_query(query,options[name],&value)
197
- else
198
- query_method(query,name,options[name])
199
- end
155
+ self.class.ancestors.each do |ancestor|
156
+ if ancestor < ModelCommand
157
+ ancestor.query_options.each do |name|
158
+ unless options[name].nil?
159
+ new_query = query_method(new_query,name,options[name])
160
+ end
161
+ end
200
162
  end
201
163
  end
202
164
 
203
- if block
204
- query = custom_query(query,&block)
205
- end
206
-
207
- return query
165
+ new_query = yield(new_query) if block_given?
166
+ return new_query
208
167
  end
209
168
 
210
169
  #
@@ -220,24 +179,24 @@ module Ronin
220
179
  end
221
180
 
222
181
  #
223
- # Prints the resources in the query.
182
+ # Prints multiple resources.
224
183
  #
225
- # @param [DataMapper::Collection] query
184
+ # @param [DataMapper::Collection, Array<DataMapper::Resource>] resources
226
185
  # The query to print.
227
186
  #
228
187
  # @since 1.0.0
229
188
  #
230
- def print_query(query)
189
+ def print_resources(resources)
231
190
  if options.csv?
232
- print query.to_csv
191
+ print resources.to_csv
233
192
  elsif options.xml?
234
- print query.to_xml
193
+ print resources.to_xml
235
194
  elsif options.yaml?
236
- print query.to_yaml
195
+ print resources.to_yaml
237
196
  elsif options.json?
238
- print query.to_json
197
+ print resources.to_json
239
198
  else
240
- query.each { |resource| print_resource(resource) }
199
+ resources.each { |resource| print_resource(resource) }
241
200
  end
242
201
  end
243
202
 
data/lib/ronin/version.rb CHANGED
@@ -20,5 +20,5 @@
20
20
 
21
21
  module Ronin
22
22
  # Ronin version
23
- VERSION = '1.0.0.pre2'
23
+ VERSION = '1.0.0.pre3'
24
24
  end
@@ -33,7 +33,7 @@ describe Installation do
33
33
  }
34
34
 
35
35
  it "should enumerate over the files within a certain directory" do
36
- subject.each_file(directory).to_a.should == expected
36
+ subject.each_file(directory).to_a.should =~ expected
37
37
  end
38
38
 
39
39
  it "should return an Enumerator when no block is given" do
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 1
7
7
  - 0
8
8
  - 0
9
- - pre2
10
- version: 1.0.0.pre2
9
+ - pre3
10
+ version: 1.0.0.pre3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Postmodern
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-30 00:00:00 -08:00
18
+ date: 2010-12-31 00:00:00 -08:00
19
19
  default_executable: ronin
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -434,8 +434,8 @@ dependencies:
434
434
  - 0
435
435
  - 1
436
436
  - 0
437
- - pre
438
- version: 0.1.0.pre
437
+ - pre2
438
+ version: 0.1.0.pre2
439
439
  type: :runtime
440
440
  prerelease: false
441
441
  version_requirements: *id028
@@ -464,8 +464,8 @@ dependencies:
464
464
  segments:
465
465
  - 0
466
466
  - 6
467
- - 1
468
- version: 0.6.1
467
+ - 4
468
+ version: 0.6.4
469
469
  type: :development
470
470
  prerelease: false
471
471
  version_requirements: *id030
@@ -812,22 +812,26 @@ homepage: http://github.com/ronin-ruby/ronin
812
812
  licenses:
813
813
  - GPL-2
814
814
  post_install_message: |
815
- Thank you for installing Ronin, a Ruby platform for exploit development
816
- and security research. To list the available commands:
815
+ *************************************************************************
816
+
817
+ Thank you for installing Ronin, a Ruby platform for exploit development
818
+ and security research. To list the available commands:
817
819
 
818
- $ ronin help
820
+ $ ronin help
819
821
 
820
- To jump into the Ronin Ruby Console:
822
+ To jump into the Ronin Ruby Console:
821
823
 
822
- $ ronin
824
+ $ ronin
823
825
 
824
- Additional functionality can be added to Ronin by installing additional
825
- libraries:
826
+ Additional functionality can be added to Ronin by installing additional
827
+ libraries:
826
828
 
827
- * ronin-asm * ronin-php
828
- * ronin-dorks * ronin-scanners
829
- * ronin-exploits * ronin-sql
830
- * ronin-gen * ronin-web
829
+ * ronin-asm * ronin-php
830
+ * ronin-dorks * ronin-scanners
831
+ * ronin-exploits * ronin-sql
832
+ * ronin-gen * ronin-web
833
+
834
+ *************************************************************************
831
835
 
832
836
  rdoc_options: []
833
837
 
@@ -839,8 +843,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
839
843
  - - ">="
840
844
  - !ruby/object:Gem::Version
841
845
  segments:
842
- - 0
843
- version: "0"
846
+ - 1
847
+ - 8
848
+ - 7
849
+ version: 1.8.7
844
850
  required_rubygems_version: !ruby/object:Gem::Requirement
845
851
  none: false
846
852
  requirements: