# web/finger-warmup @ DamCTF Oct. 2020
* challenge author: **babayet2*** solves: **405*** points: **160**
## Description
>A finger warmup to prepare for the rest of the CTF, good luck!>>You may find [this](https://realpython.com/python-requests/) or [this](https://programminghistorian.org/en/lessons/intro-to-beautiful-soup) to be helpful.
## Analysis
We are presented with a website whose sole content is a link.Clicking on that link brings redirects us to the same site, withanother link. From the description and the title, the intent isclear. We are going to have to automate the process of following thelinks until we get the flag.
### Solving
Since we were told to use requests/beautifulsoup, I chose to look into thoseand implement a solution with them.
My solution looks like this:
```python#!/usr/bin/env python3
import requestsfrom bs4 import BeautifulSoupfrom pwn import log
BASE_URL = "https://finger-warmup.chals.damctf.xyz/"
redirect = ""while True: log.info(f"Sending request to.. {BASE_URL}{redirect}")    response = requests.get(f"{BASE_URL}{redirect}") log.info(f"Received data: {response.text}")    soup = BeautifulSoup(response.text, "html.parser")
    try:        # find the next link        redirect = soup.find_all("a")[0].get("href")    except Exception:        # if we can't find a link, the flag has probably been found log.info("Done!")        exit(0)
```
Once the script is done, we see the following:
![solve.py](https://i.imgur.com/eQ6YzaF.png)