Last active
April 13, 2021 16:33
-
-
Save ShyftXero/fdb4020e0c2aa96f61e16f067e7acdce to your computer and use it in GitHub Desktop.
leaky starter code
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
import requests | |
import bs4 | |
# you are searching for a message that starts with 'FLAG{' and ends in '}' | |
url = 'https://leaky.shyft.us' | |
sess = requests.session() | |
ab = [chr(x) for x in range(0, 255) if chr(x).isprintable()] | |
print(ab) | |
flag = 'FLAG{' | |
end = '}' | |
solved = False | |
while solved == False: | |
for c in ab: | |
soup = bs4.BeautifulSoup(sess.get(url).text, 'html.parser') | |
csrf = soup.find(id='csrf_token').get('value') | |
d = sess.post(url, data={'q':flag+c, 'csrf_token':csrf}) | |
# What code can go here to reveal the entire flag? | |
if end in flag: | |
solved = True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment