ronin 1.0.0.pre4 → 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. data/.gemtest +0 -0
  2. data/ChangeLog.md +1 -0
  3. data/Gemfile +3 -1
  4. data/README.md +17 -19
  5. data/Rakefile +1 -0
  6. data/gemspec.yml +2 -1
  7. data/lib/ronin.rb +3 -0
  8. data/lib/ronin/address.rb +7 -3
  9. data/lib/ronin/arch.rb +2 -2
  10. data/lib/ronin/bootstrap.rb +3 -0
  11. data/lib/ronin/cached_file.rb +1 -1
  12. data/lib/ronin/campaign.rb +3 -32
  13. data/lib/ronin/class_methods.rb +17 -0
  14. data/lib/ronin/config.rb +25 -24
  15. data/lib/ronin/credential.rb +3 -0
  16. data/lib/ronin/database/migrations.rb +0 -1
  17. data/lib/ronin/database/migrations/create_credentials_table.rb +1 -2
  18. data/lib/ronin/database/migrations/graph.rb +6 -3
  19. data/lib/ronin/database/migrations/migration.rb +3 -0
  20. data/lib/ronin/database/migrations/migrations.rb +2 -2
  21. data/lib/ronin/email_address.rb +3 -0
  22. data/lib/ronin/engine/buildable.rb +3 -0
  23. data/lib/ronin/engine/class_methods.rb +3 -0
  24. data/lib/ronin/engine/deployable.rb +3 -0
  25. data/lib/ronin/engine/engine.rb +14 -0
  26. data/lib/ronin/engine/instance_methods.rb +3 -0
  27. data/lib/ronin/engine/verifiable.rb +3 -0
  28. data/lib/ronin/environment.rb +6 -0
  29. data/lib/ronin/host_name.rb +3 -0
  30. data/lib/ronin/host_name_ip_address.rb +3 -0
  31. data/lib/ronin/ip_address.rb +3 -0
  32. data/lib/ronin/ip_address_mac_address.rb +3 -0
  33. data/lib/ronin/license.rb +1 -1
  34. data/lib/ronin/mac_address.rb +3 -0
  35. data/lib/ronin/model/cacheable/cacheable.rb +1 -1
  36. data/lib/ronin/model/class_methods.rb +3 -0
  37. data/lib/ronin/model/has_authors/class_methods.rb +4 -0
  38. data/lib/ronin/model/has_authors/has_authors.rb +9 -5
  39. data/lib/ronin/model/has_description/class_methods.rb +4 -0
  40. data/lib/ronin/model/has_description/has_description.rb +6 -0
  41. data/lib/ronin/model/has_license/class_methods.rb +4 -0
  42. data/lib/ronin/model/has_license/has_license.rb +9 -5
  43. data/lib/ronin/model/has_name/class_methods.rb +4 -0
  44. data/lib/ronin/model/has_name/has_name.rb +6 -0
  45. data/lib/ronin/model/has_title/class_methods.rb +4 -0
  46. data/lib/ronin/model/has_title/has_title.rb +6 -0
  47. data/lib/ronin/model/has_unique_name.rb +7 -0
  48. data/lib/ronin/model/has_version/class_methods.rb +4 -0
  49. data/lib/ronin/model/has_version/has_version.rb +6 -0
  50. data/lib/ronin/model/model.rb +7 -0
  51. data/lib/ronin/model/types/description.rb +7 -2
  52. data/lib/ronin/open_port.rb +3 -0
  53. data/lib/ronin/organization.rb +3 -0
  54. data/lib/ronin/os.rb +2 -2
  55. data/lib/ronin/os_guess.rb +3 -0
  56. data/lib/ronin/password.rb +4 -1
  57. data/lib/ronin/port.rb +6 -1
  58. data/lib/ronin/ronin.rb +8 -0
  59. data/lib/ronin/service.rb +3 -0
  60. data/lib/ronin/service_credential.rb +3 -0
  61. data/lib/ronin/target.rb +3 -4
  62. data/lib/ronin/tcp_port.rb +4 -1
  63. data/lib/ronin/udp_port.rb +4 -1
  64. data/lib/ronin/ui/cli/cli.rb +1 -1
  65. data/lib/ronin/ui/cli/command.rb +6 -0
  66. data/lib/ronin/ui/cli/commands/repos.rb +33 -0
  67. data/lib/ronin/ui/cli/engine_command.rb +3 -0
  68. data/lib/ronin/ui/cli/model_command.rb +3 -0
  69. data/lib/ronin/ui/console.rb +5 -1
  70. data/lib/ronin/ui/hexdump/hexdump.rb +3 -0
  71. data/lib/ronin/ui/output/helpers.rb +59 -26
  72. data/lib/ronin/ui/output/output.rb +3 -0
  73. data/lib/ronin/ui/output/terminal/color.rb +32 -20
  74. data/lib/ronin/ui/output/terminal/raw.rb +23 -20
  75. data/lib/ronin/ui/shell.rb +3 -0
  76. data/lib/ronin/url.rb +8 -5
  77. data/lib/ronin/url_query_param.rb +3 -0
  78. data/lib/ronin/url_scheme.rb +3 -0
  79. data/lib/ronin/user_name.rb +4 -1
  80. data/lib/ronin/vendor.rb +1 -1
  81. data/lib/ronin/version.rb +1 -1
  82. data/lib/ronin/web_credential.rb +4 -1
  83. data/ronin.gemspec +7 -2
  84. data/spec/campaign_spec.rb +0 -25
  85. data/spec/url_spec.rb +5 -2
  86. metadata +48 -36
  87. data/lib/ronin/database/migrations/create_remote_files_table.rb +0 -52
  88. data/lib/ronin/proxy.rb +0 -178
  89. data/lib/ronin/proxy_credential.rb +0 -29
  90. data/lib/ronin/remote_file.rb +0 -152
