CARTRIDGE · CYBER SERIES
Cyber Series 2660 words · 13 minutes views

Road to CTF Master Level II

IMPORTANT

หลังจากที่คุณผ่านบทเรียนแรกในปราสาทลอยฟ้ามาได้ ชายชราในเสื้อคลุมสีฟ้าก็พาคุณเดินผ่านระเบียงหินยาวไปยังหอคอยที่ปกคลุมด้วยน้ำแข็งใสราวกระจก “บทต่อไปของเจ้า” เขากล่าวพลางเปิดประตูบานหนัก “คือศาสตร์ของผู้เฝ้ามอง · ฝ่ายตั้งรับ เจ้าจะได้เรียนรู้ที่จะ ‘มองเห็น’ สิ่งที่คนอื่นมองไม่เห็น ได้ยินเสียงกระซิบของผู้บุกรุกก่อนที่เขาจะลงมือ” ห้องโถงสว่างวาบด้วยแผงคริสตัลนับร้อย · แต่ละแผงฉายภาพเหตุการณ์ที่กำลังเกิดขึ้นทั่วทั้งอาณาจักร เจ้าหายใจเข้าลึก ๆ การฝึกฝนวิชา Blue Team ของเจ้ากำลังจะเริ่มต้นแล้ว

สวัสดีครับทุกคน ยินดีต้อนรับสู่ Road to CTF Master Level II#

เขียนโดยผมเอง Ar3mus#

ใน Level I เราได้ทำความรู้จักกับโลกของ CTF, รูปแบบการแข่ง, และ Road Map สายไซเบอร์กันไปแล้ว · ในตอนนี้เราจะดำดิ่งลงไปในสายที่ผมว่าหลายคนมองข้าม แต่จริง ๆ แล้ว “ลึก” และ “สนุก” ไม่แพ้สายรุก นั่นคือ Blue Team ครับ

NOTE

บล็อกที่อยู่ใน :::important คือเนื้อเรื่องนิยายที่แต่งขึ้นเพื่อดำเนินเรื่องของซีรีย์นี้ ส่วนเนื้อหาความรู้จริง ๆ จะอยู่นอกบล็อกเหล่านี้นะครับ

WARNING

ย้ำเหมือนเดิม · เนื้อหาส่วนเล่าเรื่องเป็นการสวมบทบาทเฉย ๆ เราไม่ได้กลายเป็นจอมเวทตัวจริง ☠ แต่ถ้าใครดื่มน้ำยาแล้วใช้เวทย์ได้จริงก็ติดต่อผมด้วยนะ เดี๋ยวผมไปต่างโลกทันที 555

❄ Blue Team#

IMPORTANT

“จงจำไว้” ชายชรากล่าว “ฝ่ายรุกต้องการแค่ช่องเดียวเพื่อทะลวงเข้ามา · แต่ฝ่ายรับต้องเฝ้าทุกช่อง ทุกประตู ทุกหน้าต่าง ตลอดเวลา นั่นคือเหตุผลที่ผู้เฝ้ามองที่แท้จริงนั้นหายาก… และมีค่ายิ่งกว่าทอง”

Blue Team คือฝ่าย “ตั้งรับ” · คนที่คอยเฝ้าระวัง ตรวจจับ ตอบสนอง และกู้คืนระบบจากภัยคุกคาม ถ้าฝ่าย Red Team เปรียบเหมือนโจรที่หาทางเข้าบ้าน Blue Team ก็คือเจ้าของบ้าน + ยาม + นักสืบ + หน่วยกู้ภัย รวมอยู่ในคนเดียว

ในโลกการทำงานจริง Blue Team ครอบคลุมหลายบทบาท เช่น:

  • SOC Analyst · นั่งเฝ้าจอ คอยดู alert จาก SIEM แล้ว triage ว่าอันไหนคือภัยจริง อันไหน false positive
  • Incident Responder (DFIR) · เมื่อเกิดเหตุ ต้องเข้าไป “ดับไฟ” สืบหาว่าเกิดอะไรขึ้น ใครเข้ามา ทำอะไรไป แล้วกู้คืน
  • Threat Hunter · ไม่รอ alert แต่ออก “ล่า” ภัยที่ซ่อนอยู่ในระบบเชิงรุก
  • Detection Engineer · เขียน rule (Sigma / YARA / Suricata) เพื่อให้ระบบ “มองเห็น” พฤติกรรมร้าย
  • Forensic Analyst · ขุดหลักฐานจาก disk, memory, network, log แบบนักนิติวิทยาศาสตร์
  • Threat Intel Analyst · รวบรวมข่าวกรองว่าศัตรูเป็นใคร ใช้เครื่องมืออะไร (TTPs)
TIP

ภาษากลางที่ทั้ง Red และ Blue ใช้คุยกันคือ MITRE ATT&CK · แผนที่ของ “เทคนิคที่ผู้โจมตีใช้” ถ้าจำได้แค่ลิงก์เดียวจากบทนี้ ขอให้เป็นลิงก์นี้ครับ ทั้งสายรุกและสายรับต้องรู้จัก

แล้ว Blue Team เกี่ยวอะไรกับ CTF?#

เกี่ยวเต็ม ๆ ครับ · โจทย์ CTF หลายหมวดคือ “งานของ Blue Team” โดยตรง:

  • Forensics · ให้ไฟล์ disk image / memory dump / artifact มา แล้วต้องหาว่าเกิดอะไรขึ้น
  • Network / PCAP · ให้ไฟล์ .pcap มา แล้วต้องไล่ดู traffic หา flag หรือร่องรอยการโจมตี
  • Stego / File analysis · ซ่อนข้อมูลในไฟล์ภาพ / เสียง / เอกสาร
  • Log analysis · ให้ log ของเซิร์ฟเวอร์ / SIEM มา แล้วต้องหา “เข็มในกองฟาง”
  • Malware analysis · ให้ตัวอย่างมัลแวร์มา แล้วต้องวิเคราะห์ว่ามันทำอะไร
  • Defensive CTF · มีจริง ๆ ครับ เช่น Blue Guardians: A Defensive CTF Challenge ที่ผมเคยลงแข่ง · โจทย์เป็นแนวตั้งรับล้วน ๆ

ภาคทฤษฎี (Theory section)#

ก่อนจะลงมือ ผมอยากให้เห็นภาพรวมของ “วิชา” ที่ Blue Team ต้องรู้ก่อนครับ

★ Defense in Depth · มองเป็น “ชั้น ๆ”#

หลักการแรกสุดของฝ่ายรับคือ อย่าฝากความหวังไว้กับกำแพงเดียว · ถ้า firewall ทะลุ ก็ยังมี EDR, ถ้า EDR ถูกเลี่ยง ก็ยังมี log + การตรวจจับ, ถ้าทุกอย่างล่ม ก็ยังมี backup กับแผน IR แต่ละชั้นซื้อเวลาให้เรา “มองเห็น” และ “ตอบสนอง” ทัน

★ SOC & SIEM · ห้องควบคุมของอาณาจักร#

SIEM (เช่น Splunk, Elastic/ELK, Microsoft Sentinel, Wazuh) คือที่ที่ log จากทุกที่ไหลมารวมกัน แล้วเราเขียน rule ให้มันยิง alert เมื่อเจอพฤติกรรมน่าสงสัย งานของ SOC Analyst คือ:

  1. Triage · alert นี้จริงหรือหลอก?
  2. Investigate · ถ้าจริง เกิดอะไรขึ้นบ้าง? (ดู log ประกอบ, ทำ timeline)
  3. Escalate / Respond · รายงานต่อ หรือลงมือ contain
NOTE

ทักษะที่ฝึกจาก SOC ตรงกับโจทย์ CTF หมวด log analysis เป๊ะ ๆ · การไล่ Windows Event Log, Sysmon, web access log หา IOC

★ Incident Response · วงจรการ “ดับไฟ”#

มาตรฐานที่ใช้กันบ่อยคือ NIST SP 800-61 กับ SANS PICERL: Preparation · Identification · Containment · Eradication · Recovery · Lessons learned งานนี้คือหัวใจของ DFIR และเป็นสิ่งที่ Cert อย่าง GCIH / BTL1 สอน

★ Digital Forensics · ศาสตร์แห่งการขุดหลักฐาน#

  • Disk forensics · file system artifact, $MFT, prefetch, registry, browser history · เครื่องมือ: Autopsy, FTK Imager, The Sleuth Kit, KAPE, RegRipper, Eric Zimmerman tools
  • Memory forensics · RAM dump · process, network connection, injected code, มัลแวร์ที่ไม่ลงดิสก์ · เครื่องมือ: Volatility 3, MemProcFS
  • Network forensics · .pcap · เครื่องมือ: Wireshark, tshark, Zeek, NetworkMiner, Brim
  • Log / timeline · รวมทุกอย่างเป็น timeline เดียว · Plaso / log2timeline, Timesketch

