I'd like to determine where a certain app (as an example, surf) writes to the filesystem in order to make sure it leaves no traces. Without a dedicated sandboxing system this probably isn't easy, but I'm wondering if there is a better way than simply using strace.
For example here is a simple script called run:
#!/bin/bash
mkdir history
echo foo bar > history/hist.db
echo hello > test
I run strace like this:
strace ./run 2>&1 | sed -n '/^open.*WRONLY/p' | sed 's/.*"\(.*\)"[^"]*$/\1/'
to see all the files (but not directories) that were written (I don't think this will capture files that were created, but not written to, like those created by touch). Output:
history/hist.db
test
Is there a better way to do this, since this gets unwieldy for anything besides trivial applications, or are there options I can pass to strace (or better regexes maybe?) that make this a bit more robust? Do I run the risk of missing files that are written to the filesystem?