@@ -24,6 +24,9 @@ require 'dm-migrations/migration'
24
24
  module Ronin
25
25
  module Database
26
26
  module Migrations
27
+ #
28
+ # Represents a Database Migration.
29
+ #
27
30
  class Migration < DataMapper::Migration
28
31
 
29
32
  # The dependencies of the migration
@@ -142,7 +142,7 @@ module Ronin
142
142
  # The database was successfully migrated up.
143
143
  #
144
144
  # @raise [UnknownMigration]
145
- # A migration had a dependencey on an unknown migration.
145
+ # A migration had a dependency on an unknown migration.
146
146
  #
147
147
  # @since 1.0.1
148
148
  #
@@ -167,7 +167,7 @@ module Ronin
167
167
  # The database was successfully migrated down.
168
168
  #
169
169
  # @raise [UnknownMigration]
170
- # A migration had a dependencey on an unknown migration.
170
+ # A migration had a dependency on an unknown migration.
171
171
  #
172
172
  # @since 1.0.1
173
173
  #
@@ -24,6 +24,9 @@ require 'ronin/model'
24
24
  require 'dm-timestamps'
25
25
 
26
26
  module Ronin
27
+ #
28
+ # Represents email addresses that can be stored in the {Database}.
29
+ #
27
30
  class EmailAddress
28
31
 
29
32
  include Model
@@ -22,6 +22,9 @@ require 'ronin/engine/verifiable'
22
22
 
23
23
  module Ronin
24
24
  module Engine
25
+ #
26
+ # Adds building methods to an {Engine}.
27
+ #
25
28
  module Buildable
26
29
  include Verifiable
27
30
 
@@ -19,6 +19,9 @@
19
19
 
20
20
  module Ronin
21
21
  module Engine
22
+ #
23
+ # Class methods for an {Engine}.
24
+ #
22
25
  module ClassMethods
23
26
  #
24
27
  # Finds and loads all matching Ronin Engines.
@@ -22,6 +22,9 @@ require 'ronin/engine/verifiable'
22
22
 
23
23
  module Ronin
24
24
  module Engine
