ronin 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/ChangeLog.md +23 -0
  2. data/README.md +19 -13
  3. data/Rakefile +2 -1
  4. data/gemspec.yml +18 -17
  5. data/lib/bond/completions/ronin.rb +147 -0
  6. data/lib/ronin/auto_load.rb +30 -28
  7. data/lib/ronin/database/migrations/1.0.0.rb +1 -0
  8. data/lib/ronin/model/has_authors.rb +92 -2
  9. data/lib/ronin/model/has_description.rb +54 -2
  10. data/lib/ronin/model/has_license.rb +101 -2
  11. data/lib/ronin/model/has_name.rb +72 -2
  12. data/lib/ronin/model/has_title.rb +52 -2
  13. data/lib/ronin/model/has_unique_name.rb +93 -2
  14. data/lib/ronin/model/has_version.rb +58 -2
  15. data/lib/ronin/model/model.rb +91 -52
  16. data/lib/ronin/os.rb +30 -15
  17. data/lib/ronin/repository.rb +1 -1
  18. data/lib/ronin/ronin.rb +0 -15
  19. data/lib/ronin/script/script.rb +257 -2
  20. data/lib/ronin/ui/console.rb +2 -199
  21. data/lib/ronin/ui/console/commands.rb +164 -0
  22. data/lib/ronin/ui/console/console.rb +215 -0
  23. data/lib/ronin/ui/console/context.rb +95 -0
  24. data/lib/ronin/version.rb +1 -1
  25. data/spec/os_spec.rb +18 -13
  26. metadata +206 -239
  27. data/lib/ronin/class_methods.rb +0 -49
  28. data/lib/ronin/model/class_methods.rb +0 -58
  29. data/lib/ronin/model/has_authors/class_methods.rb +0 -60
  30. data/lib/ronin/model/has_authors/has_authors.rb +0 -70
  31. data/lib/ronin/model/has_description/class_methods.rb +0 -49
  32. data/lib/ronin/model/has_description/has_description.rb +0 -49
  33. data/lib/ronin/model/has_license/class_methods.rb +0 -68
  34. data/lib/ronin/model/has_license/has_license.rb +0 -71
  35. data/lib/ronin/model/has_name/class_methods.rb +0 -48
  36. data/lib/ronin/model/has_name/has_name.rb +0 -62
  37. data/lib/ronin/model/has_title/class_methods.rb +0 -48
  38. data/lib/ronin/model/has_title/has_title.rb +0 -48
  39. data/lib/ronin/model/has_unique_name/class_methods.rb +0 -51
  40. data/lib/ronin/model/has_unique_name/has_unique_name.rb +0 -78
  41. data/lib/ronin/model/has_version/class_methods.rb +0 -54
  42. data/lib/ronin/model/has_version/has_version.rb +0 -48
  43. data/lib/ronin/script/class_methods.rb +0 -84
  44. data/lib/ronin/script/instance_methods.rb +0 -217
