ronin 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. data/History.txt +58 -25
  2. data/Manifest.txt +15 -16
  3. data/README.txt +16 -11
  4. data/Rakefile +9 -7
  5. data/TODO.txt +6 -1
  6. data/lib/ronin.rb +1 -1
  7. data/lib/ronin/arch.rb +7 -15
  8. data/lib/ronin/author.rb +1 -1
  9. data/lib/ronin/cache.rb +1 -1
  10. data/lib/ronin/cache/cache.rb +1 -1
  11. data/lib/ronin/cache/config.rb +1 -1
  12. data/lib/ronin/cache/exceptions.rb +1 -1
  13. data/lib/ronin/cache/exceptions/extension_not_found.rb +1 -1
  14. data/lib/ronin/cache/exceptions/overlay_cached.rb +1 -1
  15. data/lib/ronin/cache/exceptions/overlay_not_found.rb +1 -1
  16. data/lib/ronin/cache/extension.rb +15 -190
  17. data/lib/ronin/cache/extension_cache.rb +2 -2
  18. data/lib/ronin/cache/maintainer.rb +1 -1
  19. data/lib/ronin/cache/overlay.rb +8 -7
  20. data/lib/ronin/cache/overlay_cache.rb +1 -1
  21. data/lib/ronin/cache/ronin.rb +1 -1
  22. data/lib/ronin/chars.rb +1 -1
  23. data/lib/ronin/chars/char_set.rb +1 -1
  24. data/lib/ronin/chars/chars.rb +1 -1
  25. data/lib/ronin/code/emittable.rb +1 -1
  26. data/lib/ronin/code/reference.rb +1 -1
  27. data/lib/ronin/code/symbol_table.rb +1 -1
  28. data/lib/ronin/code/token.rb +1 -1
  29. data/lib/ronin/config.rb +16 -9
  30. data/lib/ronin/database.rb +2 -113
  31. data/lib/ronin/database/database.rb +124 -0
  32. data/lib/ronin/{exceptions/unknown_context.rb → database/exceptions.rb} +2 -5
  33. data/lib/ronin/{exceptions/context_not_found.rb → database/exceptions/invalid_config.rb} +4 -2
  34. data/lib/ronin/extensions.rb +1 -1
  35. data/lib/ronin/extensions/hash.rb +1 -1
  36. data/lib/ronin/extensions/meta.rb +1 -1
  37. data/lib/ronin/extensions/string.rb +1 -1
  38. data/lib/ronin/extensions/uri.rb +1 -1
  39. data/lib/ronin/extensions/uri/http.rb +1 -1
  40. data/lib/ronin/extensions/uri/query_params.rb +1 -1
  41. data/lib/ronin/formatting.rb +1 -1
  42. data/lib/ronin/formatting/binary.rb +1 -1
  43. data/lib/ronin/formatting/digest.rb +1 -1
  44. data/lib/ronin/formatting/extensions.rb +1 -1
  45. data/lib/ronin/formatting/extensions/binary.rb +1 -1
  46. data/lib/ronin/formatting/extensions/binary/integer.rb +1 -1
  47. data/lib/ronin/formatting/extensions/binary/string.rb +1 -1
  48. data/lib/ronin/formatting/extensions/digest.rb +1 -1
  49. data/lib/ronin/formatting/extensions/digest/string.rb +1 -1
  50. data/lib/ronin/formatting/extensions/html.rb +1 -1
  51. data/lib/ronin/formatting/extensions/html/string.rb +1 -1
  52. data/lib/ronin/formatting/extensions/http.rb +1 -1
  53. data/lib/ronin/formatting/extensions/http/string.rb +1 -1
  54. data/lib/ronin/formatting/extensions/text.rb +1 -1
  55. data/lib/ronin/formatting/extensions/text/string.rb +1 -1
  56. data/lib/ronin/formatting/html.rb +1 -1
  57. data/lib/ronin/formatting/http.rb +1 -1
  58. data/lib/ronin/formatting/text.rb +1 -1
  59. data/lib/ronin/{pending_context.rb → has_license.rb} +21 -22
  60. data/lib/ronin/hexdump.rb +1 -1
  61. data/lib/ronin/hexdump/extensions.rb +1 -1
  62. data/lib/ronin/hexdump/extensions/file.rb +1 -1
  63. data/lib/ronin/hexdump/extensions/kernel.rb +1 -1
  64. data/lib/ronin/hexdump/hexdump.rb +1 -1
  65. data/lib/ronin/license.rb +10 -15
  66. data/lib/ronin/model.rb +14 -12
  67. data/lib/ronin/models.rb +2 -2
  68. data/lib/ronin/network.rb +1 -1
  69. data/lib/ronin/network/esmtp.rb +1 -1
  70. data/lib/ronin/network/extensions.rb +1 -1
  71. data/lib/ronin/network/extensions/esmtp.rb +1 -1
  72. data/lib/ronin/network/extensions/esmtp/net.rb +1 -1
  73. data/lib/ronin/network/extensions/http.rb +1 -1
  74. data/lib/ronin/network/extensions/http/net.rb +1 -1
  75. data/lib/ronin/network/extensions/imap.rb +1 -1
  76. data/lib/ronin/network/extensions/imap/net.rb +1 -1
  77. data/lib/ronin/network/extensions/pop3.rb +1 -1
  78. data/lib/ronin/network/extensions/pop3/net.rb +1 -1
  79. data/lib/ronin/network/extensions/smtp.rb +1 -1
  80. data/lib/ronin/network/extensions/smtp/net.rb +1 -1
  81. data/lib/ronin/network/extensions/tcp.rb +1 -1
  82. data/lib/ronin/network/extensions/tcp/net.rb +17 -1
  83. data/lib/ronin/network/extensions/telnet.rb +1 -1
  84. data/lib/ronin/network/extensions/telnet/net.rb +1 -1
  85. data/lib/ronin/network/extensions/udp.rb +1 -1
  86. data/lib/ronin/network/extensions/udp/net.rb +1 -1
  87. data/lib/ronin/network/http.rb +1 -1
  88. data/lib/ronin/network/http/exceptions.rb +1 -1
  89. data/lib/ronin/network/http/exceptions/unknown_request.rb +1 -1
  90. data/lib/ronin/network/imap.rb +1 -1
  91. data/lib/ronin/network/pop3.rb +1 -1
  92. data/lib/ronin/network/smtp.rb +1 -1
  93. data/lib/ronin/network/smtp/email.rb +1 -1
  94. data/lib/ronin/network/smtp/smtp.rb +1 -1
  95. data/lib/ronin/network/tcp.rb +1 -1
  96. data/lib/ronin/network/telnet.rb +1 -1
  97. data/lib/ronin/network/udp.rb +1 -1
  98. data/lib/ronin/objectify.rb +24 -0
  99. data/lib/ronin/{exceptions/invalid_database_config.rb → objectify/exceptions.rb} +3 -5
  100. data/lib/ronin/{exceptions → objectify/exceptions}/object_context_not_found.rb +1 -1
  101. data/lib/ronin/{exceptions → objectify/exceptions}/unknown_object_context.rb +1 -1
  102. data/lib/ronin/{object_context.rb → objectify/objectify.rb} +54 -45
  103. data/lib/ronin/path.rb +1 -1
  104. data/lib/ronin/platform.rb +3 -1
  105. data/lib/ronin/product.rb +2 -1
  106. data/lib/ronin/ronin.rb +10 -10
  107. data/lib/ronin/rpc.rb +1 -1
  108. data/lib/ronin/rpc/call.rb +1 -1
  109. data/lib/ronin/rpc/client.rb +1 -1
  110. data/lib/ronin/rpc/console.rb +1 -1
  111. data/lib/ronin/rpc/exceptions.rb +1 -1
  112. data/lib/ronin/rpc/exceptions/not_implemented.rb +1 -1
  113. data/lib/ronin/rpc/exceptions/response_missing.rb +1 -1
  114. data/lib/ronin/rpc/response.rb +1 -1
  115. data/lib/ronin/rpc/service.rb +1 -1
  116. data/lib/ronin/rpc/shell.rb +1 -1
  117. data/lib/ronin/sessions.rb +1 -1
  118. data/lib/ronin/sessions/esmtp.rb +6 -8
  119. data/lib/ronin/sessions/http.rb +1 -1
  120. data/lib/ronin/sessions/imap.rb +6 -8
  121. data/lib/ronin/sessions/pop3.rb +6 -8
  122. data/lib/ronin/sessions/session.rb +1 -1
  123. data/lib/ronin/sessions/smtp.rb +6 -8
  124. data/lib/ronin/sessions/tcp.rb +48 -36
  125. data/lib/ronin/sessions/telnet.rb +7 -10
  126. data/lib/ronin/sessions/udp.rb +28 -29
  127. data/lib/ronin/sessions/web.rb +5 -7
  128. data/lib/ronin/target.rb +1 -0
  129. data/lib/ronin/translators/translator.rb +1 -1
  130. data/lib/ronin/ui/command_line.rb +1 -1
  131. data/lib/ronin/ui/command_line/command.rb +1 -1
  132. data/lib/ronin/ui/command_line/command_line.rb +7 -2
  133. data/lib/ronin/ui/command_line/commands.rb +2 -2
  134. data/lib/ronin/ui/command_line/commands/add.rb +8 -8
  135. data/lib/ronin/ui/command_line/commands/default.rb +1 -1
  136. data/lib/ronin/ui/command_line/commands/extension.rb +13 -26
  137. data/lib/ronin/ui/command_line/commands/help.rb +1 -1
  138. data/lib/ronin/ui/command_line/commands/install.rb +7 -7
  139. data/lib/ronin/ui/command_line/commands/list.rb +13 -7
  140. data/lib/ronin/ui/command_line/commands/overlay.rb +1 -1
  141. data/lib/ronin/ui/command_line/commands/remove.rb +4 -4
  142. data/lib/ronin/ui/command_line/commands/uninstall.rb +4 -4
  143. data/lib/ronin/ui/command_line/commands/update.rb +3 -3
  144. data/lib/ronin/ui/command_line/exceptions.rb +1 -1
  145. data/lib/ronin/ui/command_line/exceptions/unknown_command.rb +1 -1
  146. data/lib/ronin/ui/command_line/options.rb +1 -1
  147. data/lib/ronin/ui/command_line/param_parser.rb +73 -0
  148. data/lib/ronin/ui/console.rb +1 -1
  149. data/lib/ronin/ui/shell.rb +1 -1
  150. data/lib/ronin/version.rb +2 -2
  151. data/lib/ronin/web.rb +1 -1
  152. data/lib/ronin/web/web.rb +1 -1
  153. data/spec/chars/char_set_spec.rb +116 -118
  154. data/spec/chars/chars_spec.rb +54 -63
  155. data/spec/formatting/{binary_spec.rb → binary/integer_spec.rb} +0 -19
  156. data/spec/formatting/binary/string_spec.rb +32 -0
  157. data/spec/{object_context/object_context_spec.rb → objectify/objectify_spec.rb} +5 -3
  158. data/spec/path_spec.rb +21 -23
  159. data/spec/translators/translator_spec.rb +38 -40
  160. data/spec/ui/command_line/param_parser_spec.rb +58 -0
  161. data/static/extension.rb +9 -0
  162. metadata +43 -24
  163. data/lib/ronin/context.rb +0 -236
  164. data/spec/context/context_spec.rb +0 -84
  165. data/spec/context/helpers/book_context.rb +0 -15
  166. data/spec/context/helpers/book_review_context.rb +0 -21
  167. data/spec/context/helpers/contexts/neuromancer_review.rb +0 -15
  168. data/spec/context/helpers/contexts/snow_crash.rb +0 -8
  169. data/static/extension.rb.erb +0 -16
data/History.txt CHANGED
@@ -1,37 +1,70 @@
1
+ === 0.1.3 / 2008-01-08
2
+
3
+ * Moved Context into the Contextify library.
4
+ * Require dm-core >= 0.9.9.
5
+ * Require dm-predefined >= 0.1.0.
6
+ * Require parameters >= 0.1.2.
7
+ * Require contextify >= 0.1.0.
8
+ * Require reverse-require >= 0.3.1.
9
+ * Renamed Ronin::ObjectContext to Ronin::Objectify.
10
+ * Added the MIT license to the Ronin::License model, using dm-predefined.
11
+ * Added Ronin::HasLicense mixin for adding licenses to a model.
12
+ * Added Net.tcp_send and Ronin::Sessions::TCP#tcp_send for quickly sending
13
+ data through a TCP connection then closing it.
14
+ * Added Ronin::UI::CommandLine::ParamParser for parsing command-line
15
+ options into a Hash of parameters.
16
+ * Automatically create the <tt>~/.ronin/config/</tt> directory.
17
+ * Refactored Ronin::Objectify and how it uses primary keys.
18
+ * All Ronin::Session mixins use standard naming conventions for defining
19
+ the 'host' and 'port' parameters.
20
+ * Removed Ronin::Cache::Extension dependencies.
21
+ * Filter out the 'objects' directory from Ronin::Cache::Overlay#extensions.
22
+ * Improved tearing down of Extensions at exit.
23
+ * Improved output formatting of the +list+ sub-command.
24
+ * Ronin::UI::CommandLine.run now prints any exceptions and exits.
25
+ * Cleaned up the specs.
26
+ * Added more specs.
27
+ * Added more documentation.
28
+
1
29
  === 0.1.2 / 2008-12-10
