auditd: command chain
On the server, auditd (a rule for execve, key exec_log) was enabled. After the incident, a copy of /var/log/audit/audit.log (audit.log, about 3 hours) was taken: SYSCALL, EXECVE, CWD, PATH, PROCTITLE records as well as USER_AUTH, LOGIN, USER_START, USER_END records are mixed with many parallel sessions (ses=) and processes (pid/ppid); cron jobs are also logged.
The IDS identified the attacker's address: 203.0.113.77. After logging in with their account, the attacker used sudo — so uid/euid changes, while auid and ses do not change. Using several commands, the attacker wrote data in chunks to two hidden files under /dev/shm, then combined them with cat, decoded them, and output the result to a file under /var/tmp/. The decoded result is the flag.
Notes: if an argument contains a space, quotation mark, or special character, auditd records it in hex (a2=6563686F...); PROCTITLE does not store a long command in full; similar chains were also executed by other (legitimate) sessions — they are decoys; chunks may be written with an incorrect value and then overwritten, and overwritten again after the commands finish. Flag format: BAYROQ{...} (the last 16 characters are lowercase hexadecimal digits).