Beginner Ducks
WEB | 37 pts - 176 solves
Description: Hiiiii, welcome to ASIS CTF. We have ducks. Check them out http://ducks.asisctf.com:8000/. Download source-code from here.
Source code:
It's clear that this eval()
is dangerous, since it'll execute the python code that we pass to the ?what
parameter and return the result in the response. We can verify the vulnerability by running the code locally and passing to it the variable duckInABag
, which evaluates to: './images/e146727ce27b9ed172e70d85b2da4736.jpeg'
, so code will be:
and therefore show us the image.
There's some input filtering with the regex: [^A-Za-z\.]
; it will only accept letters and the dot symbol. So how can we read /flag.txt
if /
isn't allowed?
We can try to read the file descriptor properties. i.e: f.buffer.name
will evaluate to: /flag.txt
.
Last updated