2
30
 
3
31
  * Require do_sqlite3 >= 0.9.9, since version 0.9.8 was totally broken.
4
32
  * Require reverse-require >= 0.2.0, for improved performance.
5
33
  * Require Spidr >= 0.1.3.
6
34
  * Moved Ronin::Parameters into the parameters 0.1.0 RubyGem.
7
- * Added a Hexdump module:
8
- * Provides Hexdump.dump and Kernel#hexdump, which can hexdump any object
9
- that supports the #each_byte method.
10
- * Refactored Chars::CharSet:
35
+ * Added a Ronin::Hexdump module:
36
+ * Provides Ronin::Hexdump.dump and Kernel#hexdump, which can hexdump any
37
+ object that supports the #each_byte method.
38
+ * Refactored Ronin::Chars::CharSet:
11
39
  * Now inherites the SortedSet class.
12
40
  * Stores chars as bytes.
13
- * Added a Chars::CharSet#=~ operator, for determining if a String exists
14
- in the language over the alphabet represented by the character set.
15
- * Added a Chars::CharSet#inspect method which prints C-like characters.
41
+ * Added a Ronin::Chars::CharSet#=~ operator, for determining if a String
42
+ exists in the language over the alphabet represented by the character
43
+ set.
44
+ * Added a Ronin::Chars::CharSet#inspect method which prints C-like
45
+ characters.
16
46
  * Added a String#inspect method which prints C-like strings.