@@ -1,48 +0,0 @@
1
- #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
3
- #
4
- # This file is part of Ronin.
5
- #
6
- # Ronin is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU General Public License as published by
8
- # the Free Software Foundation, either version 3 of the License, or
9
- # (at your option) any later version.
10
- #
11
- # Ronin is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU General Public License
17
- # along with Ronin. If not, see <http://www.gnu.org/licenses/>.
18
- #
19
-
20
- module Ronin
21
- module Model
22
- module HasName
23
- #
24
- # Class methods that are added when {HasName} is included into a
25
- # model.
26
- #
27
- module ClassMethods
28
- #
29
- # Finds models with names containing a given fragment of text.
30
- #
31
- # @param [String] fragment
32
- # The fragment of text to search for within the names of models.
33
- #
34
- # @return [Array<Model>]
35
- # The found models.
36
- #
37
- # @example
38
- # Exploit.named 'ProFTP'
39
- #
40
- # @api public
41
- #
42
- def named(fragment)
43
- all(:name.like => "%#{fragment}%")
44
- end
45
- end
46
- end
47
- end
48
- end
@@ -1,62 +0,0 @@
1
- #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
3
- #
4
- # This file is part of Ronin.
5
- #
6
- # Ronin is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU General Public License as published by
8
- # the Free Software Foundation, either version 3 of the License, or
9
- # (at your option) any later version.
10
- #
11
- # Ronin is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU General Public License
17
- # along with Ronin. If not, see <http://www.gnu.org/licenses/>.
18
- #
19
-
20
- require 'ronin/model/has_name/class_methods'
21
- require 'ronin/model/model'
22
-
23
- module Ronin
24
- module Model
25
- #
26
- # Adds a `name` property to a model.
27
- #
28
- module HasName
29
- #
30
- # Adds the `name` property and {ClassMethods} to the model.
31
- #
32
- # @param [Class] base
33
- # The model.
34
- #
35
- # @api semipublic
36
- #
37
- def self.included(base)
38
- base.send :include, Model
39
- base.send :extend, ClassMethods
40
-
41
- base.module_eval do
42
- # The name of the model
43
- property :name, String, :required => true, :index => true
44
- end
45
- end
46
-
47
- #
48
- # Converts the named resource into a String.
49
- #
50
- # @return [String]
51
- # The name of the resource.
52
- #
53
- # @since 1.0.0
54
- #
55
- # @api public
56
- #
57
- def to_s
58
- self.name.to_s
59
- end
60
- end
61
- end
62
- end
@@ -1,48 +0,0 @@
1
- #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
3
- #
4
- # This file is part of Ronin.
5
- #
6
- # Ronin is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU General Public License as published by
8
- # the Free Software Foundation, either version 3 of the License, or
9
- # (at your option) any later version.
10
- #
11
- # Ronin is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU General Public License
17
- # along with Ronin. If not, see <http://www.gnu.org/licenses/>.
18
- #
19
-
20
- module Ronin
21
- module Model
22
- module HasTitle
23
- #
24
- # Class methods that are added when {HasTitle} are included into a
25
- # model.
26
- #
27
- module ClassMethods
28
- #
29
- # Finds models with titles containing a given fragment of text.
30
- #
31
- # @param [String] fragment
32
- # The fragment of text to match titles with.
33
- #
34
- # @return [Array<Model>]
35
- # The found models.
36
- #
37
- # @example
38
- # Vuln.titled 'bypass'
39
- #
40
- # @api public
41
- #
42
- def titled(fragment)
43
- all(:title.like => "%#{fragment}%")
44
- end
45
- end
46
- end
47
- end
48
- end
@@ -1,48 +0,0 @@
1
- #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
3
- #
4
- # This file is part of Ronin.
5
- #
6
- # Ronin is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU General Public License as published by
8
- # the Free Software Foundation, either version 3 of the License, or
9
- # (at your option) any later version.
10
- #
11
- # Ronin is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU General Public License
17
- # along with Ronin. If not, see <http://www.gnu.org/licenses/>.
18
- #
19
-
20
- require 'ronin/model/has_title/class_methods'
21
- require 'ronin/model/model'
22
-
23
- module Ronin
24
- module Model
25
- #
26
- # Adds a `title` property to a model.
27
- #
28
- module HasTitle
29
- #
30
- # Adds the `title` property and {ClassMethods} to the model.
31
- #
32
- # @param [Class] base
33
- # The model.
34
- #
35
- # @api semipublic
36
- #
37
- def self.included(base)
38
- base.send :include, Model
39
- base.send :extend, ClassMethods
40
-
41
- base.module_eval do
42
- # The title of the model
43
- property :title, String
44
- end
45
- end
46
- end
47
- end
48
- end
@@ -1,51 +0,0 @@
1
- #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
3
- #
4
- # This file is part of Ronin.
5
- #
6
- # Ronin is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU General Public License as published by
8
- # the Free Software Foundation, either version 3 of the License, or
9
- # (at your option) any later version.
10
- #
11
- # Ronin is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU General Public License
17
- # along with Ronin. If not, see <http://www.gnu.org/licenses/>.
18
- #
19
-
20
- module Ronin
21
- module Model
22
- module HasUniqueName
23
- #
24
- # Class methods that will be added when {HasUniqueName} is included.
25
- #
26
- module ClassMethods
27
- #
28
- # Searches for models with the unique name.
29
- #
30
- # @param [String, Symbol, Integer] key
31
- # The unique name or index to search for.
32
- #
33
- # @return [Model, nil]
34
- # The matching model.
35
- #
36
- # @since 1.0.0
37
- #
38
- # @api public
39
- #
40
- def [](key)
41
- case key
42
- when String, Symbol
43
- first(:name => key.to_s)
44
- else
45
- super(key)
46
- end
47
- end
48
- end
49
- end
50
- end
51
- end
@@ -1,78 +0,0 @@
1
- #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
3
- #
4
- # This file is part of Ronin.
5
- #
6
- # Ronin is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU General Public License as published by
8
- # the Free Software Foundation, either version 3 of the License, or
9
- # (at your option) any later version.
10
- #
11
- # Ronin is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU General Public License
17
- # along with Ronin. If not, see <http://www.gnu.org/licenses/>.
18
- #
19
-
20
- require 'ronin/model/has_unique_name/class_methods'
21
- require 'ronin/model/has_name/class_methods'
22
-
23
- module Ronin
24
- module Model
25
- #
26
- # Adds a unique `name` property to a model.
27
- #
28
- module HasUniqueName
29
- #
30
- # Adds the unique `name` property and {HasName::ClassMethods} to the
31
- # model.
32
- #
33
- # @param [Class] base
34
- # The model.
35
- #
36
- # @api semipublic
37
- #
38
- def self.included(base)
39
- base.send :include, Model
40
- base.send :extend, HasName::ClassMethods,
41
- HasUniqueName::ClassMethods
42
-
43
- base.module_eval do
44
- # The name of the model
45
- property :name, String, :required => true, :unique => true
46
- end
47
- end
48
-
49
- #
50
- # Converts the named resource into a String.
51
- #
52
- # @return [String]
53
- # The name of the resource.
54
- #
55
- # @since 1.0.0
56
- #
57
- # @api public
58
- #
59
- def to_s
60
- self.name.to_s
61
- end
62
-
63
- #
64
- # Inspects the resource with the unique name.
65
- #
66
- # @return [String]
67
- # The inspected resource.
68
- #
69
- # @since 1.0.0
70
- #
71
- # @api public
72
- #
73
- def inspect
74
- "#<#{self.class}: #{self.name}>"
75
- end
76
- end
77
- end
78
- end
@@ -1,54 +0,0 @@
1
- #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
3
- #
4
- # This file is part of Ronin.
5
- #
6
- # Ronin is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU General Public License as published by
8
- # the Free Software Foundation, either version 3 of the License, or
9
- # (at your option) any later version.
10
- #
11
- # Ronin is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU General Public License
17
- # along with Ronin. If not, see <http://www.gnu.org/licenses/>.
18
- #
19
-
20
- module Ronin
21
- module Model
22
- module HasVersion
23
- #
24
- # Class methods that are added when {HasVersion} is included into a
25
- # model.
26
- #
27
- module ClassMethods
28
- #
29
- # Finds all models with a specific version.
30
- #
31
- # @param [String] version
32
- # The specific version to search for.
33
- #
34
- # @return [Array]
35
- # The models with the specific version.
36
- #
37
- # @api public
38
- #
39
- def revision(version)
40
- all(:version => version.to_s)
41
- end
42
-
43
- #
44
- # Finds latest version of the model.
45
- #
46
- # @api public
47
- #
48
- def latest
49
- first(:order => [:version.desc])
50
- end
51
- end
52
- end
53
- end
54
- end
@@ -1,48 +0,0 @@
1
- #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
3
- #
4
- # This file is part of Ronin.
5
- #
6
- # Ronin is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU General Public License as published by
8
- # the Free Software Foundation, either version 3 of the License, or
9
- # (at your option) any later version.
10
- #
11
- # Ronin is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU General Public License
17
- # along with Ronin. If not, see <http://www.gnu.org/licenses/>.
18
- #
19
-
20
- require 'ronin/model/has_version/class_methods'
21
- require 'ronin/model/model'
22
-
23
- module Ronin
24
- module Model
25
- #
26
- # Adds a `version` property to a model.
27
- #
28
- module HasVersion
29
- #
30
- # Adds the `version` property and {ClassMethods} to the model.
31
- #
32
- # @param [Class] base
33
- # The model.
34
- #
35
- # @api semipublic
36
- #
37
- def self.included(base)
38
- base.send :include, Model
39
- base.send :extend, ClassMethods
40
-
41
- base.module_eval do
42
- # The version of the model
43
- property :version, String, :default => '0.1', :index => true
44
- end
45
- end
46
- end
47
- end
48
- end