25
+ #
26
+ # Adds deployment methods to an {Engine}.
27
+ #
25
28
  module Deployable
26
29
  include Verifiable
27
30
 
@@ -34,6 +34,20 @@ module Ronin
34
34
  module Engine
35
35
  include UI::Output::Helpers
36
36
 
37
+ #
38
+ # Adds the following to the Class.
39
+ #
40
+ # * {Engine::InstanceMethods}
41
+ # * {Model}
42
+ # * {Model::HasName}
43
+ # * {Model::HasDescription}
44
+ # * {Model::HasVersion}
45
+ # * {Model::HasLicense}
46
+ # * {Model::HasAuthors}
47
+ # * {Model::Cacheable}
48
+ # * [Parameters](http://rubydoc.info/gems/parameters)
49
+ # * {ClassMethods}
50
+ #
37
51
  def self.included(base)
38
52
  base.send :include, Engine::InstanceMethods,
39
53
  Model,
@@ -19,6 +19,9 @@
19
19
 
20
20
  module Ronin
21
21
  module Engine
22
+ #
23
+ # Instance methods for an {Engine}.
24
+ #
22
25
  module InstanceMethods
23
26
  #
24
27
  # Initializes the Ronin Engine.
@@ -21,6 +21,9 @@ require 'ronin/engine/exceptions/verification_failed'
21
21
 
22
22
  module Ronin
23
23
  module Engine
24
+ #
25
+ # Adds verification methods to an {Engine}.
26
+ #
24
27
  module Verifiable
25
28
  #
26
29
  # Initializes the verifiable engine.
@@ -17,6 +17,9 @@
17
17
  # along with Ronin. If not, see <http://www.gnu.org/licenses/>.
18
18
  #
19
19
 
20
+ #
21
+ # Loads all extensions to core Ruby classes.
22
+ #
20
23
  require 'ronin/ronin'
21
24
  require 'ronin/extensions'
22
25
  require 'ronin/formatting/extensions'
@@ -26,5 +29,8 @@ require 'ronin/ui/output/helpers'
26
29
 
27
30
  require 'chars/extensions'
28
31
 
32
+ #
33
+ # Includes the Ronin namespace and output helper methods.
34
+ #
29
35
  include Ronin
30
36
  include Ronin::UI::Output::Helpers
@@ -26,6 +26,9 @@ require 'ronin/model'
26
26
  require 'resolv'
27
27
 
28
28
  module Ronin
29
+ #
30
+ # Represents host names that can be stored in the {Database}.
31
+ #
29
32
  class HostName < Address
30
33
 
31
34
  # The IP Address associations
@@ -24,6 +24,9 @@ require 'ronin/model'
24
24
  require 'dm-timestamps'
25
25
 
26
26
  module Ronin
27
+ #
28
+ # Associates a {HostName} with an {IPAddress}.
29
+ #
27
30
  class HostNameIPAddress
28
31
 
29
32
  include Model
@@ -28,6 +28,9 @@ require 'ipaddr'
28
28
  require 'resolv'
29
29
 
30
30
  module Ronin
31
+ #
32
+ # Represents IP addresses that can be stored in the {Database}.
33
+ #
31
34
  class IPAddress < Address
32
35
 
33
36
  # The IP Address
@@ -24,6 +24,9 @@ require 'ronin/model'
24
24
  require 'dm-timestamps'
25
25
 
26
26
  module Ronin
27
+ #
28
+ # Associates an {IPAddress} with a {MACAddress}.
29
+ #
27
30
  class IPAddressMACAddress
28
31
 
29
32
  include Model
data/lib/ronin/license.rb CHANGED
@@ -111,7 +111,7 @@ module Ronin
111
111
  :description => 'GNU Lesser General Public License v3.0',
112
112
  :url => 'http://www.gnu.org/licenses/lgpl-3.0.txt'
113
113
 
114
- # The MIT "as-is" Licence
114
+ # The MIT "as-is" License
115
115
  predefine :mit,
116
116
  :name => 'MIT',
117
117
  :description => 'The MIT Licence',
@@ -22,6 +22,9 @@ require 'ronin/ip_address_mac_address'
22
22
  require 'ronin/model'
23
23
 
24
24
  module Ronin
25
+ #
26
+ # Represents MAC addresses that can be stored in the {Database}.
27
+ #
25
28
  class MACAddress < Address
26
29
 
27
30
  # The IP Addresses the MAC Address hosts
@@ -203,7 +203,7 @@ module Ronin
203
203
 
204
204
  #
205
205
  # Loads the code from the cached file for the object, and instance
206
- # evals it into the object.
206
+ # evaluates it into the object.
207
207
  #
208
208
  # @return [Boolean]
209
209
  # Indicates the original code was successfully loaded.
@@ -21,6 +21,9 @@ require 'ronin/support/inflector'
21
21
 
22
22
  module Ronin
23
23
  module Model
24
+ #
25
+ # Class methods that are added when {Model} is included into a class.
26
+ #
24
27
  module ClassMethods
25
28
  #
26
29
  # The default name to use when defining relationships with the
@@ -20,6 +20,10 @@
20
20
  module Ronin
21
21
  module Model
22
22
  module HasAuthors
23
+ #
24
+ # Class methods that are added when {HasAuthors} is included into a
25
+ # model.
26
+ #
23
27
  module ClassMethods
24
28
  #
25
29
  # Finds all resources associated with a given author.
@@ -24,22 +24,26 @@ require 'ronin/author'
24
24
  module Ronin
25
25
  module Model
26
26
  #
27
- # Adds an `authors` relation between a model and the `Ronin::Author`
28
- # model.
27
+ # Adds an `authors` relationship between a model and the {Author} model.
29
28
  #
30
29
  module HasAuthors
30
+ #
31
+ # Adds the `authors` relationship and {ClassMethods} to the model.
32
+ #
33
+ # @param [Class] base
34
+ # The model.
35
+ #
31
36
  def self.included(base)
32
37
  base.send :include, Model
33
38
  base.send :extend, ClassMethods
34
39
 
35
40
  base.module_eval do
36
41
  # The authors associated with the model.
37
- has 0..n, :authors, :through => DataMapper::Resource,
38
- :model => 'Ronin::Author'
42
+ has 0..n, :authors, Ronin::Author, :through => DataMapper::Resource
39
43
 
40
44
  Ronin::Author.has 0..n, self.relationship_name,
41
45
  :through => DataMapper::Resource,
42
- :model => self.name
46
+ :model => self
43
47
  end
44
48
  end
45
49
 
@@ -20,6 +20,10 @@
20
20
  module Ronin
21
21
  module Model
22
22
  module HasDescription
23
+ #
24
+ # Class methods that are added when {HasDescription} is included into
25
+ # a model.
26
+ #
23
27
  module ClassMethods
24
28
  #
25
29
  # Finds models with descriptions containing a given fragment of
@@ -27,6 +27,12 @@ module Ronin
27
27
  # Adds a `description` property to a model.
28
28
  #
29
29
  module HasDescription
30
+ #
31
+ # Adds the `description` property and {ClassMethods} to the model.
32
+ #
33
+ # @param [Class] base
34
+ # The model.
35
+ #
30
36
  def self.included(base)
31
37
  base.send :include, Model
32
38
  base.send :extend, ClassMethods
@@ -20,6 +20,10 @@
20
20
  module Ronin
21
21
  module Model
22
22
  module HasLicense
23
+ #
24
+ # Class methods that are added when {HasLicense} is included into a
25
+ # model.
26
+ #
23
27
  module ClassMethods
24
28
  #
25
29
  # Finds all models associated with a given license.
@@ -24,21 +24,25 @@ require 'ronin/license'
24
24
  module Ronin
25
25
  module Model
26
26
  #
27
- # Adds a `license` relation between a model and the {License} model.
27
+ # Adds a `license` relationship between a model and the {License} model.
28
28
  #
29
29
  module HasLicense
