← Back to Explore
sigmamediumHunting
Potential Suspicious PowerShell Module File Created
Detects the creation of a new PowerShell module in the first folder of the module directory structure "\WindowsPowerShell\Modules\malware\malware.psm1". This is somewhat an uncommon practice as legitimate modules often includes a version folder.
Detection Query
selection:
TargetFilename|endswith:
- \\WindowsPowerShell\\Modules\\*\.ps
- \\WindowsPowerShell\\Modules\\*\.dll
condition: selection
Author
Nasreddine Bencherchali (Nextron Systems)
Created
2023-05-09
Data Sources
windowsFile Events
Platforms
windows
References
Tags
attack.persistence
Raw Content
title: Potential Suspicious PowerShell Module File Created
id: e8a52bbd-bced-459f-bd93-64db45ce7657
status: test
description: Detects the creation of a new PowerShell module in the first folder of the module directory structure "\WindowsPowerShell\Modules\malware\malware.psm1". This is somewhat an uncommon practice as legitimate modules often includes a version folder.
references:
- Internal Research
- https://learn.microsoft.com/en-us/powershell/scripting/developer/module/understanding-a-windows-powershell-module?view=powershell-7.3
author: Nasreddine Bencherchali (Nextron Systems)
date: 2023-05-09
tags:
- attack.persistence
logsource:
category: file_event
product: windows
detection:
selection:
TargetFilename|endswith:
# Note: Don't include PowerShell 7 as it has default modules that don't follow this logic
- '\\WindowsPowerShell\\Modules\\*\.ps'
- '\\WindowsPowerShell\\Modules\\*\.dll'
condition: selection
falsepositives:
- False positive rate will vary depending on the environments. Additional filters might be required to make this logic usable in production.
level: medium