Class: NatasLevel8
- Inherits:
-
NatasLevelBase
- Object
- NatasLevelBase
- NatasLevel8
- Defined in:
- lib/natas.rb
Overview
Level 8
Constant Summary collapse
- LEVEL =
8
Constants inherited from NatasLevelBase
NatasLevelBase::HOST, NatasLevelBase::LOGIN, NatasLevelBase::PASSWORD_LENGTH, NatasLevelBase::PORT, NatasLevelBase::WEBPASS
Instance Attribute Summary
Attributes inherited from NatasLevelBase
Instance Method Summary collapse
Methods inherited from NatasLevelBase
#get, #initialize, #level, #post
Constructor Details
This class inherits a constructor from NatasLevelBase
Instance Method Details
#exec ⇒ Object
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 |
# File 'lib/natas.rb', line 274 def exec data = get('/index-source.html').body match = /\$encodedSecret = "(\w{32})";/.match(data) not_found unless match secret = Base64.decode64([match[1]].pack('H*').reverse) data = post( '/', {}, { 'submit' => '', 'secret' => secret } ).body match = /The password for natas9 is (\w{32})/.match(data) not_found unless match found(match[1]) end |