News for hackers. Stuff that matters.
Re:Curl doesn’t spew binary anymore by agentgt on Saturday June 17, 2017 @07:48AM (#14575449)
I have wondered if there are security hazards to piping binary to your terminal.

I guess what really bad things can happen (and no I'm not talking about blindly piping to a shell to eval)?

Sure it messes up the terminal of which I usually type clear and/or reset. If it's really bad I usually just kill the terminal.

Re:Curl doesn’t spew binary anymore by jwilk on Saturday June 17, 2017 @07:56AM (#14575485)
Many terminal emulators are not very good at dealing with unstrusted input.

http://www.openwall.com/lists/oss-security/2017/05/01/13

Re:Curl doesn’t spew binary anymore by tyingq on Saturday June 17, 2017 @11:41AM (#14576332)
There used to be some terminal emulators that supported "screen dump", where the scrollback buffer would be written to an arbitrary named file.

echo -e "\ec\n\e]55;/tmp/ouch.php\a"

I believe they've all removed that functionality by now, but there might be some older copies around here and there.

Re:Curl doesn’t spew binary anymore by eigengrau on Saturday June 17, 2017 @11:56AM (#14576393)
IIRC, another angle that has been proposed is to switch between the primary and secondary terminal buffers. This way, one could create a file that looks harmless when piped to the terminal but contains a hidden, malicious payload. The victim would, after manual inspection, finally pipe the file to a shell, where the payload would do something evil.
Re:Curl doesn’t spew binary anymore by joombaga on Saturday June 17, 2017 @02:53PM (#14577184)
> The victim would, after manual inspection, finally pipe the file to a shell

Why would anyone do this? If I see some unknown, interesting file, I might run cat, head, tail, less or vim on it. If it's binary then maybe I'll use xxd. But it wouldn't even occur for me to pipe it to a shell.

Re:Curl doesn’t spew binary anymore by lathiat on Saturday June 17, 2017 @05:16PM (#14577783)
As people tend to re-use shell commands, editing them as they go, I can totally see someone doing like curl XX | less and then curl XX | sh or something. If the download is relatively speedy.

You could argue this is one of the reasons less doesn't interpret control codes by default. As it would let applications hide stuff like that to redraw the screen.

Re:Curl doesn’t spew binary anymore by Dylan16807 on Saturday June 17, 2017 @06:07PM (#14577934)
You could use the script command. (Which is also very helpful for running screen under su.)