Locating secondary stages
As we alluded to in the previous sections, often, the obvious malware or the initial binary we receive an alert for is not the only malicious binary on disk. Frequently, secondary executables are written that may not be immediately apparent.
In cases such as this, we can utilize PowerShell to gain a list of every file that has been written in the past day (or other period) to determine whether anything appears out of place or malicious:
You may have noted that we've both selected the full name of the files in question and loaded them into an array before printing them to screen. This is because we can utilize this for further processing.
Although, computationally speaking, it may be intensive, we can elect to bulk-compute SHA256 hashes with this list by piping the array to Get-FileHash
, although this is not necessarily recommended...