Class: NatasLevel0

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

Overview

Level 0

Constant Summary collapse

LEVEL =
0
PASSWORD =
'natas0'
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, #level, #post

Constructor Details

#initializeNatasLevel0

Returns a new instance of NatasLevel0.



123
124
125
126
# File 'lib/natas.rb', line 123

def initialize(*)
  super
  @password = PASSWORD
end

Instance Method Details

#execObject



128
129
130
131
132
133
134
# File 'lib/natas.rb', line 128

def exec
  log("Parsing the page: #{PAGE}")
  data = get('/').body
  match = /<!--The password for natas1 is (\w{32}) -->/.match(data)
  not_found unless match
  found(match[1])
end