Skip to content

Instantly share code, notes, and snippets.

@LevitatingBusinessMan
Last active July 11, 2022 07:34
Show Gist options
  • Select an option

  • Save LevitatingBusinessMan/1948b5e7f6c41428f4d71b3aa8f36c73 to your computer and use it in GitHub Desktop.

Select an option

Save LevitatingBusinessMan/1948b5e7f6c41428f4d71b3aa8f36c73 to your computer and use it in GitHub Desktop.
Challenge voor bruteforce demo les
#!/usr/bin/ruby
require "sinatra"
set :port, 1337
get "/" do
return <<-'EOF'
Welkom. Kun je dit kraken?
<form action="/login" method="post">
<input type="text" name="username"><br>
<input type="password" name="password"><br>
<input type="submit" value="Submit">
</form>
EOF
end
post "/login" do
username = params["username"]
password = params["password"]
return "Username incorrect" if username != ENV["USERNAME"]
return "Password incorrect" if password != ENV["PASSWORD"]
return "Het geheime woord is #{ENV["SECRET"]}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment