ronin 1.0.0.pre3 → 1.0.0.pre4
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING.txt +623 -288
- data/ChangeLog.md +21 -2
- data/Gemfile +5 -12
- data/README.md +6 -7
- data/gemspec.yml +3 -3
- data/lib/ronin.rb +6 -7
- data/lib/ronin/address.rb +18 -7
- data/lib/ronin/arch.rb +6 -7
- data/lib/ronin/author.rb +6 -7
- data/lib/ronin/bootstrap.rb +6 -8
- data/lib/ronin/cached_file.rb +6 -7
- data/lib/ronin/campaign.rb +10 -11
- data/lib/ronin/class_methods.rb +6 -7
- data/lib/ronin/config.rb +6 -7
- data/lib/ronin/credential.rb +19 -8
- data/lib/ronin/database.rb +6 -7
- data/lib/ronin/database/database.rb +8 -9
- data/lib/ronin/database/exceptions.rb +6 -7
- data/lib/ronin/database/exceptions/invalid_config.rb +6 -7
- data/lib/ronin/database/exceptions/unknown_repository.rb +6 -7
- data/lib/ronin/database/migrations.rb +6 -7
- data/lib/ronin/database/migrations/create_addresses_table.rb +6 -7
- data/lib/ronin/database/migrations/create_arches_table.rb +6 -7
- data/lib/ronin/database/migrations/create_authors_table.rb +6 -7
- data/lib/ronin/database/migrations/create_cached_files_table.rb +6 -7
- data/lib/ronin/database/migrations/create_campaigns_table.rb +8 -7
- data/lib/ronin/database/migrations/create_countries_table.rb +6 -7
- data/lib/ronin/database/migrations/create_credentials_table.rb +16 -10
- data/lib/ronin/database/migrations/create_email_addresses_table.rb +10 -11
- data/lib/ronin/database/migrations/create_host_name_ip_addresses_table.rb +14 -9
- data/lib/ronin/database/migrations/create_ip_address_mac_addresses_table.rb +14 -9
- data/lib/ronin/database/migrations/create_licenses_table.rb +6 -7
- data/lib/ronin/database/migrations/create_open_ports_table.rb +11 -7
- data/lib/ronin/database/migrations/create_organizations_table.rb +8 -7
- data/lib/ronin/database/migrations/create_os_guesses_table.rb +13 -9
- data/lib/ronin/database/migrations/create_os_table.rb +6 -7
- data/lib/ronin/database/migrations/create_passwords_table.rb +6 -7
- data/lib/ronin/database/migrations/create_ports_table.rb +6 -7
- data/lib/ronin/database/migrations/create_proxies_table.rb +6 -7
- data/lib/ronin/database/migrations/create_remote_files_table.rb +6 -7
- data/lib/ronin/database/migrations/create_repositories_table.rb +6 -7
- data/lib/ronin/database/migrations/create_services_table.rb +6 -8
- data/lib/ronin/database/migrations/create_softwares_table.rb +6 -7
- data/lib/ronin/database/migrations/create_taggings_table.rb +6 -7
- data/lib/ronin/database/migrations/create_tags_table.rb +6 -7
- data/lib/ronin/database/migrations/create_targets_table.rb +7 -8
- data/lib/ronin/database/migrations/create_url_query_params_table.rb +6 -7
- data/lib/ronin/database/migrations/create_url_schemes_table.rb +6 -7
- data/lib/ronin/database/migrations/create_urls_table.rb +16 -9
- data/lib/ronin/database/migrations/create_user_names_table.rb +6 -7
- data/lib/ronin/database/migrations/create_vendors_table.rb +6 -7
- data/lib/ronin/database/migrations/exceptions.rb +6 -7
- data/lib/ronin/database/migrations/exceptions/duplicate_migration.rb +6 -7
- data/lib/ronin/database/migrations/exceptions/unknown_migration.rb +6 -7
- data/lib/ronin/database/migrations/graph.rb +19 -0
- data/lib/ronin/database/migrations/migration.rb +6 -7
- data/lib/ronin/database/migrations/migrations.rb +6 -7
- data/lib/ronin/email_address.rb +34 -13
- data/lib/ronin/engine.rb +6 -7
- data/lib/ronin/engine/buildable.rb +6 -7
- data/lib/ronin/engine/class_methods.rb +6 -7
- data/lib/ronin/engine/deployable.rb +6 -7
- data/lib/ronin/engine/engine.rb +6 -7
- data/lib/ronin/engine/exceptions.rb +6 -7
- data/lib/ronin/engine/exceptions/deploy_failed.rb +6 -7
- data/lib/ronin/engine/exceptions/not_built.rb +6 -7
- data/lib/ronin/engine/exceptions/verification_failed.rb +6 -7
- data/lib/ronin/engine/instance_methods.rb +6 -7
- data/lib/ronin/engine/verifiable.rb +6 -7
- data/lib/ronin/environment.rb +11 -7
- data/lib/ronin/exceptions.rb +6 -7
- data/lib/ronin/exceptions/duplicate_repository.rb +6 -7
- data/lib/ronin/exceptions/repository_not_found.rb +6 -7
- data/lib/ronin/host_name.rb +40 -22
- data/lib/ronin/host_name_ip_address.rb +11 -9
- data/lib/ronin/installation.rb +6 -7
- data/lib/ronin/ip_address.rb +41 -33
- data/lib/ronin/ip_address_mac_address.rb +11 -9
- data/lib/ronin/license.rb +6 -7
- data/lib/ronin/mac_address.rb +8 -13
- data/lib/ronin/model.rb +6 -7
- data/lib/ronin/model/cacheable.rb +6 -7
- data/lib/ronin/model/cacheable/cacheable.rb +6 -7
- data/lib/ronin/model/cacheable/class_methods.rb +6 -7
- data/lib/ronin/model/class_methods.rb +6 -7
- data/lib/ronin/model/has_authors.rb +6 -7
- data/lib/ronin/model/has_authors/class_methods.rb +8 -9
- data/lib/ronin/model/has_authors/has_authors.rb +6 -7
- data/lib/ronin/model/has_description.rb +6 -7
- data/lib/ronin/model/has_description/class_methods.rb +7 -8
- data/lib/ronin/model/has_description/has_description.rb +6 -7
- data/lib/ronin/model/has_license.rb +6 -7
- data/lib/ronin/model/has_license/class_methods.rb +7 -8
- data/lib/ronin/model/has_license/has_license.rb +6 -7
- data/lib/ronin/model/has_name.rb +6 -7
- data/lib/ronin/model/has_name/class_methods.rb +7 -12
- data/lib/ronin/model/has_name/has_name.rb +6 -7
- data/lib/ronin/model/has_title.rb +6 -7
- data/lib/ronin/model/has_title/class_methods.rb +7 -8
- data/lib/ronin/model/has_title/has_title.rb +6 -7
- data/lib/ronin/model/has_unique_name.rb +18 -7
- data/lib/ronin/model/has_version.rb +6 -7
- data/lib/ronin/model/has_version/class_methods.rb +7 -8
- data/lib/ronin/model/has_version/has_version.rb +6 -7
- data/lib/ronin/model/model.rb +6 -7
- data/lib/ronin/model/types.rb +6 -7
- data/lib/ronin/model/types/description.rb +6 -7
- data/lib/ronin/network/mixins.rb +11 -13
- data/lib/ronin/network/mixins/esmtp.rb +11 -13
- data/lib/ronin/network/mixins/http.rb +11 -13
- data/lib/ronin/network/mixins/imap.rb +11 -13
- data/lib/ronin/network/mixins/pop3.rb +11 -13
- data/lib/ronin/network/mixins/smtp.rb +11 -13
- data/lib/ronin/network/mixins/tcp.rb +11 -13
- data/lib/ronin/network/mixins/telnet.rb +11 -13
- data/lib/ronin/network/mixins/udp.rb +11 -13
- data/lib/ronin/open_port.rb +11 -11
- data/lib/ronin/organization.rb +8 -9
- data/lib/ronin/os.rb +6 -7
- data/lib/ronin/os_guess.rb +14 -12
- data/lib/ronin/password.rb +18 -7
- data/lib/ronin/port.rb +18 -7
- data/lib/ronin/proxy.rb +6 -7
- data/lib/ronin/proxy_credential.rb +6 -7
- data/lib/ronin/remote_file.rb +13 -11
- data/lib/ronin/repository.rb +8 -12
- data/lib/ronin/ronin.rb +6 -7
- data/lib/ronin/service.rb +8 -23
- data/lib/ronin/service_credential.rb +6 -7
- data/lib/ronin/software.rb +6 -7
- data/lib/ronin/spec/database.rb +6 -7
- data/lib/ronin/spec/ui/output.rb +6 -7
- data/lib/ronin/target.rb +11 -9
- data/lib/ronin/tcp_port.rb +6 -7
- data/lib/ronin/udp_port.rb +6 -7
- data/lib/ronin/ui.rb +6 -7
- data/lib/ronin/ui/cli.rb +6 -7
- data/lib/ronin/ui/cli/cli.rb +6 -7
- data/lib/ronin/ui/cli/command.rb +6 -7
- data/lib/ronin/ui/cli/commands.rb +6 -7
- data/lib/ronin/ui/cli/commands/campaigns.rb +6 -7
- data/lib/ronin/ui/cli/commands/console.rb +7 -8
- data/lib/ronin/ui/cli/commands/creds.rb +6 -7
- data/lib/ronin/ui/cli/commands/database.rb +6 -7
- data/lib/ronin/ui/cli/commands/emails.rb +6 -7
- data/lib/ronin/ui/cli/commands/exec.rb +6 -7
- data/lib/ronin/ui/cli/commands/help.rb +6 -7
- data/lib/ronin/ui/cli/commands/hosts.rb +10 -9
- data/lib/ronin/ui/cli/commands/ips.rb +10 -9
- data/lib/ronin/ui/cli/commands/repos.rb +6 -7
- data/lib/ronin/ui/cli/commands/urls.rb +6 -7
- data/lib/ronin/ui/cli/engine_command.rb +6 -7
- data/lib/ronin/ui/cli/exceptions.rb +6 -7
- data/lib/ronin/ui/cli/exceptions/unknown_command.rb +6 -7
- data/lib/ronin/ui/cli/model_command.rb +6 -7
- data/lib/ronin/ui/console.rb +8 -12
- data/lib/ronin/ui/hexdump.rb +6 -7
- data/lib/ronin/ui/hexdump/extensions.rb +6 -7
- data/lib/ronin/ui/hexdump/extensions/file.rb +6 -7
- data/lib/ronin/ui/hexdump/extensions/kernel.rb +6 -7
- data/lib/ronin/ui/hexdump/hexdump.rb +13 -7
- data/lib/ronin/ui/output.rb +6 -7
- data/lib/ronin/ui/output/helpers.rb +6 -7
- data/lib/ronin/ui/output/output.rb +6 -7
- data/lib/ronin/ui/output/terminal.rb +6 -7
- data/lib/ronin/ui/output/terminal/color.rb +6 -7
- data/lib/ronin/ui/output/terminal/raw.rb +6 -7
- data/lib/ronin/ui/shell.rb +6 -7
- data/lib/ronin/url.rb +123 -30
- data/lib/ronin/url_query_param.rb +32 -7
- data/lib/ronin/url_scheme.rb +6 -7
- data/lib/ronin/user_name.rb +6 -7
- data/lib/ronin/vendor.rb +6 -7
- data/lib/ronin/version.rb +7 -8
- data/lib/ronin/web_credential.rb +52 -8
- data/spec/arch_spec.rb +7 -0
- data/spec/author_spec.rb +1 -1
- data/spec/campaign_spec.rb +1 -1
- data/spec/credential_spec.rb +33 -0
- data/spec/database_spec.rb +23 -0
- data/spec/email_address_spec.rb +15 -0
- data/spec/engine/buildable_spec.rb +2 -2
- data/spec/engine/deployable_spec.rb +2 -2
- data/spec/host_name_spec.rb +20 -0
- data/spec/ip_address.rb +20 -3
- data/spec/model/cacheable_spec.rb +1 -1
- data/spec/model/has_description_spec.rb +1 -1
- data/spec/os_spec.rb +26 -0
- data/spec/password_spec.rb +4 -0
- data/spec/port_spec.rb +43 -0
- data/spec/repository_spec.rb +10 -10
- data/spec/service_spec.rb +18 -0
- data/spec/software_spec.rb +15 -5
- data/spec/url_query_param_spec.rb +30 -0
- data/spec/url_scheme_spec.rb +18 -0
- data/spec/url_spec.rb +54 -37
- metadata +18 -9
- data/lib/ronin/ui/async_console.rb +0 -130
@@ -1,26 +1,27 @@
|
|
1
1
|
#
|
2
|
-
#
|
2
|
+
# Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
|
-
#
|
4
|
+
# This file is part of Ronin.
|
5
5
|
#
|
6
|
-
#
|
6
|
+
# Ronin is free software: you can redistribute it and/or modify
|
7
7
|
# it under the terms of the GNU General Public License as published by
|
8
|
-
# the Free Software Foundation
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
9
|
# (at your option) any later version.
|
10
10
|
#
|
11
|
-
#
|
11
|
+
# Ronin is distributed in the hope that it will be useful,
|
12
12
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
13
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
14
|
# GNU General Public License for more details.
|
15
15
|
#
|
16
16
|
# You should have received a copy of the GNU General Public License
|
17
|
-
# along with
|
18
|
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17
|
+
# along with Ronin. If not, see <http://www.gnu.org/licenses/>.
|
19
18
|
#
|
20
19
|
|
21
20
|
require 'ronin/model/has_name'
|
22
21
|
require 'ronin/model'
|
23
22
|
|
23
|
+
require 'uri/query_params'
|
24
|
+
|
24
25
|
module Ronin
|
25
26
|
class URLQueryParam
|
26
27
|
|
@@ -36,5 +37,29 @@ module Ronin
|
|
36
37
|
# The URL
|
37
38
|
belongs_to :url, :model => 'URL'
|
38
39
|
|
40
|
+
#
|
41
|
+
# Converts the URL query param to a String.
|
42
|
+
#
|
43
|
+
# @return [String]
|
44
|
+
# The dumped URL query param.
|
45
|
+
#
|
46
|
+
# @since 1.0.0
|
47
|
+
#
|
48
|
+
def to_s
|
49
|
+
URI::QueryParams.dump(self.name => self.value)
|
50
|
+
end
|
51
|
+
|
52
|
+
#
|
53
|
+
# Inspects the URL query param.
|
54
|
+
#
|
55
|
+
# @return [String]
|
56
|
+
# The inspected URL query param.
|
57
|
+
#
|
58
|
+
# @since 1.0.0
|
59
|
+
#
|
60
|
+
def inspect
|
61
|
+
"#<#{self.class}: #{self}>"
|
62
|
+
end
|
63
|
+
|
39
64
|
end
|
40
65
|
end
|
data/lib/ronin/url_scheme.rb
CHANGED
@@ -1,21 +1,20 @@
|
|
1
1
|
#
|
2
|
-
#
|
2
|
+
# Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
|
-
#
|
4
|
+
# This file is part of Ronin.
|
5
5
|
#
|
6
|
-
#
|
6
|
+
# Ronin is free software: you can redistribute it and/or modify
|
7
7
|
# it under the terms of the GNU General Public License as published by
|
8
|
-
# the Free Software Foundation
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
9
|
# (at your option) any later version.
|
10
10
|
#
|
11
|
-
#
|
11
|
+
# Ronin is distributed in the hope that it will be useful,
|
12
12
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
13
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
14
|
# GNU General Public License for more details.
|
15
15
|
#
|
16
16
|
# You should have received a copy of the GNU General Public License
|
17
|
-
# along with
|
18
|
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17
|
+
# along with Ronin. If not, see <http://www.gnu.org/licenses/>.
|
19
18
|
#
|
20
19
|
|
21
20
|
require 'ronin/model'
|
data/lib/ronin/user_name.rb
CHANGED
@@ -1,21 +1,20 @@
|
|
1
1
|
#
|
2
|
-
#
|
2
|
+
# Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
|
-
#
|
4
|
+
# This file is part of Ronin.
|
5
5
|
#
|
6
|
-
#
|
6
|
+
# Ronin is free software: you can redistribute it and/or modify
|
7
7
|
# it under the terms of the GNU General Public License as published by
|
8
|
-
# the Free Software Foundation
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
9
|
# (at your option) any later version.
|
10
10
|
#
|
11
|
-
#
|
11
|
+
# Ronin is distributed in the hope that it will be useful,
|
12
12
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
13
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
14
|
# GNU General Public License for more details.
|
15
15
|
#
|
16
16
|
# You should have received a copy of the GNU General Public License
|
17
|
-
# along with
|
18
|
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17
|
+
# along with Ronin. If not, see <http://www.gnu.org/licenses/>.
|
19
18
|
#
|
20
19
|
|
21
20
|
require 'ronin/model'
|
data/lib/ronin/vendor.rb
CHANGED
@@ -1,21 +1,20 @@
|
|
1
1
|
#
|
2
|
-
#
|
2
|
+
# Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
|
-
#
|
4
|
+
# This file is part of Ronin.
|
5
5
|
#
|
6
|
-
#
|
6
|
+
# Ronin is free software: you can redistribute it and/or modify
|
7
7
|
# it under the terms of the GNU General Public License as published by
|
8
|
-
# the Free Software Foundation
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
9
|
# (at your option) any later version.
|
10
10
|
#
|
11
|
-
#
|
11
|
+
# Ronin is distributed in the hope that it will be useful,
|
12
12
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
13
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
14
|
# GNU General Public License for more details.
|
15
15
|
#
|
16
16
|
# You should have received a copy of the GNU General Public License
|
17
|
-
# along with
|
18
|
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17
|
+
# along with Ronin. If not, see <http://www.gnu.org/licenses/>.
|
19
18
|
#
|
20
19
|
|
21
20
|
require 'ronin/model'
|
data/lib/ronin/version.rb
CHANGED
@@ -1,24 +1,23 @@
|
|
1
1
|
#
|
2
|
-
#
|
2
|
+
# Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
|
-
#
|
4
|
+
# This file is part of Ronin.
|
5
5
|
#
|
6
|
-
#
|
6
|
+
# Ronin is free software: you can redistribute it and/or modify
|
7
7
|
# it under the terms of the GNU General Public License as published by
|
8
|
-
# the Free Software Foundation
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
9
|
# (at your option) any later version.
|
10
10
|
#
|
11
|
-
#
|
11
|
+
# Ronin is distributed in the hope that it will be useful,
|
12
12
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
13
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
14
|
# GNU General Public License for more details.
|
15
15
|
#
|
16
16
|
# You should have received a copy of the GNU General Public License
|
17
|
-
# along with
|
18
|
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17
|
+
# along with Ronin. If not, see <http://www.gnu.org/licenses/>.
|
19
18
|
#
|
20
19
|
|
21
20
|
module Ronin
|
22
21
|
# Ronin version
|
23
|
-
VERSION = '1.0.0.
|
22
|
+
VERSION = '1.0.0.pre4'
|
24
23
|
end
|
data/lib/ronin/web_credential.rb
CHANGED
@@ -1,32 +1,76 @@
|
|
1
1
|
#
|
2
|
-
#
|
2
|
+
# Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
|
-
#
|
4
|
+
# This file is part of Ronin.
|
5
5
|
#
|
6
|
-
#
|
6
|
+
# Ronin is free software: you can redistribute it and/or modify
|
7
7
|
# it under the terms of the GNU General Public License as published by
|
8
|
-
# the Free Software Foundation
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
9
|
# (at your option) any later version.
|
10
10
|
#
|
11
|
-
#
|
11
|
+
# Ronin is distributed in the hope that it will be useful,
|
12
12
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
13
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
14
|
# GNU General Public License for more details.
|
15
15
|
#
|
16
16
|
# You should have received a copy of the GNU General Public License
|
17
|
-
# along with
|
18
|
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17
|
+
# along with Ronin. If not, see <http://www.gnu.org/licenses/>.
|
19
18
|
#
|
20
19
|
|
21
20
|
require 'ronin/credential'
|
21
|
+
require 'ronin/email_address'
|
22
22
|
require 'ronin/url'
|
23
23
|
|
24
24
|
module Ronin
|
25
25
|
class WebCredential < Credential
|
26
26
|
|
27
|
-
#
|
27
|
+
# The optional email address the credential is associated with.
|
28
|
+
belongs_to :email_address, :required => false
|
29
|
+
|
30
|
+
# The url the credential can be used with.
|
28
31
|
belongs_to :url, :required => false,
|
29
32
|
:model => 'URL'
|
30
33
|
|
34
|
+
#
|
35
|
+
# Searches all web credentials that are associated with an
|
36
|
+
# email address.
|
37
|
+
#
|
38
|
+
# @param [String] email
|
39
|
+
# The email address to search for.
|
40
|
+
#
|
41
|
+
# @return [Array<WebCredential>]
|
42
|
+
# The web credentials associated with the email address.
|
43
|
+
#
|
44
|
+
# @since 1.0.0
|
45
|
+
#
|
46
|
+
def self.with_email(email)
|
47
|
+
unless email.include?('@')
|
48
|
+
raise("invalid email address #{email.dump}")
|
49
|
+
end
|
50
|
+
|
51
|
+
user, domain = email.split('@',2)
|
52
|
+
|
53
|
+
return all(
|
54
|
+
'email_address.user_name.name' => user,
|
55
|
+
'email_address.host_name.address' => domain
|
56
|
+
)
|
57
|
+
end
|
58
|
+
|
59
|
+
#
|
60
|
+
# Converts the web credential to a String.
|
61
|
+
#
|
62
|
+
# @return [String]
|
63
|
+
# The user name, clear-text password and the optional email address.
|
64
|
+
#
|
65
|
+
# @since 1.0.0
|
66
|
+
#
|
67
|
+
def to_s
|
68
|
+
if self.email_address
|
69
|
+
"#{super} (#{self.email_address})"
|
70
|
+
else
|
71
|
+
super
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
31
75
|
end
|
32
76
|
end
|
data/spec/arch_spec.rb
CHANGED
@@ -57,4 +57,11 @@ describe Arch do
|
|
57
57
|
it "should provide built-in archs" do
|
58
58
|
Arch.i386.should_not be_nil
|
59
59
|
end
|
60
|
+
|
61
|
+
it "should implicitly splat the endian and address length" do
|
62
|
+
endian, address_length = Arch.i386
|
63
|
+
|
64
|
+
endian.should == Arch.i386.endian
|
65
|
+
address_length.should == Arch.i386.address_length
|
66
|
+
end
|
60
67
|
end
|
data/spec/author_spec.rb
CHANGED
data/spec/campaign_spec.rb
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'ronin/credential'
|
3
|
+
|
4
|
+
describe Credential do
|
5
|
+
let(:name) { 'alice' }
|
6
|
+
let(:secret) { 'secret' }
|
7
|
+
|
8
|
+
subject do
|
9
|
+
Credential.new(
|
10
|
+
:user_name => {:name => name},
|
11
|
+
:password => {:clear_text => secret}
|
12
|
+
)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should provide the user-name" do
|
16
|
+
subject.user.should == name
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should provide the clear-text password" do
|
20
|
+
subject.clear_text.should == secret
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should be convertable to a String" do
|
24
|
+
subject.to_s.should == "#{name}:#{secret}"
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should implicitly splat the user-name and password" do
|
28
|
+
user_name, password = subject
|
29
|
+
|
30
|
+
user_name.should == name
|
31
|
+
password.should == secret
|
32
|
+
end
|
33
|
+
end
|
data/spec/database_spec.rb
CHANGED
@@ -2,4 +2,27 @@ require 'spec_helper'
|
|
2
2
|
require 'ronin/database'
|
3
3
|
|
4
4
|
describe Database do
|
5
|
+
describe "repositories" do
|
6
|
+
it "should not be empty" do
|
7
|
+
subject.repositories.should_not be_empty
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should have a ':default' repository" do
|
11
|
+
subject.repositories[:default].should_not be_nil
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
it "shold determine if a repository is defined" do
|
16
|
+
subject.repository?(:default).should == true
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should determine when a repository is setup" do
|
20
|
+
subject.setup?(:default).should == true
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should not allow switching to unknown repositories" do
|
24
|
+
lambda {
|
25
|
+
subject.repository(:foo) { }
|
26
|
+
}.should raise_error(Database::UnknownRepository)
|
27
|
+
end
|
5
28
|
end
|
data/spec/email_address_spec.rb
CHANGED
@@ -29,7 +29,22 @@ describe EmailAddress do
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
+
it "should provide the user-name" do
|
33
|
+
subject.user.should == user
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should provide the host-name" do
|
37
|
+
subject.host.should == host
|
38
|
+
end
|
39
|
+
|
32
40
|
it "should convert to a String" do
|
33
41
|
subject.to_s.should == email
|
34
42
|
end
|
43
|
+
|
44
|
+
it "should implicitly splat the user-name and host-name" do
|
45
|
+
user_name, host_name = subject
|
46
|
+
|
47
|
+
user_name.should == user
|
48
|
+
host_name.should == host
|
49
|
+
end
|
35
50
|
end
|
@@ -20,7 +20,7 @@ describe Engine::Buildable do
|
|
20
20
|
subject.class.included_modules.should include(Engine::Verifiable)
|
21
21
|
end
|
22
22
|
|
23
|
-
describe "build!" do
|
23
|
+
describe "#build!" do
|
24
24
|
it "should call the build block" do
|
25
25
|
subject.build!
|
26
26
|
|
@@ -41,7 +41,7 @@ describe Engine::Buildable do
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
describe "verify!" do
|
44
|
+
describe "#verify!" do
|
45
45
|
it "should raise a NotBuilt exception when verifying unbuilt engines" do
|
46
46
|
lambda {
|
47
47
|
subject.verify!
|
@@ -23,7 +23,7 @@ describe Engine::Deployable do
|
|
23
23
|
subject.should_not be_deployed
|
24
24
|
end
|
25
25
|
|
26
|
-
describe "deploy!" do
|
26
|
+
describe "#deploy!" do
|
27
27
|
it "should verify! the engine before deploying it" do
|
28
28
|
subject.var = -1
|
29
29
|
|
@@ -45,7 +45,7 @@ describe Engine::Deployable do
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
-
describe "evacuate!" do
|
48
|
+
describe "#evacuate!" do
|
49
49
|
it "should mark the engine as evacuated" do
|
50
50
|
subject.evacuate!
|
51
51
|
|
data/spec/host_name_spec.rb
CHANGED
@@ -13,6 +13,10 @@ describe HostName do
|
|
13
13
|
host_name.should_not be_valid
|
14
14
|
end
|
15
15
|
|
16
|
+
it "should alias #name to #address" do
|
17
|
+
subject.name.should == subject.address
|
18
|
+
end
|
19
|
+
|
16
20
|
describe "lookup" do
|
17
21
|
subject { HostName }
|
18
22
|
|
@@ -25,6 +29,14 @@ describe HostName do
|
|
25
29
|
host_names[0].address.should == example_domain
|
26
30
|
end
|
27
31
|
|
32
|
+
it "should associate the host names with the original IP address" do
|
33
|
+
host_names = subject.lookup(example_ip)
|
34
|
+
|
35
|
+
host_names.each do |host|
|
36
|
+
host.ip_addresses[0].address.should == example_ip
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
28
40
|
it "should return an empty Array for unknown host names" do
|
29
41
|
host_names = subject.lookup(bad_ip)
|
30
42
|
|
@@ -42,6 +54,14 @@ describe HostName do
|
|
42
54
|
ips[0].address.should == example_ip
|
43
55
|
end
|
44
56
|
|
57
|
+
it "should associate the IP addresses with the original host name" do
|
58
|
+
ips = subject.lookup!
|
59
|
+
|
60
|
+
ips.each do |ip|
|
61
|
+
ip.host_names[0].address.should == example_domain
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
45
65
|
it "should return an empty Array for unknown host names" do
|
46
66
|
ips = HostName.new(:address => bad_domain).lookup!
|
47
67
|
|