4 ms·
> You might be thinking "If I opened that in my browser, I would detect it being malicious!" Well, think again... One can have all sorts of fun with user-agen
by Mahn 11y ago
> You might be thinking "If I opened that in my browser, I would detect
it being malicious!"
Well, think again...
One can have all sorts of fun with user-agents, something that can
easily come to mind is verifying if the user-agent is from curl or wget,
and make them download the malicious file, if not,
redirect them to a legitimate file that looks like the original
output. Your browser would fool you then.
I can't decide whether this is evil, genius or disturbing. I don't typically copy paste curl commands, but it never occurred to me that even if you check the URL curl is pointing to with your browser that's no guarantee that the same script will be downloaded and parsed in the server.
- jamiesonbecker 11y agoOr you can just do it yourself if you don't trust the source (And if you don't, you should really ask yourself why you're engaging in this exercise at all anyway): download the file, review in vim (which will display esc sequences), and then execute that file with sh yourself.
- chrishepner 11y agoI wrote an mitmproxy script to do just this: https://github.com/chrishepner/sh-mitm https://github.com/chrishepner/sh-mitm The kind of vulnerabilities that are basically just subverting a user's trust are totally fascinating to me.