★ Detection Engineering · สอนให้ระบบ “มองเห็น”#

  • Sigma · ภาษากลางสำหรับเขียน detection rule (แปลงไปเป็น query ของ SIEM ตัวไหนก็ได้)
  • YARA · เขียน pattern เพื่อจับมัลแวร์ / ไฟล์ตามลายเซ็น
  • Suricata / Snort · IDS/IPS rule สำหรับ traffic
  • MITRE ATT&CK Navigator · ทำ heatmap ว่าเราตรวจจับเทคนิคไหนได้บ้าง ครอบคลุมแค่ไหน

★ Threat Hunting & Threat Intelligence#

Threat Hunting คือการ “ตั้งสมมติฐาน · ออกล่า · หาเจอ · เขียน detection” วนไป โดยอ้างอิงข่าวกรอง (TTPs ของ APT, IOC จาก threat feed) แนวคิดที่ต้องรู้: Pyramid of Pain · IOC ระดับ hash/IP เปลี่ยนง่าย แต่ถ้าจับที่ระดับ “พฤติกรรม/TTP” ได้ ศัตรูจะเจ็บกว่ามาก

ภาคปฏิบัติ (Practice section)#

IMPORTANT

“ทฤษฎีเป็นเพียงแผนที่” ชายชรากล่าวพลางยื่นคริสตัลก้อนหนึ่งให้ “แต่ผู้เฝ้ามองที่แท้จริงต้องลงสนามจริง จงไปฝึกในห้องจำลองเหล่านี้ · แต่ละห้องคือเหตุการณ์ที่เคยเกิดขึ้นจริง ย่อส่วนมาให้เจ้าได้ลองแกะ”

ของฟรีที่ดีและผมแนะนำให้เริ่ม (เรียงจากง่ายไปยาก):

แพลตฟอร์มเหมาะกับ
TryHackMe · สาย SOC Level 1/2, Cyber Defenseมือใหม่ · กลาง มี path เป็นเรื่องเป็นราว
Blue Team Labs Online (BTLO)challenge สั้น ๆ DFIR / SOC / IR
LetsDefendจำลองหน้าจอ SOC จริง ฝึก triage alert
CyberDefenders”DFIR CTF” ครบ · disk/memory/pcap/log challenges ฟรีเยอะมาก
HackTheBox · Sherlockschallenge สาย DFIR แนวสืบสวน
malware-traffic-analysis.netฝึกแกะ .pcap มัลแวร์จริง
Splunk Boss of the SOC (BOTS)dataset จริงสำหรับฝึก log hunting ใน Splunk
RangeForce Communitylab สาย defense
MalwareBazaar / ANY.RUN / Joe Sandboxหาตัวอย่างมัลแวร์ + sandbox วิเคราะห์

เครื่องมือที่ควรลงเครื่องไว้ (ทำเป็น VM แยกนะครับ): Wireshark, Volatility 3, Autopsy, FTK Imager, Eric Zimmerman tools (KAPE, MFTECmd, …), Sysinternals, REMnux + FLARE-VM (สำหรับ malware analysis)

TIP

วิธีฝึกที่ผมใช้: เลือก challenge สาย DFIR จาก CyberDefenders มาทำ · แกะให้จบ · เขียน write-up อธิบายว่าหาเจอยังไง การได้ “เล่า” สิ่งที่ทำ จะทำให้เราเข้าใจมันจริง ๆ และเป็นพอร์ตที่ดีด้วย (เหมือนที่ผมทำในหมวด Write-up นั่นแหละครับ)

◎ เควสต์ท้ายบท#

  1. ทำ path SOC Level 1 บน TryHackMe ให้จบ
  2. แกะ “Blue CTF” หรือ “DFIR challenge” จาก CyberDefenders มา 3 ข้อ + เขียน write-up อย่างน้อย 1 ข้อ
  3. ลองเขียน Sigma rule ของตัวเองสัก 1 อัน จาก log จริงที่เจอในข้อ 2
  4. แวะดู Blue Guardians: A Defensive CTF Challenge 2024 ที่ผมเคยลง · งานแข่งแนวตั้งรับมีจริง และสนุกมาก
