Class: Ronin::DB::OpenPort
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Ronin::DB::OpenPort
- Includes:
- Model, Model::LastScannedAt
- Defined in:
- lib/ronin/db/open_port.rb
Overview
Represents a open port at a specified IP address.
Instance Attribute Summary collapse
-
#created_at ⇒ Time
readonly
Define the created_at timestamp.
-
#credentials ⇒ Array<Credential>
The credentials that will work with this open port.
-
#id ⇒ Integer
The primary key of the open port.
-
#ip_address ⇒ IPAddress
The IP Address that was scanned.
-
#port ⇒ Port
The port.
-
#service ⇒ Service?
The service detected on the port.
-
#service_credentials ⇒ Array<ServiceCredential>
Credentials used by the service running on the port.
-
#software ⇒ Software
The software running on the open port.
-
#ssl ⇒ Boolean
Specifies whether the service requires SSL.
Attributes included from Model::LastScannedAt
Instance Method Summary collapse
-
#address ⇒ String
The IP Address of the open port.
-
#number ⇒ Integer
The port number.
-
#to_i ⇒ Integer
Converts the open port to an integer.
-
#to_s ⇒ String
Converts the open port to a string.
Methods included from Model::LastScannedAt
Methods included from Model
Instance Attribute Details
#created_at ⇒ Time (readonly)
Define the created_at timestamp
77 |
# File 'lib/ronin/db/open_port.rb', line 77 attribute :created_at, :datetime |
#credentials ⇒ Array<Credential>
The credentials that will work with this open port.
89 |
# File 'lib/ronin/db/open_port.rb', line 89 has_many :credentials, through: :service_credentials |
#id ⇒ Integer
The primary key of the open port.
40 |
# File 'lib/ronin/db/open_port.rb', line 40 attribute :id, :integer |
#ip_address ⇒ IPAddress
The IP Address that was scanned.
46 47 |
# File 'lib/ronin/db/open_port.rb', line 46 belongs_to :ip_address, required: true, class_name: 'IPAddress' |
#port ⇒ Port
The port.
53 |
# File 'lib/ronin/db/open_port.rb', line 53 belongs_to :port, required: true |
#service ⇒ Service?
The service detected on the port
59 |
# File 'lib/ronin/db/open_port.rb', line 59 belongs_to :service, optional: true |
#service_credentials ⇒ Array<ServiceCredential>
Credentials used by the service running on the port
83 |
# File 'lib/ronin/db/open_port.rb', line 83 has_many :service_credentials, dependent: :destroy |
#software ⇒ Software
The software running on the open port
65 |
# File 'lib/ronin/db/open_port.rb', line 65 belongs_to :software, optional: true |
#ssl ⇒ Boolean
Specifies whether the service requires SSL.
71 |
# File 'lib/ronin/db/open_port.rb', line 71 attribute :ssl, :boolean |
Instance Method Details
#address ⇒ String
The IP Address of the open port.
99 100 101 |
# File 'lib/ronin/db/open_port.rb', line 99 def address self.ip_address.address end |
#number ⇒ Integer
The port number.
111 112 113 |
# File 'lib/ronin/db/open_port.rb', line 111 def number self.port.number end |
#to_i ⇒ Integer
Converts the open port to an integer.
123 124 125 |
# File 'lib/ronin/db/open_port.rb', line 123 def to_i self.port.to_i end |
#to_s ⇒ String
Converts the open port to a string.
135 136 137 138 139 |
# File 'lib/ronin/db/open_port.rb', line 135 def to_s if self.service then "#{self.port} (#{self.service})" else "#{self.port}" end end |