dissect.target icon indicating copy to clipboard operation
dissect.target copied to clipboard

Support multiple search patterns in target-shell find command

Open h0ckeyst1ck opened this issue 1 month ago • 2 comments

Hi! I came across a usecase where I want to check an image for multiple file extentions at once. After several attempts, I gave up trying and will now check for them one by one. It would be nice to use some kind of regex within the file command at target-shell. E.g. find (**.txt|**.png) Thanks in advance!

h0ckeyst1ck avatar Nov 11 '25 10:11 h0ckeyst1ck

Perhaps you could try to use target-fs <target> walk / and using command line tools to achieve this.

lhaagsma avatar Nov 12 '25 10:11 lhaagsma

The find command already has a -name and -iname argument (similar to the find you'd find in a real terminal). Both of these currently already accept a glob pattern.

While a single glob is currently too limiting to achieve exactly this, normally you'd use -name '*.txt' -name '*.png' with the real find, however it looks like our implementation doesn't currently accept multiple -name/-iname arguments, so that's something that could definitely be improved. I'll rename this issue to exactly that.

Schamper avatar Nov 12 '25 10:11 Schamper