Module: Rex::Parser::NetSarang

Defined in:
lib/rex/parser/net_sarang.rb

Defined Under Namespace

Classes: NetSarangCrypto

Instance Method Summary collapse

Instance Method Details

#parser_xfp(file) ⇒ version, ...

parser xfp session file

Parameters:

  • ini (String)

Returns:

  • (version, host, port, username, password)


98
99
100
101
102
103
104
105
106
# File 'lib/rex/parser/net_sarang.rb', line 98

def parser_xfp(file)
  ini = Rex::Parser::Ini.from_s(file)
  version = ini['SessionInfo']['Version']
  port = ini['Connection']['Port']
  host = ini['Connection']['Host']
  username = ini['Connection']['UserName']
  password = ini['Connection']['Password']
  [version, host, port, username, password]
end

#parser_xsh(file) ⇒ version, ...

parser xsh session file

Parameters:

  • ini (String)

Returns:

  • (version, host, port, username, password)


84
85
86
87
88
89
90
91
92
# File 'lib/rex/parser/net_sarang.rb', line 84

def parser_xsh(file)
  ini = Rex::Parser::Ini.from_s(file)
  version = ini['SessionInfo']['Version']
  port = ini['CONNECTION']['Port']
  host = ini['CONNECTION']['Host']
  username = ini['CONNECTION:AUTHENTICATION']['UserName']
  password = ini['CONNECTION:AUTHENTICATION']['Password'] || nil
  [version, host, port, username, password]
end