Score:1

Noexec vs chmod -R -x for malware interogation?

br flag

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?

Nikita Kipriyanov avatar
za flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.