Class: SSHScan::SSHLib::Mpssh

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

Defined Under Namespace

Classes: Version

Instance Method Summary collapse

Constructor Details

#initialize(banner = nil) ⇒ Mpssh

Returns a new instance of Mpssh.



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

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

Instance Method Details

#commonObject



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

def common
  "mpssh"
end

#cpeObject



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

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

#versionObject



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

def version()
  return nil if @banner.nil?
  match = @banner.match(/mpSSH_(\d+[\.\d+]+(p)?(\d+)?)/i)
  return nil if match.nil?
  return Mpssh::Version.new(match[1])
end