Module: Rex::Parser::NetSarang

Defined in:
lib/rex/parser/netsarang.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)

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

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)

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

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