{"id":"21f9162c-5f5d-4b01-89a8-b705bd7d10ab","title":"Import PowerShell Modules From Suspicious Directories","description":"Detects powershell scripts that import modules from suspicious directories","author":"Nasreddine Bencherchali (Nextron Systems)","status":"test","level":"medium","date":"2022-07-07","modified":"2023-01-10","tags":["attack.execution","attack.t1059.001"],"technique_ids":["T1059.001"],"logsource":{"product":"windows","category":"ps_script","definition":"Requirements: Script Block Logging must be enabled"},"falsepositives":["Unknown"],"references":["https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1003.002/T1003.002.md"],"source_path":"rules/windows/powershell/powershell_script/posh_ps_import_module_susp_dirs.yml","source_sha256":"2ea8a1757da1f5d801a19ffddac4f9365e953064ef2f5ddbcf2bf19f1cf3c945","source_url":"https://github.com/anpa1200/sigma/blob/b249e9683190cffdcaf188ccbfb90bf4759844e1/rules/windows/powershell/powershell_script/posh_ps_import_module_susp_dirs.yml","license":"Detection Rule License 1.1","license_url":"https://github.com/SigmaHQ/Detection-Rule-License/blob/main/LICENSE.Detection.Rules.md","yaml":"title: Import PowerShell Modules From Suspicious Directories\nid: 21f9162c-5f5d-4b01-89a8-b705bd7d10ab\nrelated:\n    - id: c31364f7-8be6-4b77-8483-dd2b5a7b69a3\n      type: similar\nstatus: test\ndescription: Detects powershell scripts that import modules from suspicious directories\nreferences:\n    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1003.002/T1003.002.md\nauthor: Nasreddine Bencherchali (Nextron Systems)\ndate: 2022-07-07\nmodified: 2023-01-10\ntags:\n    - attack.execution\n    - attack.t1059.001\nlogsource:\n    product: windows\n    category: ps_script\n    definition: 'Requirements: Script Block Logging must be enabled'\ndetection:\n    selection:\n        ScriptBlockText|contains:\n            - 'Import-Module \"$Env:Temp\\'\n            - Import-Module '$Env:Temp\\\n            - 'Import-Module $Env:Temp\\'\n            - 'Import-Module \"$Env:Appdata\\'\n            - Import-Module '$Env:Appdata\\\n            - 'Import-Module $Env:Appdata\\'\n            - 'Import-Module C:\\Users\\Public\\'\n            # Import-Module alias is \"ipmo\"\n            - 'ipmo \"$Env:Temp\\'\n            - ipmo '$Env:Temp\\\n            - 'ipmo $Env:Temp\\'\n            - 'ipmo \"$Env:Appdata\\'\n            - ipmo '$Env:Appdata\\\n            - 'ipmo $Env:Appdata\\'\n            - 'ipmo C:\\Users\\Public\\'\n    condition: selection\nfalsepositives:\n    - Unknown\nlevel: medium\n","validation":"yaml_parsed_not_backend_compiled_or_live_validated","techniques":[{"key":"enterprise/T1059.001","id":"T1059.001","name":"PowerShell","page":"techniques/enterprise/T1059.001/"}],"data_path":"data/detection-rules/21f9162c-5f5d-4b01-89a8-b705bd7d10ab.json","kind":"sigma"}
