Manual Collection - File Artifacts Flashcards

1
Q
A

We need to collect file hashes of malicious attachments to perform reputation checks and implement defensive measures. Hashes are the output of a hashing algorithm, such as MD5 (Message Digest 5) or SHA (Secure Hash Algorithm). These algorithms will produce a unique string that is used to represent the file. If there is a single change to the file, such as editing a text file and changing one character, the hash will be completely different. You can read more about hashes here.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Hashes via PowerShell

A

It’s most likely that security analysts will be using the Windows OS for day-to-day work. File hashes can be retrieved using PowerShell with the get-filehash command. By default, this will generate a SHA256 hash.

We can also retrieve MD5 and SHA1 hashes using the get-filehash command with the -Algorithm switch.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
A

To make it easier, we can chain PowerShell commands using the ; character and retrieve all three hash values at once.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Hashes via Linux CLI

A

File hashes can be easily retrieved using the Linux command-line. The three commands we would use are;

sha256sum
sha1sum
md5sum

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Conclusion

A

Whilst typically generating MD5 and SHA1 hashes are enough to perform reputation searches online and take defensive measures within endpoint detection and response (EDR) platforms, some services such as Talos File Reputation require SHA256 hashes to perform checks against their databases. It’s useful to know how to generate all three both in Windows and Linux.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly