Obfuscated PowerShell: static analysis
A sync.ps1 script that runs daily at 02:00 via a scheduled task on the accounting server was found. At first glance, it looks like an 'invoice synchronization' module, but most of its text consists of numbers and quoted fragments. The analyst decided to never execute the script — it should only be read as text and decoded with Python.
The script uses common obfuscation techniques: splitting and concatenating strings, scrambling order with the -f (format) operator, character codes ([char]) and -join, a shifted list of numbers, and one layer nested inside another. The script contains two encoded payloads, but only one of them is actually executed; additionally, unused 'legacy' code remains in the inner layer.
The script ultimately prints a token: ... string. Find this actually printed value using static analysis. Flag format: BAYROQ{...} (the last 16 characters are lowercase hexadecimal digits).