Class: SSHScan::OS::Raspbian
- Inherits:
-
Object
- Object
- SSHScan::OS::Raspbian
- Defined in:
- lib/ssh_scan/os/raspbian.rb
Defined Under Namespace
Classes: Version
Instance Attribute Summary collapse
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #common ⇒ Object
- #cpe ⇒ Object
-
#initialize(banner) ⇒ Raspbian
constructor
A new instance of Raspbian.
-
#raspbian_version_guess ⇒ String
Guess Raspbian OS version.
Constructor Details
Instance Attribute Details
#version ⇒ Object (readonly)
Returns the value of attribute version.
4 5 6 |
# File 'lib/ssh_scan/os/raspbian.rb', line 4 def version @version end |
Instance Method Details
#common ⇒ Object
33 34 35 |
# File 'lib/ssh_scan/os/raspbian.rb', line 33 def common "raspbian" end |
#cpe ⇒ Object
37 38 39 |
# File 'lib/ssh_scan/os/raspbian.rb', line 37 def cpe "o:raspbian:raspbian" end |
#raspbian_version_guess ⇒ String
Guess Raspbian OS version. Typically, Raspbian banners are like “SSH-2.0-Raspbian-something”, where something is the Raspbian version.
26 27 28 29 30 31 |
# File 'lib/ssh_scan/os/raspbian.rb', line 26 def raspbian_version_guess return nil if @banner.nil? match = @banner.match(/SSH-2.0-Raspbian-(\d+)/) return nil if match.nil? return match[1] end |