Skip to main content
Challenges Room: Ransomware
Xonalar Medium Ransomware analysis: weak key generation (hostname + time), RC4 and OOXML structure Solves: 4

Room: Ransomware

Author: CyberSamSU
Points
60

Room scenario. Files on a company accounting computer were locked with the .locked extension. The attacker's demand is a payment, but the incident response team found the sample (ransom.py). Specialists assessed this as weak key generation: the key is not random. Your task is to recover the key, decrypt the financial report (finance.xlsx) and find the audit code inside it.

Inside ransom_case.tar: evidence/*.locked (locked files; the header is the 4-byte SMX1, followed by the encrypted bytes), README_DECRYPT.txt, var/tmp/.svc/ransom.py (the source of the sample), var/log/syslog (local time, time zone in etc/timezone), etc/hostname. The mtime values of the tar files are in UNIX (UTC) time.

Tasks (answers are not submitted, each builds on the previous one):

  1. Task 1. How does ransom.py generate the key? Which hash, which part of it and which cipher (rc4) were used?
  2. Task 2. When did the encryption begin? Find the CRON line in syslog that started ransom.py (take the time zone into account), then by comparing the sample's wait before work (sleep) with the tar mtime values of the .locked files, find the window in which the time.time() value lies.
  3. Task 3. Compute the key for each second in the window and try to decrypt finance.xlsx.locked: with the correct key the result starts with PK\x03\x04 (ZIP).
  4. Task 4. Inside finance.xlsx (ZIP) there is xl/sharedStrings.xml. The value next to the escrow_ref label on the Audit sheet is the flag. Other rows (old/orphaned) are decoys.

Flag format BAYROQ{...} (the last 16 characters are lowercase hexadecimal). The hostname is the value in etc/hostname.

Attached files
ransom_case.tar Log in to download
Hints 3
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −6 pts Log in
Hint 2 −12 pts Log in
Hint 3 −18 pts Log in
To submit a flag, log in.

First solvers

1. Mirjaxon Qaxxarov 25.11.2026
2. Odam 25.11.2026
3. Asmaa Mottery 25.11.2026
4. 𝖛𝖊𝖑𝖐𝖆𝖓 28.11.2026