News for hackers. Stuff that matters.
Re:Don't run 'strings' on untrusted files by malka on Saturday October 25, 2014 @01:54PM (#8508836)
even on 'valid' binaries, it still tends to mess up your terminal. I noticed that pretty quickly when I started working with Linux. Are there really people that work with cat and grep on binaries files ?
Re:Don't run 'strings' on untrusted files by theoh on Saturday October 25, 2014 @02:02PM (#8508864)
Perhaps not intentionally, but cat has valid uses for concatenating binary files and sometimes they end up going to the terminal just by accident. As far as grep goes, the answer to your question is "yes": http://stackoverflow.com/questions/9988379/how-to-grep-a-tex...
Re:Don't run 'strings' on untrusted files by panzi on Saturday October 25, 2014 @10:18PM (#8510073)
Of course you can use grep on binaries perfectly save, if you just don't print all the results to the terminal. Use `grep -lr <pattern> <dir>` to find binaries that contain a certain pattern, use `grep --byte-offset --only-matching --text <pattern> <file>` to find the offsets in a file.
Re:Don't run 'strings' on untrusted files by ams6110 on Saturday October 25, 2014 @04:38PM (#8509310)
Grep even explicitly supports it with the -a (--text) option that forces it to treat a binary file as text.