17
47
  * Added a String#xor method (it might come in handy).
18
- * Renamed Encoders::Encoder to Translators::Translator.
48
+ * Renamed Ronin::Encoders::Encoder to Ronin::Translators::Translator.
19
49
  * Added URI::QueryParams#each_query_param.
20
50
  * Added extensions to Hpricot, for comparing two Hpricot Element trees.
21
- * Added the Web.spider_agent, Web.spider_host and Web.spider_site methods.
22
- * Added Code::SymbolTable#symbols.
23
- * Added a basic Code::Emittable module and a Code::Token class.
24
- * Renamed ObjectContext.object_contextify to ObjectContext.objectify.
25
- * Merged the Environment module into the Config module.
26
- * Refactored the Shell class.
27
- * Refactored the Runner::Program module.
28
- * Created the UI namespace, to contain all things User Interfacing:
29
- * Moved Console and Shell into the UI namespace.
30
- * Renamed Runner::Program to UI::CommandLine.
31
- * Added a Cache::Overlay::Maintainer class to define maintainers of an
32
- Overlay and their contact information.
51
+ * Added the Ronin::Web.spider_agent, Ronin::Web.spider_host and
52
+ Ronin::Web.spider_site methods.
53
+ * Added Ronin::Code::SymbolTable#symbols.
54
+ * Added a basic Ronin::Code::Emittable module and a Ronin::Code::Token
55
+ class.
56
+ * Renamed Ronin::ObjectContext.object_contextify to
57
+ Ronin::ObjectContext.objectify.
58
+ * Merged the Ronin::Environment module into the Ronin::Config module.
59
+ * Refactored the Ronin::Shell class.
60
+ * Refactored the Ronin::Runner::Program module.
61
+ * Created the Ronin::UI namespace, to contain all things User Interfacing:
62
+ * Moved Ronin::Console and Ronin::Shell into the UI namespace.
63
+ * Renamed Ronin::Runner::Program to Ronin::UI::CommandLine.
64
+ * Added a Ronin::Cache::Overlay::Maintainer class to define maintainers of
65
+ an Ronin::Cache::Overlay and their contact information.
33
66
  * Refactored the parsing of Overlay XML files.
34
- * Added the sub-commands 'overlay' and 'extension' for generating skeleton
67
+ * Added the sub-commands +overlay+ and +extension+ for generating skeleton
35
68
  Overlays and Extensions.
36
69
  * Added a XSL file for generating pretty HTML from Overlay XML files.
37
70
  * Added even more specs.
@@ -40,22 +73,22 @@
40
73
  === 0.1.1 / 2008-10-26
41
74
 
42
75
  * Depend on the newly renamed reverse-require (>= 0.1.2) gem.
43
- * Added Code::SymbolTable for DSLs to make use of.
76
+ * Added Ronin::Code::SymbolTable for DSLs to make use of.
44
77
  * Added String#common_prefix, String#common_postfix and
45
78
  String#uncommon_substring, which will be useful when testing for
46
79
  successful injections.
47
80
  * Added DataMapper column indexes to Author.name, Product.name, Platform.os
48
81
  and Platform.version.
49
82
  * Renamed String#rand_case to String#random_case.
50
- * Removed the Runner namespace, renaming the Runner::Program namespace to
51
- Ronin::Program.
83
+ * Removed the Ronin::Runner namespace, renaming the Ronin::Runner::Program
84
+ namespace to Ronin::Program.
52
85
 
53
86
  === 0.1.0 / 2008-09-28
54
87
 
55
88
  * Changed how Sessions are setup.
56
89
  * Have Ronin use it's own DataMapper Repository name-space to avoid
57
90
  conflicts with other DataMapper libraries.
58
- * Added the Parameters#set_params methods.
91
+ * Added the Ronin::Parameters#set_params methods.
59
92
  * Added specs.
60
93
  * Fixed various trivial bugs.
61
94
 
data/Manifest.txt CHANGED
@@ -7,11 +7,6 @@ Rakefile
7
7
  bin/ronin
8
8
  lib/ronin.rb
9
9
  lib/ronin/config.rb
10
- lib/ronin/exceptions/invalid_database_config.rb
11
- lib/ronin/exceptions/unknown_context.rb
12
- lib/ronin/exceptions/context_not_found.rb
13
- lib/ronin/exceptions/unknown_object_context.rb
14
- lib/ronin/exceptions/object_context_not_found.rb
15
10
  lib/ronin/extensions.rb
16
11
  lib/ronin/extensions/meta.rb
17
12
  lib/ronin/extensions/meta/object.rb
@@ -115,16 +110,22 @@ lib/ronin/sessions/telnet.rb
115
110
  lib/ronin/sessions/http.rb
116
111
  lib/ronin/sessions/web.rb
117
112
  lib/ronin/database.rb
113
+ lib/ronin/database/exceptions.rb
114
+ lib/ronin/database/exceptions/invalid_config.rb
115
+ lib/ronin/database/database.rb
118
116
  lib/ronin/model.rb
