class NatasLevel4

Level 4

Constants

LEVEL
PAGE

Public Instance Methods

exec() click to toggle source
# File lib/natas.rb, line 188
def exec
  referer = URI::HTTP.build(
    host: "natas5.#{HOST}",
    path: '/'
  )

  log("Setting the Referer HTTP header: #{referer}")
  log("Parsing the page: #{PAGE}")
  data = get(
    PAGE,
    {
      'Referer' => referer.to_s
    }
  ).body

  match = /The password for natas5 is (\w{32})/.match(data)
  not_found unless match
  found(match[1])
end