{"id":"1139d2e2-84b1-4226-b445-354492eba8ba","title":"Usage Of Web Request Commands And Cmdlets - ScriptBlock","description":"Detects the use of various web request commands with commandline tools and Windows PowerShell cmdlets (including aliases) via PowerShell scriptblock logs","author":"James Pemberton / @4A616D6573","status":"test","level":"medium","date":"2019-10-24","modified":"2025-10-20","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":["Use of Get-Command and Get-Help modules to reference Invoke-WebRequest and Start-BitsTransfer."],"references":["https://4sysops.com/archives/use-powershell-to-download-a-file-with-http-https-and-ftp/","https://blog.jourdant.me/post/3-ways-to-download-files-with-powershell"],"source_path":"rules/windows/powershell/powershell_script/posh_ps_web_request_cmd_and_cmdlets.yml","source_sha256":"5ee23f49c8dc5ea222c6e4c4796f2327aa60850f78b1f1ff2152fc6219fa528a","source_url":"https://github.com/anpa1200/sigma/blob/b249e9683190cffdcaf188ccbfb90bf4759844e1/rules/windows/powershell/powershell_script/posh_ps_web_request_cmd_and_cmdlets.yml","license":"Detection Rule License 1.1","license_url":"https://github.com/SigmaHQ/Detection-Rule-License/blob/main/LICENSE.Detection.Rules.md","yaml":"title: Usage Of Web Request Commands And Cmdlets - ScriptBlock\nid: 1139d2e2-84b1-4226-b445-354492eba8ba\nrelated:\n    - id: 9fc51a3c-81b3-4fa7-b35f-7c02cf10fd2d\n      type: derived\nstatus: test\ndescription: Detects the use of various web request commands with commandline tools and Windows PowerShell cmdlets (including aliases) via PowerShell scriptblock logs\nreferences:\n    - https://4sysops.com/archives/use-powershell-to-download-a-file-with-http-https-and-ftp/\n    - https://blog.jourdant.me/post/3-ways-to-download-files-with-powershell\nauthor: James Pemberton / @4A616D6573\ndate: 2019-10-24\nmodified: 2025-10-20\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            - '[System.Net.WebRequest]::create'\n            - 'curl '\n            - 'Invoke-RestMethod'\n            - 'Invoke-WebRequest'\n            - ' irm ' # Space before and after to avoid false positives with 'irm' as a substring\n            - 'iwr '\n            # - 'Net.WebClient' # There are various other rules that cover this, so it is commented out\n            - 'Resume-BitsTransfer'\n            - 'Start-BitsTransfer'\n            - 'wget '\n            - 'WinHttp.WinHttpRequest'\n    filter:\n        Path|startswith: 'C:\\Packages\\Plugins\\Microsoft.GuestConfiguration.ConfigurationforWindows\\'\n    condition: selection and not filter\nfalsepositives:\n    - Use of Get-Command and Get-Help modules to reference Invoke-WebRequest and Start-BitsTransfer.\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/1139d2e2-84b1-4226-b445-354492eba8ba.json","kind":"sigma"}
