Security log: logon via RDP
At night, the file server (with RDP access open) triggered an alert about suspicious activity. The analyst exported the Security log with wevtutil qe Security /f:xml and packaged it into security.xml (a root <Events> element was added, each <Event> is a separate event). The log contains 4624 (successful logon), 4625 (failed logon), 4672 (special privileges), and 4688 (process created, with CommandLine) events.
The server is directly exposed to the internet. Botnets have been brute-forcing passwords, so the log is noisy. Your task is to find the session that SUCCESSFULLY logged in via Remote Desktop (LogonType 10) from a public (external) IP address, and then read the command lines of the processes launched in that exact session (TargetLogonId = SubjectLogonId).
The attacker executed several commands in that session, in one of which they wrote the text they needed to a file in base64 format. Decode the text. Similar base64 commands also appear in other sessions — they are unrelated to this incident. Flag format: BAYROQ{...} (the last 16 characters are lowercase hexadecimal digits).