News for hackers. Stuff that matters.
Re:Don't run 'strings' on untrusted files by avian on Saturday October 25, 2014 @12:26PM (#8508602)
I'm a regular user of this utility and this came as a complete surprise to me. So much so that I checked the source myself before believing the article.

I thought "strings" was just a dumb scan over the file. Does this mean that with a properly crafted binary it is also possible to hide strings from a quick check with "strings"?

Re:Don't run 'strings' on untrusted files by eli on Saturday October 25, 2014 @01:06PM (#8508720)
Yes, though a properly crafted binary has always been able to hide from strings with even a minimal amount of obfuscation or encryption. There's no way to know all the strings a program can output without running it.
Re:Don't run 'strings' on untrusted files by avian on Saturday October 25, 2014 @01:44PM (#8508807)
Of course, a properly crafted program can always arbitrarily obfuscate strings.

But if you manage to trick libbfd into thinking it's looking at a particular format, you can hide plain text from a simple "strings" invocation even in files that are not executable. I've been using "strings" on all kinds of files, not only executables, and assumed that it will always display all sequences of printable characters present in the file.

Re:Don't run 'strings' on untrusted files by eli on Saturday October 25, 2014 @01:56PM (#8508845)
Ah, I see. Fair enough, but I don't think it was ever a great assumption that "strings" would uncover all the text in a file. There are so many ways to screw with a file at the byte level that could confuse "strings" but still appear fine when read by an application.
Re:Don't run 'strings' on untrusted files by revelation on Saturday October 25, 2014 @03:08PM (#8509029)
If you solve the problem of determining all output strings of a given program with running it, please leave a message ;)
Re:Don't run 'strings' on untrusted files by chime on Saturday October 25, 2014 @03:30PM (#8509108)
Re:Don't run 'strings' on untrusted files by repsilat on Saturday October 25, 2014 @03:40PM (#8509151)
Sure, you can reduce it down to the Halting Problem, but it's much simpler just to invoke Rice's Theorem.

http://en.wikipedia.org/wiki/Rice's_theorem

Re:Don't run 'strings' on untrusted files by saurik on Saturday October 25, 2014 @08:56PM (#8509947)
This tool has always, going way back to at least BSD 4.3 (if not earlier), been a tool for dumping the strings table of a binary object, which just so happened to also have a fallback mode for things it didn't know how to parse as an object file.
Re:Don't run 'strings' on untrusted files by gwern on Saturday October 25, 2014 @12:47PM (#8508666)
Based on the man page, I'm going to guess yes:

       -a
       --all
       -   Do not scan only the initialized and loaded sections of object files; scan the whole files.
Both the name and description imply that by default it won't scan the whole thing.