Page Background Animation
484 words
2 minutes
1337 Local CTF — DFIR Track Architecture & Solutions

1337 Local CTF — DFIR Track Architecture & Solutions#

1337 Local CTF

Organized by Ismail Larhrib (Sphynx) alongside fellow members of Team MIR4GE, the 1337 Local CTF was an internal competition hosted for the student and security community at 1337 Coding School (UM6P / 42 Network).

The DFIR (Digital Forensics & Incident Response) track was designed to simulate realistic defensive and forensic workflows rather than artificial CTF puzzles.

Challenge Matrix#

#ChallengeFocus AreaDifficultyPoints
01Traffic & Forensics Analysis (Tbrgig)Network Forensics & Web TriageEasy100
02The Encrypted CallbackTLS 1.3 Decryption & XOR StreamsHard300
03Inception.NET Malware & Anti-Analysis ReversingHard400
04The CNSS PhishRFC 822 Email Headers & DeobfuscationMedium200
05The Boss LevelEnd-to-End Enterprise Breach InvestigationExtreme500

Challenge Writeups#

01 — Traffic & Forensics Analysis (Tbrgig)#

  • Scenario: SOC sensors detected port reconnaissance and anomalous HTTP requests against an internal server (10.0.0.10).
  • Investigation Steps:
    1. Filtered for ICMP sweeps and TCP SYN scans in Wireshark to establish the attacker IP.
    2. Identified directory traversal attempts targeting Apache configuration and leaking .env.
    3. Carved the transferred ZIP archive (bocal.zip) directly from HTTP payload streams.
    4. Used binwalk to uncover and extract trailing steganographic bytes appended to the archive.
  • Flag: leet{W1r3sh4rk_k1wsl_lh4dr4_lmz47a}

02 — The Encrypted Callback#

  • Scenario: EDR triggered on suspicious in-memory PowerShell execution. Active TLS session keys were extracted from LSASS memory (sslkeylog.log).
  • Investigation Steps:
    1. Configured Wireshark ((Pre)-Master-Secret log filename) with the dumped sslkeylog.log to decrypt TLS 1.3 encrypted payloads.
    2. Extracted and decoded a Base64 UTF-16LE encoded PowerShell dropper script.
    3. Unpacked stage 2 AES-CBC encrypted binaries from the decrypted HTTP conversation.
    4. Reverse-engineered a 4-layer obfuscated exfiltration algorithm (Base64 -> Reverse -> Hex -> XOR).
  • Flag: leet{Waaaaa_tchhbaarklaah}

03 — Inception (.NET Dropper Reversing)#

  • Scenario: Finance department targeted by a suspicious binary disguised as invoice.exe.
  • Investigation Steps:
    1. Loaded invoice.exe into dnSpy / ILSpy for C# decompilation.
    2. Identified and bypassed anti-analysis routines (Debugger.IsAttached and anti-VM timing loops).
    3. Located encrypted embedded resource streams (enc_payload.bin) reflectively loaded via Assembly.Load().
    4. Reverse-engineered the rolling XOR key schedule implemented in the dynamically invoked assembly.
  • Flag: leet{n3t_r3fl3ct10n_m4lw4r3_r3v3rs1ng}

04 — The CNSS Phish#

  • Scenario: Targeted spear-phishing campaign impersonating national social security (CNSS) security advisories.
  • Investigation Steps:
    1. Parsed RFC 822 email headers (.eml), verifying SPF SoftFail flags and tracing intermediate Received: gateway hops.
    2. Extracted the true adversary relay IP (198.51.100.42), which served as the archive extraction key.
    3. Unzipped the password-protected document attachment containing phishing credential harvesting scripts.
    4. Deobfuscated hexadecimal string escapes in JavaScript to expose the exfiltration backend and capture flag.
  • Flag: leet{Bghaw_idrbo_lina_cnss_(ra_derboha)}

05 — The Boss Level (Full-Spectrum Incident)#

  • Scenario: A simulated advanced persistent threat (APT) intrusion scenario involving weaponized phishing lures, encrypted stage delivery, sandbox evasion, and dynamic C2 memory beacons.
  • Investigation Steps:
    1. Correlated email lure headers with packet capture (capture.pcap) sessions.
    2. Extracted the multi-part encrypted payload invoice.enc over anomalous HTTP ports.
    3. Derived the XOR key from the lure staging script and decrypted the raw payload.
    4. Decompressed Base64 + zlib Python loaders and patched out virtual environment detection hooks.
    5. Decrypted runtime memory structures containing the primary C2 command server and master flag.
  • Flag: leet{hlkk_Ai_awled_3ami}
  • Network Forensics: Wireshark, TShark, NetworkMiner, Zeek
  • Malware Analysis & Reversing: dnSpy, ILSpy, Ghidra, x64dbg, CyberChef
  • Log & Header Triage: EML Analyzer, Volatility 3, Sysmon, Splunk

Credits & Organization#