logoalt Hacker News

novafunc • yesterday at 12:48 PM • 3 replies • view on HN

I used to think the same, but apparently there's a way to differentiate between curling into bash and curling into a text file.

So you could be diligent and curl into a text file, see nothing is wrong, but then when you curl into bash, it runs something different.


Replies

zahlman • yesterday at 11:48 PM

Being diligent means that you curl into a text file, see nothing is wrong, and then run the file instead of curling again.

vladvasiliu • yesterday at 1:35 PM

I think the difference people were warned about is that the server can infer the client, so there would be a difference between reading it in your regular browser and curling. As the other commenter says, I'm not sure how the server would be able to tell what curl does with the response.

wolttam • yesterday at 1:15 PM

    curl > some_file
    bash some_file
(Also, how in the world would a server be able to tell where you’re piping the response?)

Edit: thanks for the replies, that makes perfect sense

➕ show 2 replies