Module "WEB requests". To get the flag, use cURL to download the file returned by '/download.php' in the above server

I downloaded this file and didn’t find the flag:

<title>301 Moved Permanently</title>
<h1>Moved Permanently</h1>
<p>The document has moved <a href=";&gt;here&lt;/a&gt;.&lt;/p&gt;
<address>Apache/2.4.29 (Ubuntu) Server at Port 80</address>

Where is the flag here?

Hey, what does the curl line look like?

Feel free to DM me the line you are using.

curl -O

Try it with no -O flag. And skip the domain name if you haven’t put it into the hosts file.

What does it mean?

Without -O flag it gives the same result.

So do ‘curl IP/download.php’

If you haven’t added the IP and domain name to the hosts file then how is linux going to know what inlanefreight is?


<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<address>Apache/2.4.29 (Ubuntu) Server at Port 80</address>

So I think there’s some problem with this task in HTB Academy.

Try resetting the target machine and give it another go.

Just did it. The same result.

Thanks for the help anyway.

Did you reset your pwnbox too?


OK. I solved the problem. It was necessary to enter the target IP and not the URL which was mentioned in the text.
Thank you for your time.

Hey no worries. I was kinda thinking that was implied haha.

Definitely keep the /etc/hosts file in mind you will need to understand it in future modules. As an example, if you had added the IP and domain name to the hosts file:
Then your previous command would have worked. Because the machine would have checked the hosts file in its search to translate that domain into an IP address. This may not make sense now, but it will soon.

Hope that helps you in the future. Keep at it!


It didn’t work for me, I didn’t find the flag (
what command did you end up using?

What command did you use?
Did you connect to the target before this?


connect to the target machine;
make sure to add the port with the ip address of the target machine,
like so;
curl ip:port/download.php --remote-name

you will get the flag.
it will be downloaded into the current folder you are or your root folder.

1 Like

trying to add but permission was denied…