- title: Suspicious PowerShell Download
id: 65531a81-a694-4e31-ae04-f8ba5bc33759
status: experimental
description: Detects suspicious PowerShell download command
tags:
- attack.execution
- attack.t1086
author: Florian Roth
logsource:
product: windows
service: powershell
category: null
detection:
keywords:
Message:
- '*System.Net.WebClient).DownloadString(*'
- '*system.net.webclient).downloadfile(*'
condition: keywords
falsepositives:
- PowerShell scripts that download content from the Internet
level: medium
In [ ]:
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search
import pandas as pd
In [ ]:
es = Elasticsearch(['http://helk-elasticsearch:9200'])
searchContext = Search(using=es, index='logs-endpoint-winevent-powershell-*', doc_type='doc')
In [ ]:
s = searchContext.query('query_string', query='Message.keyword:(*System.Net.WebClient\).DownloadString\(* OR *system.net.webclient\).downloadfile\(*)')
response = s.execute()
if response.success():
df = pd.DataFrame((d.to_dict() for d in s.scan()))
In [ ]:
df.head()