30
+ #
31
+ # Adds the `license` relationship and {ClassMethods} to the model.
32
+ #
33
+ # @param [Class] base
34
+ # The model.
35
+ #
30
36
  def self.included(base)
31
37
  base.send :include, Model
32
38
  base.send :extend, ClassMethods
33
39
 
34
40
  base.module_eval do
35
41
  # The license
36
- belongs_to :license, :required => false,
37
- :model => 'Ronin::License'
42
+ belongs_to :license, Ronin::License, :required => false
38
43
 
44
+ Ronin::License.has 0..n, self.relationship_name, :model => self
39
45
  end
40
-
41
- License.has License.n, base.relationship_name, :model => base.name
42
46
  end
43
47
 
44
48
  #
@@ -20,6 +20,10 @@
20
20
  module Ronin
21
21
  module Model
22
22
  module HasName
23
+ #
24
+ # Class methods that are added when {HasName} is included into a
25
+ # model.
26
+ #
23
27
  module ClassMethods
24
28
  #
25
29
  # Finds models with names containing a given fragment of text.
@@ -26,6 +26,12 @@ module Ronin
26
26
  # Adds a `name` property to a model.
27
27
  #
28
28
  module HasName
29
+ #
30
+ # Adds the `name` property and {ClassMethods} to the model.
31
+ #
32
+ # @param [Class] base
33
+ # The model.
34
+ #
29
35
  def self.included(base)
30
36
  base.send :include, Model
31
37
  base.send :extend, ClassMethods
@@ -20,6 +20,10 @@
20
20
  module Ronin
21
21
  module Model
22
22
  module HasTitle
23
+ #
24
+ # Class methods that are added when {HasTitle} are included into a
25
+ # model.
26
+ #
23
27
  module ClassMethods
24
28
  #
25
29
  # Finds models with titles containing a given fragment of text.
@@ -26,6 +26,12 @@ module Ronin
26
26
  # Adds a `title` property to a model.
27
27
  #
28
28
  module HasTitle
29
+ #
30
+ # Adds the `title` property and {ClassMethods} to the model.
31
+ #
32
+ # @param [Class] base
33
+ # The model.
34
+ #
29
35
  def self.included(base)
30
36
  base.send :include, Model
31
37
  base.send :extend, ClassMethods
@@ -25,6 +25,13 @@ module Ronin
25
25
  # Adds a unique `name` property to a model.
26
26
  #
27
27
  module HasUniqueName
28
+ #
29
+ # Adds the unique `name` property and {HasName::ClassMethods} to the
30
+ # model.
31
+ #
32
+ # @param [Class] base
33
+ # The model.
34
+ #
28
35
  def self.included(base)
29
36
  base.send :include, Model
30
37
  base.send :extend, HasName::ClassMethods
@@ -20,6 +20,10 @@
20
20
  module Ronin
21
21
  module Model
22
22
  module HasVersion
23
+ #
24
+ # Class methods that are added when {HasVersion} is included into a
25
+ # model.
26
+ #
23
27
  module ClassMethods
24
28
  #
25
29
  # Finds all models with a specific version.
@@ -26,6 +26,12 @@ module Ronin
26
26
  # Adds a `version` property to a model.
27
27
  #
28
28
  module HasVersion
29
+ #
30
+ # Adds the `version` property and {ClassMethods} to the model.
31
+ #
32
+ # @param [Class] base
33
+ # The model.
34
+ #
29
35
  def self.included(base)
30
36
  base.send :include, Model
31
37
  base.send :extend, ClassMethods
@@ -36,6 +36,13 @@ module Ronin
36
36
  module Model
37
37
  include Model::Types
38
38
 
39
+ #
40
+ # Sets up a class as a DataMapper model that can be used with the
41
+ # {Database}. Also adds {ClassMethods} to the new model.
42
+ #
43
+ # @param [Class] base
44
+ # The class that will be setup as a DataMapper model.
45
+ #
39
46
  def self.included(base)
40
47
  unless base.ancestors.include?(DataMapper::Resource)
41
48
  base.send :include, DataMapper::Resource