Windows event log ยท Microsoft-Windows-TerminalServices-RDPClient/Operational1029 RDP (outgoing connection)
CyberChef recipes to calculate the same encoded value from a known username
- Remote access
- 2 fields
Microsoft-Windows-TerminalServices-RDPClient%4Operational.evtxMicrosoft-Windows-TerminalServices-ClientActiveXCore
Notes
- CyberChef recipes to calculate the same encoded value from a known username
- OS : Windows 7 / Windows Server 2008 R2
- Hash : Base64(SHA1(UserName))
- Example:
- Input = administrator
- Output = /6UN2Oco6V2sEKuooAIuzrrOUrk=
- OS : Windows 10
- Hash : Base64(SHA256(UserName))
- Output = WAlZ81aqzLQmoWEfQivmPQwJxIm/XQcDjplQdjznr5E=
- If you need to decode a large number of encoded values, try my recipe for CyberChef. These are the steps to follow:
- 1) Copy and paste the following recipe into CyberChef:
- Compact JSON:
- [{"op":"Unique","args":["Line feed"]},{"op":"Fork","args":["\\n","\\n",false]},{"op":"Find / Replace","args":[{"option":"Regex","string":"-\\\\-"},"",true,false,true,false]},{"op":"Find / Replace","args":[{"option":"Regex","string":"(User Name|Payload Data.|Target: |Target \\(encoded\\).*| \\(S\\-.*\\)|NETWORK SERVICE)"},"",true,false,true,false]},{"op":"Find / Replace","args":[{"option":"Regex","string":"(^.*\\\\|S-[0-9\\-]*)"},"",true,false,true,false]},{"op":"Register","args":["([\\s\\S]*)",true,false,false]},{"op":"Decode text","args":["UTF-8 (65001)"]},{"op":"Encode text","args":["UTF-16LE (1200)"]},{"op":"SHA1","args":[],"disabled":true},{"op":"SHA2","args":["256"]},{"op":"From Hex","args":["Space"]},{"op":"To Base64","args":["A-Za-z0-9+/="]},{"op":"Register","args":["([\\s\\S]*)",true,false,false]},{"op":"Find / Replace","args":[{"option":"Simple string","string":"$R1"},"$R1,$R0",true,false,true,false]},{"op":"Merge","args":[]},{"op":"Unique","args":["Line feed"]},{"op":"Sort","args":["Line feed",false,"Alphabetical (case insensitive)"]},{"op":"To Table","args":[",","\\r\\n",false,"HTML"]}]
- 2) From CyberChef, disable or remove the hash operation (SHA1 or SHA2) that you don't need
- 3) From Timeline Explorer:
- - Column "User Name" : copy all the non-blank values
- - Column "Payload Data1": copy all the values containing "Target:"
- 4) Paste what you just copied into the input area of CyberChef (no need to clean or dedupe the input before pasting)
- 5) Bake!
- Articles:
Fields EvtxECmd extracts
2 columns in the EvtxECmd CSV
- PayloadData1
Target (encoded): %Base64RDPUserNameHash%- %Base64RDPUserNameHash% = /Event/EventData/Data[@Name="TraceMessage"]
- PayloadData6
ActivityID: %ActivityID%- %ActivityID% = /Event/System/Correlation/@ActivityID
Sample event
Event XML from the map file
<Event>
<System>
<Provider Name="Microsoft-Windows-TerminalServices-ClientActiveXCore" Guid="28aa95bb-d444-4719-a36f-40462168127e"/>
<EventID>1029</EventID>
<Version>0</Version>
<Level>4</Level>
<Task>101</Task>
<Opcode>10</Opcode>
<Keywords>0x4000000000000000</Keywords>
<TimeCreated SystemTime="2020-11-28 10:17:20.4692527"/>
<EventRecordID>7</EventRecordID>
<Correlation ActivityID="cd839c41-3564-4fb9-afdd-e4b3abba0000"/>
<Execution ProcessID="2988" ThreadID="1068"/>
<Channel>Microsoft-Windows-TerminalServices-RDPClient/Operational</Channel>
<Computer>IEWIN7</Computer>
<Security UserID="S-1-5-21-3583694148-1414552638-2922671848-1000"/>
</System>
<EventData>
<Data Name="TraceMessage">q2iIC1HjphTQfGcYqIwX0kR5WjQ=-</Data>
</EventData>
</Event>References
6 links
- nullsec.usWindows Event ID 1029 Hashes(opens in new tab)
- gchq.github.ioRecipe(opens in new tab)
- cyber-tls.blogspot.com/2019/08/rdp.html(opens in new tab)
- social.technet.microsoft.com/wiki/contents/articles/37847.rdp-direct-connection-with-nla-remote-desktop-client-event-logs.aspx(opens in new tab)
- nullsec.us/windows-rdp-related-event-logs-the-client-side-of-the-story/(opens in new tab)
- github.com/nasbench/EVTX-ETW-Resources/blob/main/ETWProvidersCSVs/Internal/Microsoft-Windows-TerminalServices-ClientActiveXCore.csv(opens in new tab)
Source: evtx/Maps/Microsoft-Windows-TerminalServices-RDPClient-Operational_Microsoft-Windows-TerminalServices-ClientActiveXCore_1029.map(opens in new tab) by Gabriele Zambelli @gazambelli and contributors(opens in new tab), MIT License(opens in new tab)