- title: Hijack legit RDP session to move laterally
id: 52753ea4-b3a0-4365-910d-36cff487b789
status: experimental
description: Detects the usage of tsclient share to place a backdoor on the RDP
source machine's startup folder
date: 2019/02/21
author: Samir Bousseaden
logsource:
product: windows
service: sysmon
category: null
detection:
selection:
EventID: 11
Image: '*\mstsc.exe'
TargetFileName: '*\Microsoft\Windows\Start Menu\Programs\Startup\\*'
condition: selection
falsepositives:
- unknown
level: high
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-sysmon-*', doc_type='doc')
In [ ]:
s = searchContext.query('query_string', query='(event_id:"11" AND process_path.keyword:*\\mstsc.exe AND TargetFileName.keyword:*\\Microsoft\\Windows\\Start\ Menu\\Programs\\Startup\\*)')
response = s.execute()
if response.success():
df = pd.DataFrame((d.to_dict() for d in s.scan()))
In [ ]:
df.head()