1

I am setting up a Linux box to examine malware samples. I wanted to create a directory where I could safely unzip each sample and run very basic triage commands against the file to collect information about the sample (for example, hashing the sample). In order to make sure that I do not inadvertently execute the sample, I wanted to ensure that the directory contents is non-executable.

Is it safe to merely chmod -R -x the directory and its contents before examining or should I mount a separate partition using noexec? Functionally they accomplish the same thing, but is one preferable over the other (or both!) in the case of malware interrogation and why?

Lexicon
  • 247
  • 1
  • 2
  • 10
  • Your temporary directory should be always mounted `noexec,nosuid,nodev`. Just as a general security rule. And no, they don't accomplish the same thing. The files with `+x` attribute in the archive which stores this attribute (`tar`) should signify something; by removing an attribute prior to the sample analysis you lose a bit of information about the object. – Nikita Kipriyanov Nov 03 '21 at 08:37

0 Answers0