IMPORTANT

เมื่อเจ้าฝึกครบทุกห้อง คริสตัลในมือเจ้าก็เปล่งแสงสีฟ้าเย็น ๆ ชายชรายิ้ม “เจ้ามองเห็นแล้ว · แต่การมองเห็นเพียงอย่างเดียวยังไม่พอ บทสุดท้ายของเจ้า คือการรวมสองด้าน ทั้งรุกและรับ ให้เป็นหนึ่งเดียว… จงไปต่อยัง Level III”

ไปต่อ · Road to CTF Master Level III · Purple Team

Buy me a Beer 35฿ · ขอบคุณที่อ่านจนจบครับ

IMPORTANT

After clearing the first lesson in the floating castle, the old man in the blue cloak walks you down a long stone corridor to a tower wrapped in glass-clear ice. “Your next chapter,” he says, opening a heavy door, “is the art of the watchers, the defenders. You will learn to see what others cannot, to hear the whispers of intruders before they strike.” The hall flashes alive with hundreds of crystal panels, each one showing events unfolding across the kingdom. You take a deep breath. Your Blue Team training is about to begin.

Welcome everyone to Road to CTF Master Level II#

Written by me, Ar3mus#

In Level I, we covered the world of CTF, the competition formats, and the cyber roadmap. In this chapter, we dive into a side I think many people overlook, but is actually just as deep and fun as the offensive side: Blue Team.

NOTE

Anything inside :::important blocks is fictional narrative I wrote to carry the series along. The actual technical content sits outside those callouts.

WARNING

Same disclaimer as before, the storytelling parts are just role-play. We are not turning into real wizards ☠. But if anyone drinks a potion and casts a real spell, please let me know, I will be on the next portal to another world right away. 555

❄ Blue Team#

IMPORTANT

“Remember this,” the old man says. “Attackers only need one gap to break through. Defenders must guard every gap, every door, every window, all the time. That is why true watchers are rare, and worth more than gold.”

Blue Team is the defensive side, the people who watch, detect, respond, and recover systems from threats. If Red Team is the burglar looking for a way into the house, Blue Team is the homeowner, the guard, the detective, and the rescue crew all in one.

In real-world jobs, Blue Team covers many roles, for example:

  • SOC Analyst · sits in front of monitors, watches SIEM alerts, triages which are real threats and which are false positives
  • Incident Responder (DFIR) · when something happens, they go in to put out the fire, figure out what happened, who got in, what they did, and recover from it
  • Threat Hunter · does not wait for alerts, actively hunts for threats hiding in the system
  • Detection Engineer · writes rules (Sigma / YARA / Suricata) to teach the system to see bad behavior
  • Forensic Analyst · digs evidence out of disk, memory, network, and logs like a forensic scientist
  • Threat Intel Analyst · gathers intelligence on who the adversaries are and what tools they use (TTPs)
TIP

The common language Red and Blue both use is MITRE ATT&CK, a map of techniques attackers use. If you only remember one link from this chapter, please let it be this one. Both offensive and defensive sides need to know it.

So how does Blue Team relate to CTF?#

Tons. Many CTF categories are literally Blue Team work:

  • Forensics · given a disk image / memory dump / artifact, figure out what happened
  • Network / PCAP · given a .pcap file, walk through traffic to find flags or traces of attack
  • Stego / File analysis · data hidden inside images, audio, or documents
  • Log analysis · given server / SIEM logs, find the needle in the haystack
  • Malware analysis · given a malware sample, analyze what it does
  • Defensive CTF · these exist, like Blue Guardians: A Defensive CTF Challenge that I once joined, the challenges are pure defense

Theory section#

Before getting hands-on, I want you to see the big picture of the topics Blue Team should know.

★ Defense in Depth · think in layers#

The first principle of defense is never put all your hope in one wall. If the firewall is bypassed, there is still EDR. If EDR is evaded, there are still logs and detections. If everything fails, there is backup and an IR plan. Each layer buys us time to see and respond.

★ SOC & SIEM · the control room of the kingdom#

SIEM (like Splunk, Elastic/ELK, Microsoft Sentinel, Wazuh) is where logs from everywhere flow in. We write rules so it fires alerts on suspicious behavior. A SOC Analyst’s job is:

  1. Triage · is this alert real or fake?
  2. Investigate · if real, what happened? (cross-reference logs, build a timeline)
  3. Escalate / Respond · report up the chain, or move to contain
