Last active
July 11, 2022 07:34
-
-
Save LevitatingBusinessMan/1948b5e7f6c41428f4d71b3aa8f36c73 to your computer and use it in GitHub Desktop.
Challenge voor bruteforce demo les
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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