119
117
  lib/ronin/author.rb
120
118
  lib/ronin/license.rb
119
+ lib/ronin/has_license.rb
121
120
  lib/ronin/arch.rb
122
121
  lib/ronin/platform.rb
123
122
  lib/ronin/target.rb
124
123
  lib/ronin/product.rb
125
- lib/ronin/pending_context.rb
126
- lib/ronin/context.rb
127
- lib/ronin/object_context.rb
124
+ lib/ronin/objectify.rb
125
+ lib/ronin/objectify/exceptions.rb
126
+ lib/ronin/objectify/exceptions/object_context_not_found.rb
127
+ lib/ronin/objectify/exceptions/unknown_object_context.rb
128
+ lib/ronin/objectify/objectify.rb
128
129
  lib/ronin/models.rb
129
130
  lib/ronin/cache.rb
130
131
  lib/ronin/cache/exceptions.rb
@@ -146,6 +147,7 @@ lib/ronin/ui/command_line/exceptions.rb
146
147
  lib/ronin/ui/command_line/exceptions/unknown_command.rb
147
148
  lib/ronin/ui/command_line/command.rb
148
149
  lib/ronin/ui/command_line/options.rb
150
+ lib/ronin/ui/command_line/param_parser.rb
149
151
  lib/ronin/ui/command_line/commands.rb
150
152
  lib/ronin/ui/command_line/commands/default.rb
151
153
  lib/ronin/ui/command_line/commands/overlay.rb
@@ -168,17 +170,13 @@ spec/author_spec.rb
168
170
  spec/chars/char_set_spec.rb
169
171
  spec/chars/chars_spec.rb
170
172
  spec/translators/translator_spec.rb
171
- spec/context/context_spec.rb
172
- spec/context/helpers/book_context.rb
173
- spec/context/helpers/book_review_context.rb
174
- spec/context/helpers/contexts/snow_crash.rb
175
- spec/context/helpers/contexts/neuromancer_review.rb
176
- spec/object_context/object_context_spec.rb
173
+ spec/objectify/objectify_spec.rb
177
174
  spec/extensions/hash_spec.rb
178
175
  spec/extensions/string_spec.rb
179
176
  spec/extensions/uri/http_spec.rb
180
177
  spec/extensions/uri/query_params_spec.rb
181
- spec/formatting/binary_spec.rb
178
+ spec/formatting/binary/integer_spec.rb
179
+ spec/formatting/binary/string_spec.rb
182
180
  spec/formatting/digest_spec.rb
183
181
  spec/formatting/html_spec.rb
184
182
  spec/formatting/http_spec.rb
@@ -192,6 +190,7 @@ spec/platform_spec.rb
192
190
  spec/product_spec.rb
193
191
  spec/target_spec.rb
194
192
  spec/sessions/session_spec.rb
193
+ spec/ui/command_line/param_parser_spec.rb
195
194
  spec/ronin_spec.rb
196
195
  static/overlay.xsl
197
- static/extension.rb.erb
196
+ static/extension.rb
data/README.txt CHANGED
@@ -69,17 +69,22 @@ of Ronin.
69
69
 
70
70
  == REQUIREMENTS:
71
71
 
72
- * Hpricot
73
- * WWW::Mechanize
72
+ * hpricot
73
+ * mechanize
74
+ * spidr >= 0.1.3
74
75
  * DataMapper:
75
- * dm-core >= 0.9.3
76
- * data_objects >= 0.9.3
77
- * do_sqlite3 >= 0.9.3
78
- * dm-types >= 0.9.3
79
- * dm-serializer >= 0.9.3
80
- * dm-aggregates >= 0.9.3
81
- * reverse-require >= 0.1.2
82
- * R'epertoire >= 0.1.2
76
+ * dm-core >= 0.9.9
77
+ * data_objects >= 0.9.9
78
+ * do_sqlite3 >= 0.9.9
79
+ * dm-types >= 0.9.9
80
+ * dm-aggregates >= 0.9.9
81
+ * dm-validations >= 0.9.9
82
+ * dm-serializer >= 0.9.9
83
+ * dm-prefined >= 0.1.0
84
+ * parameters >= 0.1.2
85
+ * contextify >= 0.1.0
86
+ * reverse-require >= 0.3.1
87
+ * repertoire >= 0.1.2
83
88
 
84
89
  == INSTALL:
85
90
 
@@ -175,7 +180,7 @@ and Remote File Inclusion (RFI).
175
180
  Ronin - A Ruby platform designed for information security and data
176
181
  exploration tasks.
177
182
 
178
- Copyright (c) 2006-2008 Hal Brodigan (postmodern.mod3 at gmail.com)
183
+ Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
179
184
 
180
185
  This program is free software; you can redistribute it and/or modify
181
186
  it under the terms of the GNU General Public License as published by
data/Rakefile CHANGED
@@ -12,15 +12,17 @@ Hoe.new('ronin', Ronin::VERSION) do |p|
12
12
  p.extra_deps = ['hpricot',
13
13
  'mechanize',
14
14
  ['spidr', '>=0.1.3'],
15
- ['dm-core', '>=0.9.3'],
15
+ ['dm-core', '>=0.9.9'],
16
16
  ['data_objects', '>=0.9.9'],
17
17
  ['do_sqlite3', '>=0.9.9'],
18
- ['dm-types', '>=0.9.3'],
19
- ['dm-serializer', '>=0.9.3'],
20
- ['dm-aggregates', '>=0.9.3'],
21
- ['dm-validations', '>=0.9.3'],
22
- ['parameters', '>=0.1.0'],
23
- ['reverse-require', '>=0.2.0'],
18
+ ['dm-types', '>=0.9.9'],
19
+ ['dm-serializer', '>=0.9.9'],
20
+ ['dm-aggregates', '>=0.9.9'],
21
+ ['dm-validations', '>=0.9.9'],
22
+ ['dm-predefined', '>=0.1.0'],
23
+ ['parameters', '>=0.1.2'],
24
+ ['contextify', '>=0.1.0'],
25
+ ['reverse-require', '>=0.3.1'],
24
26
  ['repertoire', '>=0.1.2']]
25
27
  end
26
28
 
data/TODO.txt CHANGED
@@ -1,6 +1,11 @@
1
1
  == TODO
2
2
 
3
- === Ronin 0.1.2:
3
+ === Ronin 0.1.3:
4
+
5
+ * Add diagonstic logging of this format:
6
+
7
+ [*] Message
8
+
4
9
 
5
10
  === Ronin 0.2.0:
6
11
 
data/lib/ronin.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  # Ronin - A Ruby platform designed for information security and data
4
4
  # exploration tasks.
5
5
  #
6
- # Copyright (c) 2006-2008 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of the GNU General Public License as published by
data/lib/ronin/arch.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  # Ronin - A Ruby platform designed for information security and data
4
4
  # exploration tasks.
5
5
  #
6
- # Copyright (c) 2006-2008 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of the GNU General Public License as published by
@@ -25,11 +25,15 @@ require 'ronin/extensions/meta'
25
25
  require 'ronin/extensions/string'
26
26
  require 'ronin/model'
27
27
 
28
+ require 'dm-predefined'
29
+
28
30
  module Ronin
29
31
  class Arch
30
32
 
31
33
  include Model
34
+ include DataMapper::Predefined
32
35
 
36
+ # Primary key
33
37
  property :id, Serial
34
38
 
35
39
  # Name of the architecture
@@ -60,20 +64,8 @@ module Ronin
60
64
  # Defines a new builtin Arch with the specified _name_ and the given
61
65
  # _options_.
62
66
  #
63
- def Arch.define(name,options={})
64
- name = name.to_s
65
- endian = options[:endian].to_s
66
- address_length = options[:address_length].to_i
67
-
68
- meta_def(name.to_method_name) do
69
- Arch.first_or_create(
70
- :name => name,
71
- :endian => endian,
72
- :address_length => address_length
73
- )
74
- end
75
-
76
- return nil
67
+ def self.define(name,options={})
68
+ super(name,options.merge(:name => name))
77
69
  end
78
70
 
79
71
  define :i386, :endian => :little, :address_length => 4
data/lib/ronin/author.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  # Ronin - A Ruby platform designed for information security and data
4
4
  # exploration tasks.
5
5
  #
6
- # Copyright (c) 2006-2008 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of the GNU General Public License as published by
data/lib/ronin/cache.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  # Ronin - A Ruby platform designed for information security and data
4
4
  # exploration tasks.
5
5
  #
6
- # Copyright (c) 2006-2008 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of the GNU General Public License as published by
@@ -3,7 +3,7 @@
3
3
  # Ronin - A Ruby platform designed for information security and data
4
4
  # exploration tasks.
5
5
  #
6
- # Copyright (c) 2006-2008 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of the GNU General Public License as published by
@@ -3,7 +3,7 @@
3
3
  # Ronin - A Ruby platform designed for information security and data
4
4
  # exploration tasks.
5
5
  #
6
- # Copyright (c) 2006-2008 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of the GNU General Public License as published by
@@ -3,7 +3,7 @@
3
3
  # Ronin - A Ruby platform designed for information security and data
4
4
  # exploration tasks.
5
5
  #
6
- # Copyright (c) 2006-2008 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of the GNU General Public License as published by
@@ -3,7 +3,7 @@
3
3
  # Ronin - A Ruby platform designed for information security and data
4
4
  # exploration tasks.
5
5
  #
6
- # Copyright (c) 2006-2008 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of the GNU General Public License as published by
@@ -3,7 +3,7 @@
3
3
  # Ronin - A Ruby platform designed for information security and data
4
4
  # exploration tasks.
5
5
  #
6
- # Copyright (c) 2006-2008 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of the GNU General Public License as published by
@@ -3,7 +3,7 @@
3
3
  # Ronin - A Ruby platform designed for information security and data
4
4
  # exploration tasks.
5
5
  #
6
- # Copyright (c) 2006-2008 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of the GNU General Public License as published by
@@ -3,7 +3,7 @@
3
3
  # Ronin - A Ruby platform designed for information security and data
4
4
  # exploration tasks.
5
5
  #
6
- # Copyright (c) 2006-2008 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # This program is free software; you can redistribute it and/or modify
9
9
  # it under the terms of the GNU General Public License as published by
@@ -23,31 +23,20 @@
23
23
 
24
24
  require 'ronin/cache/extension_cache'
25
25
  require 'ronin/cache/overlay'
26
- require 'ronin/context'
27
26
 
28
27
  module Ronin
29
28
  module Cache
30
29
  class Extension
31
30
 
32
- include Context
33
-
34
31
  # Extension file name
35
32
  EXTENSION_FILE = 'extension.rb'
36
33
 
37
- # Extension lib directory
38
- LIB_DIR = 'lib'
39
-
40
- contextify :extension
41
-
42
34
  # Name of extension
43
35
  attr_reader :name
44
36
 
45
37
  # Paths of similar extensions
46
38
  attr_reader :paths
47
39
 
48
- # Dependency extensions
49
- attr_reader :dependencies
50
-
51
40
  #
52
41
  # Creates a new Extension with the specified _name_. If a
53
42
  # _block_ is given, it will be passed the newly created
@@ -62,13 +51,11 @@ module Ronin
62
51
  def initialize(name,&block)
63
52
  @name = name.to_s
64
53
  @paths = []
65
- @dependencies = {}
66
54
 
67
55
  @setup = false
68
56
  @toredown = true
69
57
 
70
58
  @setup_blocks = []
71
- @action_blocks = {}
72
59
  @teardown_blocks = []
73
60
 
74
61
  block.call(self) if block
@@ -287,61 +274,7 @@ module Ronin
287
274
  end
288
275
 
289
276
  #
290
- # Loads all similar extensions with the specified _name_ into a
291
- # newly created Extension object and adds it to the extensions
292
- # dependencies.
293
- #
294
- # uses 'shellcode'
295
- #
296
- def uses(name)
297
- name = name.to_s
298
-
299
- unless Extension.exists?(name)
300
- raise(ExtensionNotFound,"extension #{name.dump} is not in the overlay cache",caller)
301
- end
302
-
303
- @dependencies[name] ||= Extension.load(name)
304
- return self
305
- end
306
-
307
- #
308
- # Returns +true+ if the extension has the dependency of the specified
309
- # _name_, returns +false+ otherwise.
310
- #
311
- def uses?(name)
312
- @dependencies.has_key?(name.to_s)
313
- end
314
-
315
- #
316
- # Passes all the extension's dependencies and the extension itself to
317
- # the specified _block_ using the given _options_.
318
- #
319
- # _options_ may include the following keys:
320
- # <tt>:top_down</tt>:: Indicates that distribute will recurse through
321
- # the extensions and their elements in a
322
- # top-down manner. This is distributes default
323
- # behavior.
324
- # <tt>:bottom_up</tt>:: Indictates that distribute will recurse
325
- # through the extensions and their dependencies
326
- # in a bottom-up manner. Mutually exclusive with
327
- # the <tt>:top_down</tt> option.
328
- #
329
- def distribute(options={},&block)
330
- distribute_deps = lambda {
331
- @dependencies.map { |ext|
332
- ext.distribute(options,&block)
333
- }.flatten
334
- }
335
-
336
- if options[:bottom_up]
337
- return distribute_deps.call + [block.call(self)]
338
- else
339
- return [block.call(self)] + distribute_deps.call
340
- end
341
- end
342
-
343
- #
344
- # Returns +true+ if the app context has a public instance method
277
+ # Returns +true+ if the extension context has a public instance method
345
278
  # of the matching _name_, returns +false+ otherwise.
346
279
  #
347
280
  # ext.has_method?(:console) # => true
@@ -351,31 +284,11 @@ module Ronin
351
284
  end
352
285
 
353
286
  #
354
- # Returns an +Array+ of extensions that have the specified _method_.
355
- # If a _block_ is given, it will be passed each extension with the
356
- # specified _method_.
357
- #
358
- # ext.extensions_with_method(:console) # => [...]
359
- #
360
- # ext.extensions_with_method(:console) do |ext|
361
- # ext.console(ARGV)
362
- # end
363
- #
364
- def extensions_with_method(method,&block)
365
- extensions = distribute { |ext|
366
- ext if ext.has_method?(method)
367
- }.compact
368
-
369
- extensions.each(&block) if block
370
- return extensions
371
- end
372
-
373
- #
374
- # Calls the setup blocks of the extension's dependencies and the
375
- # extension itself. If a _block_ is given, it will be passed the
376
- # extension after it has been setup.
287
+ # Calls the setup blocks of the extension. If a _block_ is given, it
288
+ # will be passed the extension after it has been setup.
377
289
  #
378
- # ext.perform_setup # => Extension
290
+ # ext.perform_setup
291
+ # # => #<Ronin::Cache::Extension: ...>
379
292
  #
