ronin 1.0.0.rc1 → 1.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog.md +24 -26
- data/Gemfile +24 -12
- data/README.md +39 -22
- data/Rakefile +2 -4
- data/gemspec.yml +27 -30
- data/lib/ronin/address.rb +3 -6
- data/lib/ronin/cached_file.rb +4 -3
- data/lib/ronin/campaign.rb +2 -1
- data/lib/ronin/credential.rb +3 -2
- data/lib/ronin/database/database.rb +3 -0
- data/lib/ronin/database/migrations/create_addresses_table.rb +1 -3
- data/lib/ronin/database/migrations/create_open_ports_table.rb +0 -3
- data/lib/ronin/database/migrations/create_organizations_table.rb +1 -6
- data/lib/ronin/database/migrations/create_urls_table.rb +1 -4
- data/lib/ronin/database/migrations.rb +0 -2
- data/lib/ronin/email_address.rb +5 -3
- data/lib/ronin/environment.rb +1 -1
- data/lib/ronin/host_name.rb +4 -3
- data/lib/ronin/host_name_ip_address.rb +3 -2
- data/lib/ronin/ip_address.rb +5 -4
- data/lib/ronin/ip_address_mac_address.rb +3 -2
- data/lib/ronin/mac_address.rb +3 -1
- data/lib/ronin/model/has_authors/class_methods.rb +2 -2
- data/lib/ronin/model/has_authors/has_authors.rb +1 -1
- data/lib/ronin/model/has_license/class_methods.rb +22 -5
- data/lib/ronin/{database/migrations/create_tags_table.rb → model/has_unique_name/class_methods.rb} +20 -15
- data/lib/ronin/model/has_unique_name/has_unique_name.rb +72 -0
- data/lib/ronin/model/has_unique_name.rb +2 -51
- data/lib/ronin/model/model.rb +1 -1
- data/lib/ronin/open_port.rb +5 -8
- data/lib/ronin/organization.rb +2 -5
- data/lib/ronin/os.rb +3 -2
- data/lib/ronin/os_guess.rb +3 -2
- data/lib/ronin/password.rb +2 -1
- data/lib/ronin/port.rb +2 -1
- data/lib/ronin/repository.rb +2 -1
- data/lib/ronin/service.rb +2 -1
- data/lib/ronin/service_credential.rb +2 -1
- data/lib/ronin/software.rb +2 -1
- data/lib/ronin/spec/database.rb +4 -0
- data/lib/ronin/target.rb +3 -2
- data/lib/ronin/tcp_port.rb +4 -2
- data/lib/ronin/ui/cli/cli.rb +2 -3
- data/lib/ronin/ui/cli/command.rb +48 -16
- data/lib/ronin/ui.rb +0 -1
- data/lib/ronin/url.rb +9 -10
- data/lib/ronin/url_scheme.rb +15 -1
- data/lib/ronin/version.rb +1 -1
- data/lib/ronin/web_credential.rb +3 -2
- data/ronin.gemspec +2 -2
- data/spec/model/cacheable_spec.rb +9 -6
- data/spec/model/has_authors_spec.rb +60 -0
- data/spec/model/has_description_spec.rb +8 -6
- data/spec/model/has_license_spec.rb +31 -12
- data/spec/model/has_name_spec.rb +12 -10
- data/spec/model/has_title_spec.rb +8 -6
- data/spec/model/has_version_spec.rb +58 -0
- data/spec/model/model_spec.rb +1 -3
- data/spec/model/models/authored_model.rb +11 -0
- data/spec/model/models/described_model.rb +0 -1
- data/spec/model/models/licensed_model.rb +0 -1
- data/spec/model/models/named_model.rb +0 -1
- data/spec/model/models/titled_model.rb +0 -1
- data/spec/model/models/versioned_model.rb +11 -0
- data/spec/model/spec_helper.rb +2 -2
- data/spec/ui/cli/classes/test_command.rb +7 -1
- data/spec/ui/cli/command_spec.rb +6 -0
- metadata +94 -267
- data/lib/ronin/database/migrations/create_taggings_table.rb +0 -45
- data/lib/ronin/ui/hexdump/extensions/file.rb +0 -39
- data/lib/ronin/ui/hexdump/extensions/kernel.rb +0 -31
- data/lib/ronin/ui/hexdump/extensions.rb +0 -21
- data/lib/ronin/ui/hexdump/hexdump.rb +0 -92
- data/lib/ronin/ui/hexdump.rb +0 -21
- data/spec/model/models/lazy_model.rb +0 -9
- data/spec/support/inflector_spec.rb +0 -20
@@ -1,45 +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/database/migrations/create_tags_table'
|
21
|
-
require 'ronin/database/migrations/migrations'
|
22
|
-
|
23
|
-
module Ronin
|
24
|
-
module Database
|
25
|
-
module Migrations
|
26
|
-
migration(:create_taggings_table, :need => :create_tags_table) do
|
27
|
-
up do
|
28
|
-
create_table :taggings do
|
29
|
-
column :id, Integer, :serial => true
|
30
|
-
column :taggable_id, Integer, :not_null => true
|
31
|
-
column :taggable_type, String, :not_null => true
|
32
|
-
column :tag_context, String, :not_null => true
|
33
|
-
column :tag_id, Integer, :not_null => true
|
34
|
-
end
|
35
|
-
|
36
|
-
create_index :taggings, :tag_id, :name => :index_taggings_tag
|
37
|
-
end
|
38
|
-
|
39
|
-
down do
|
40
|
-
drop_table :taggings
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
@@ -1,39 +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/ui/hexdump/hexdump'
|
21
|
-
|
22
|
-
class File
|
23
|
-
|
24
|
-
#
|
25
|
-
# Hexdumps the contents of the File.
|
26
|
-
#
|
27
|
-
# @param [String] path
|
28
|
-
# The path to the File to hexdump.
|
29
|
-
#
|
30
|
-
# @param [IO] output
|
31
|
-
# The output stream to print the hexdump to.
|
32
|
-
#
|
33
|
-
def self.hexdump(path,output=STDOUT)
|
34
|
-
self.open(path) do |file|
|
35
|
-
Ronin::UI::Hexdump.dump(file,output)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|
@@ -1,31 +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/ui/hexdump/hexdump'
|
21
|
-
|
22
|
-
module Kernel
|
23
|
-
#
|
24
|
-
# Hexdumps an object.
|
25
|
-
#
|
26
|
-
# @see Ronin::UI::Hexdump.dump
|
27
|
-
#
|
28
|
-
def hexdump(object,output=STDOUT)
|
29
|
-
Ronin::UI::Hexdump.dump(object,output)
|
30
|
-
end
|
31
|
-
end
|
@@ -1,21 +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/ui/hexdump/extensions/file'
|
21
|
-
require 'ronin/ui/hexdump/extensions/kernel'
|
@@ -1,92 +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 UI
|
22
|
-
#
|
23
|
-
# Methods for hexdumping data.
|
24
|
-
#
|
25
|
-
module Hexdump
|
26
|
-
#
|
27
|
-
# Hexdumps an object.
|
28
|
-
#
|
29
|
-
# @param [#each_byte] object
|
30
|
-
# The object to hexdump, must respond to the `each_byte` method.
|
31
|
-
#
|
32
|
-
# @param [IO] output
|
33
|
-
# The output stream to print the hexdump to.
|
34
|
-
#
|
35
|
-
# @return [nil]
|
36
|
-
#
|
37
|
-
# @raise [ArgumentError]
|
38
|
-
# The given object does not respond to the `#each_byte` method.
|
39
|
-
#
|
40
|
-
def Hexdump.dump(object,output=STDOUT)
|
41
|
-
unless object.respond_to?(:each_byte)
|
42
|
-
raise(ArgumentError,"argument must respond to #each_byte")
|
43
|
-
end
|
44
|
-
|
45
|
-
index = 0
|
46
|
-
offset = 0
|
47
|
-
hex_segment = nil
|
48
|
-
print_segment = nil
|
49
|
-
|
50
|
-
segment = lambda {
|
51
|
-
output.printf(
|
52
|
-
"%.8x %s |%s|\n",
|
53
|
-
index,
|
54
|
-
hex_segment.join(' ').ljust(47).insert(23,' '),
|
55
|
-
print_segment.join
|
56
|
-
)
|
57
|
-
}
|
58
|
-
|
59
|
-
object.each_byte do |b|
|
60
|
-
if offset == 0
|
61
|
-
hex_segment = []
|
62
|
-
print_segment = []
|
63
|
-
end
|
64
|
-
|
65
|
-
hex_segment << ("%.2x" % b)
|
66
|
-
|
67
|
-
print_segment[offset] = case b
|
68
|
-
when (0x20..0x7e)
|
69
|
-
b.chr
|
70
|
-
else
|
71
|
-
'.'
|
72
|
-
end
|
73
|
-
|
74
|
-
offset += 1
|
75
|
-
|
76
|
-
if (offset >= 16)
|
77
|
-
segment.call
|
78
|
-
|
79
|
-
offset = 0
|
80
|
-
index += 16
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
unless offset == 0
|
85
|
-
segment.call
|
86
|
-
end
|
87
|
-
|
88
|
-
return nil
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
data/lib/ronin/ui/hexdump.rb
DELETED
@@ -1,21 +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/ui/hexdump/hexdump'
|
21
|
-
require 'ronin/ui/hexdump/extensions'
|
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/support/inflector'
|
3
|
-
|
4
|
-
describe Ronin::Support::Inflector do
|
5
|
-
it "should not be nil" do
|
6
|
-
subject.should_not be_nil
|
7
|
-
end
|
8
|
-
|
9
|
-
it "should support pluralizing words" do
|
10
|
-
subject.pluralize('word').should == 'words'
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should support singularizing words" do
|
14
|
-
subject.singularize('words').should == 'word'
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should support humanizing words" do
|
18
|
-
subject.humanize('word_id').should == 'Word'
|
19
|
-
end
|
20
|
-
end
|