NOTE

Skills practiced in a SOC map directly to CTF log analysis challenges, walking through Windows Event Logs, Sysmon, web access logs to find IOCs.

★ Incident Response · the firefighting cycle#

The common standards are NIST SP 800-61 and SANS PICERL: Preparation · Identification · Containment · Eradication · Recovery · Lessons learned. This is the heart of DFIR and what certs like GCIH / BTL1 teach.

★ Digital Forensics · the art of digging up evidence#

  • Disk forensics · file system artifacts, $MFT, prefetch, registry, browser history · tools: Autopsy, FTK Imager, The Sleuth Kit, KAPE, RegRipper, Eric Zimmerman tools
  • Memory forensics · RAM dumps · processes, network connections, injected code, fileless malware · tools: Volatility 3, MemProcFS
  • Network forensics · .pcap files · tools: Wireshark, tshark, Zeek, NetworkMiner, Brim
  • Log / timeline · everything fused into one timeline · Plaso / log2timeline, Timesketch

★ Detection Engineering · teaching the system to see#

  • Sigma · a common language for writing detection rules (convertible to whatever SIEM query you use)
  • YARA · write patterns to catch malware / files by signature
  • Suricata / Snort · IDS/IPS rules for traffic
  • MITRE ATT&CK Navigator · build a heatmap of which techniques you can detect and how much coverage you have

★ Threat Hunting & Threat Intelligence#

Threat Hunting is the cycle of “form a hypothesis, hunt, find something, write a detection,” repeat. It is driven by intelligence (APT TTPs, IOC threat feeds). A concept you must know: Pyramid of Pain. Hash/IP IOCs are easy for attackers to swap out, but if you detect at the behavior/TTP level, it hurts them much more.

Practice section#

IMPORTANT

“Theory is only the map,” the old man says, handing you a single crystal. “True watchers must walk the field. Go train in these simulation chambers. Each is a real incident, scaled down for you to dissect.”

Free resources I recommend starting with (easy to hard):

PlatformGood for
TryHackMe · SOC Level 1/2, Cyber Defense pathsbeginners and intermediate, structured paths
Blue Team Labs Online (BTLO)short DFIR / SOC / IR challenges
LetsDefendsimulates a real SOC screen, practice alert triage
CyberDefendersfull DFIR CTF · disk/memory/pcap/log challenges, lots of free content
HackTheBox · SherlocksDFIR investigation-style challenges
malware-traffic-analysis.netpractice on real malware .pcap files
Splunk Boss of the SOC (BOTS)real datasets for log hunting practice in Splunk
RangeForce Communitydefense-side labs
MalwareBazaar / ANY.RUN / Joe Sandboxmalware samples + sandboxes for analysis

Tools to keep installed (use a separate VM): Wireshark, Volatility 3, Autopsy, FTK Imager, Eric Zimmerman tools (KAPE, MFTECmd, …), Sysinternals, REMnux + FLARE-VM (for malware analysis).

TIP

The way I practice: pick a DFIR challenge from CyberDefenders, solve it to the end, then write up how you found the answer. Explaining what you did makes you actually understand it, and builds a great portfolio (which is what I do in my Write-up section).

◎ End-of-chapter quest#

  1. Finish the SOC Level 1 path on TryHackMe
  2. Solve 3 “Blue CTF” or “DFIR challenges” from CyberDefenders + write a write-up for at least 1
  3. Try writing your own Sigma rule using real logs you saw in step 2
  4. Check out Blue Guardians: A Defensive CTF Challenge 2024 that I joined. Defense-focused competitions are real, and a lot of fun.
IMPORTANT

When you finish every chamber, the crystal in your hand glows a cool blue. The old man smiles. “You see now. But sight alone is not enough. Your final chapter is to unite both sides, offensive and defensive, as one. Move on to Level III.”

Next · Road to CTF Master Level III · Purple Team

Buy me a Beer 35฿ · thanks for reading to the end

Road to CTF Master Level II
https://ar3mus.pages.dev/posts/series/2/
Author
Ar3mus
Published at
2024-09-26
Thriller (Chiptune Lofi)
Lian Fort · Moonwalker & Chill
SOURCE ON SPOTIFY