htaccess
Last updated
Was this helpful?
Last updated
Was this helpful?
The site tells us that there are .htaccess files
that configure the permissions for /one/flag.txt
and /two/flag.txt
.
The .htaccess file for /one/flag.txt
looks like this:
That tells us if the Host header does not match the string 'localhost' the request is rewritten to be forbidden. Luckily we can simply set the Host header in our request to a value of our choice. Why not use 'localhost' then:
Let's examine the second .htaccess file:
This has a similar structure but contains a server variable: 'THE_REQUEST. Official apache documentation states:
This means we are not allowed to request anything that has the string 'flag' in it. Thus we simply replace the 'flag' part of the url by an URL encoded string