Class: SSHScan::SSHLib::NosSSH

Inherits:
Object
  • Object
show all
Defined in:
lib/ssh_scan/ssh_lib/nosssh.rb

Defined Under Namespace

Classes: Version

Instance Method Summary collapse

Constructor Details

#initialize(banner = nil) ⇒ NosSSH

Returns a new instance of NosSSH.


14
15
16
# File 'lib/ssh_scan/ssh_lib/nosssh.rb', line 14

def initialize(banner = nil)
  @banner = banner
end

Instance Method Details

#commonObject


25
26
27
# File 'lib/ssh_scan/ssh_lib/nosssh.rb', line 25

def common
  "nosssh"
end

#cpeObject


29
30
31
# File 'lib/ssh_scan/ssh_lib/nosssh.rb', line 29

def cpe
  "a:nosssh:nosssh" << (":" + version.to_s) unless version.nil?
end

#versionObject


18
19
20
21
22
23
# File 'lib/ssh_scan/ssh_lib/nosssh.rb', line 18

def version()
  return nil if @banner.nil?
  match = @banner.match(/NOS-SSH_(\d+[\.\d+]+)/)
  return nil if match.nil?
  return NosSSH::Version.new(match[1])
end