I've decided to play around dumping all process memory of couple utilities in order to find out, how much trace of sensitive info an attacker could theoretically obtain from app's memory.
I've found this one-liner for dump purposes:
grep rw-p /proc/$1/maps | sed -n 's/^\([0-9a-f]*\)-\([0-9a-f]*\) .*$/\1 \2/p' | while read start stop; do gdb --batch --pid $1 -ex "dump memory $1-$start-$stop.dump 0x$start 0x$stop"; done
Unfortunately, I do not use Bash fluently and faced with a lot of spawned by this script dump files(all about kilobytes sized).
So, my question is: how can I use
strings command line tool in order to grep all null terminated strings to one file?
So, I wrote something like this(goes in infinite loop without any result):
for f in *.dump; do strings $1 > foo.txt; done
I know, that this one liner is close to my goal, but I can't finally make it work.