Live data from Hacker News

Opening *.txt file is dangerous on Windows

technet.microsoft.com

41–50 of 52 posts

Re: Opening *.txt file is dangerous on Windows

#41
This reminds me of hacking ANSI.SYS escape sequences back in the day. You could create a text file which would be "executed" when someone entered "type readme.txt" at the DOS prompt, by using keyboard remappings and so on.

I remember creating a fairly unsuccessful "text file virus" that would try to copy itself around our school network and reboot people's machines. Good times...

Re: Opening *.txt file is dangerous on Windows

#42
post #40

Earlier quoted context omitted.

Except that LD_LIBRARY_PATH is not a type of exploit and shouldn't be mentioned as such.

Not in itself, but if you can manage to change it for someone without their awareness you have basically tricked them into running arbitrary (local) code.

[deleted]

Re: Opening *.txt file is dangerous on Windows

#43
post #40

Earlier quoted context omitted.

Except that LD_LIBRARY_PATH is not a type of exploit and shouldn't be mentioned as such.

Not in itself, but if you can manage to change it for someone without their awareness you have basically tricked them into running arbitrary (local) code.

The thing is that someone has to execute some code to change it, and if so then malicious code has already been run. By then it is irrelevant if LD_PRELOAD_PATH will be used or not. If I trick you into running 'rm -fR *', does that count as an exploit?

Re: Opening *.txt file is dangerous on Windows

#45
post #40

Earlier quoted context omitted.

Not in itself, but if you can manage to change it for someone without their awareness you have basically tricked them into running arbitrary (local) code.

The thing is that someone has to execute some code to change it, and if so then malicious code has already been run. By then it is irrelevant if LD_PRELOAD_PATH will be used or not. If I trick you into running 'rm -fR *', does that count as an exploit?

You're absolutely right. Once you've managed to change the preload path, all is lost anyway. Sorry for the confusion.

Re: Opening *.txt file is dangerous on Windows

#46

The report says this vulnerability is specific to remote network shares and WebDAV. All you have to do is send someone a link to a .txt file on a WebDAV site with a .dll in the same directory, I guess, and they'll be owned... That is pretty awesome. (As was commented on below, this is identical to an LD_LIBRARY_PATH type exploit on Linux; here is Microsoft's fix as well as an explanation of how it works http://suppor…

Except that LD_LIBRARY_PATH is not a type of exploit and shouldn't be mentioned as such.

It would be identical to an exploit wherein some distro, for some reason, included . in the default LD_LIBRARY_PATH. Fortunately, I know of none that do this.

Re: Opening *.txt file is dangerous on Windows

#47
post #46

Earlier quoted context omitted.

Except that LD_LIBRARY_PATH is not a type of exploit and shouldn't be mentioned as such.

It would be identical to an exploit wherein some distro, for some reason, included . in the default LD_LIBRARY_PATH. Fortunately, I know of none that do this.

I know of no distros that set a default LD_LIBRARY_PATH, period.

Re: Opening *.txt file is dangerous on Windows

#48
post #21

Earlier quoted context omitted.

Doesn't sound too difficult if you're sending someone an archive with both files in it.

This only works on remote file systems, so you just have to send someone a link to a text file. There would be no indication that a DLL even exists on the target FS.

This apparently works on local directories also. However, either on remote or local, you have to set the working directory before making the "open" action.

Therefore I am not sure a direct link would do the trick (can you change the working dir using an URL and then point to the file ? I m not sure)

Anyway, the DLL does not have to be visible for the trick to work.

Re: Opening *.txt file is dangerous on Windows

#49
post #40

Earlier quoted context omitted.

Not in itself, but if you can manage to change it for someone without their awareness you have basically tricked them into running arbitrary (local) code.

The thing is that someone has to execute some code to change it, and if so then malicious code has already been run. By then it is irrelevant if LD_PRELOAD_PATH will be used or not. If I trick you into running 'rm -fR *', does that count as an exploit?

"The thing is that someone has to execute some code to change it, and if so then malicious code has already been run."

Wrong. You could have at least googled "LD_PRELOAD exploit" before writing this.

Setting LD_PRELOAD does not require running your own code. A real life exploit using LD_PRELOAD took advantage of a weakness in telnet server that let the connecting client export environment variables (yup, even before logging on - no local login required). Write access to a directory visible by telnetd was enough to plant own malicious *.so and then gain root access by exporting LD_PRELOAD via telnet.

Re: Opening *.txt file is dangerous on Windows

#50
post #49

Earlier quoted context omitted.

The thing is that someone has to execute some code to change it, and if so then malicious code has already been run. By then it is irrelevant if LD_PRELOAD_PATH will be used or not. If I trick you into running 'rm -fR *', does that count as an exploit?

"The thing is that someone has to execute some code to change it, and if so then malicious code has already been run." Wrong. You could have at least googled "LD_PRELOAD exploit" before writing this. Setting LD_PRELOAD does not require running your own code. A real life exploit using LD_PRELOAD took advantage of a weakness in telnet server that let the connecting client export environment variables (yup, even before…

So, again, the exploit was that a telnet session was exporting environment variables. LD_PRELOAD_PATH was just a way to take advantage of the telnetd exploit, which might not be the only way. I think that naming it "The LD_PRELOAD_PATH exploit" is just misguiding.
Post reply on HN