380
293
  # ext.perform_setup do |ext|
381
294
  # puts "Extension #{ext} has been setup..."
@@ -383,12 +296,8 @@ module Ronin
383
296
  #
384
297
  def perform_setup(&block)
385
298
  unless @setup
386
- distribute(:bottom_up => true) do |ext|
387
- ext.instance_eval do
388
- @setup_blocks.each do |setup_block|
389
- setup_block.call(self) if setup_block
390
- end
391
- end
299
+ @setup_blocks.each do |setup_block|
300
+ setup_block.call(self) if setup_block
392
301
  end
393
302
 
394
303
  @setup = true
@@ -408,11 +317,11 @@ module Ronin
408
317
  end
409
318
 
410
319
  #
411
- # Run the teardown blocks of the extension and it's dependencies.
412
- # If a _block_ is given, it will be passed the extension before it
413
- # has been tore down.
320
+ # Run the teardown blocks of the extension. If a _block_ is given,
321
+ # it will be passed the extension before it has been tore down.
414
322
  #
415
- # ext.perform_teardown # => Extension
323
+ # ext.perform_teardown
324
+ # # => #<Ronin::Cache::Extension: ...>
416
325
  #
417
326
  # ext.perform_teardown do |ext|
418
327
  # puts "Extension #{ext} is being tore down..."
@@ -422,12 +331,8 @@ module Ronin
422
331
  block.call(self) if block
423
332
 
424
333
  unless @toredown
425
- distribute(:top_down => true) do |ext|
426
- ext.instance_eval do
427
- @teardown_blocks.each do |teardown_block|
428
- teardown_block.call(self) if teardown_block
429
- end
430
- end
334
+ @teardown_blocks.each do |teardown_block|
335
+ teardown_block.call(self) if teardown_block
431
336
  end
432
337
 
433
338
  @toredown = true
@@ -462,41 +367,6 @@ module Ronin
462
367
  return self
463
368
  end
464
369
 
465
- #
466
- # Returns an +Array+ of the names of all actions defined in the
467
- # extension.
468
- #
469
- # ext.actions # => [...]
470
- #
471
- def actions
472
- @action_blocks.keys
473
- end
474
-
475
- #
476
- # Returns +true+ if the extension has the action of the specified
477
- # _name_, returns +false+ otherwise.
478
- #
479
- def has_action?(name)
480
- @action_blocks.has_key?(name.to_sym)
481
- end
482
-
483
- #
484
- # Runs the action of the specified _name_ with the given _args_.
485
- # If no action of the specified name exists, then an UnknownAction
486
- # exception will be raised.
487
- #
488
- def perform_action(name,*args)
489
- name = name.to_s
490
-
491
- unless has_action?(name)
492
- raise(UnknownAction,"action #{name.dump} is not defined",caller)
493
- end
494
-
495
- return run do
496
- @action_blocks[name.to_sym].call(*args)
497
- end
498
- end
499
-
500
370
  #
501
371
  # Find the specified _path_ from within all similar extensions.
502
372
  # If a _block_ is given, it will be passed the full path if found.
@@ -622,7 +492,7 @@ module Ronin
622
492
  end
623
493
 
624
494
  #
625
- # Returns the name of the app context in string form.
495
+ # Returns the name of the extension context in string form.
626
496
  #
627
497
  def to_s
628
498
  @name.to_s
@@ -639,22 +509,6 @@ module Ronin
639
509
  return self
640
510
  end
641
511
 
642
- #
643
- # Defines a new action with the specified _name_ and the given
644
- # _block_. If an action of the same _name_ has already been defined
645
- # then an ActionRedefined exception will be raised.
646
- #
647
- def action(name,&block)
648
- name = name.to_s
649
-
650
- if has_action?(name)
651
- raise(ActionRedefined,"action #{name.dump} previously defined",caller)
652
- end
653
-
654
- @action_blocks[name.to_sym] = block
655
- return self
656
- end
657
-
658
512
  #
659
513
  # Adds the specified _block_ to the list of blocks to run in order
660
514
  # to properly tear-down the extension.
@@ -664,35 +518,6 @@ module Ronin
664
518
  return self
665
519
  end
666
520
 
667
- #
668
- # Provides transparent access to the performing of actions
669
- # and extensions dependencies.
670
- #
671
- # ext.scan('localhost') # => Extension
672
- #
673
- # ext.shellcode # => Extension
674
- #
675
- # ext.shellcode do |dep|
676
- # puts "#{ext} has the dependency #{dep}"
677
- # end
678
- #
679
- def method_missing(sym,*args,&block)
680
- if (args.length==0)
681
- name = sym.to_s
682
-
683
- if (has_action?(name) && block.nil?)
684
- return perform_action(name,*args)
685
- end
686
-
687
- if uses?(name)
688
- block.call(@dependencies[name]) if block
689
- return @dependencies[name]
690
- end
691
- end
692
-
693
- return super(sym,*args,&block)
694
- end
695
-
696
521
  end
697
522
  end
698
523
  end