Sysmon คืออะไร ?
Sysmon เป็นคำเรียกแบบย่อๆ ที่มาจากคำว่า “System Monitor” เป็น Windows system service ที่ถูกพัฒนาขึ้นมาของ Microsoft และเป็นเครื่องมือตัวหนึ่งในชุดเครื่องมือ Sysinternals Suite ของ Microsoft เมื่อติดตั้งบนเครื่องเรียบร้อยแล้ว จะมีหน้าที่ในการช่วยบันทึกพฤติกรรมต่างๆ ที่เกิดขึ้นบนเครื่องคอมพิวเตอร์ตามเงื่อนไข (Event Filtering) ที่ระบุไว้ในไฟล์ Configuration ที่กำหนดไว้ ซึ่งโดยส่วนมากเงื่อนไขที่ถูกสร้างขึ้นมาจะเป็นพฤติกรรมน่าสงสัยที่อาจเกี่ยวข้องกับภัยคุกคามทางไซเบอร์หรือมัลแวร์ และข้อมูลพฤติกรรมที่เกิดขึ้นนี้จะถูกเก็บในรูปแบบของ Log ไว้ที่ “Windows event log” ซึ่งมีอยู่แล้วบนเครื่องคอมพิวเตอร์ทุกเครื่องที่เป็นระบบปฏิบัติการ Windows โดย Log ต่างๆ ที่ถูกเก็บบันทึกไว้ใน Windows event log นี้ สามารถถูกส่งต่อไปเก็บยังอุปกรณ์ที่เรียกว่า SIEM (Security Information and Event Management) และจะถูกเก็บไว้เป็นฐานข้อมูลในลักษณะข้อมูลที่มีโครงสร้าง ส่งผลให้สามารถค้นหาเฉพาะข้อมูลที่ได้รับความสนใจเป็นพิเศษ (Retrieval) ผ่านการใช้คำสั่ง (Query) ที่เหมาะสมในการประมวลผลและแสดงผลข้อมูลให้ได้ผลลัพธ์ตามที่ต้องการ หรือแจ้งเตือนเมื่อพบพฤติกรรมที่ตรงกับเงื่อนไขภัยคุกคามที่สนใจ
รูปที่ 1: แสดงตัวอย่างการออกแบบระบบการทำงานร่วมกันระหว่าง sysmon และ splunk
Sysmon มีการแบ่งชนิดของเหตุการณ์ (Event) ที่สามารถตรวจจับได้เป็นทั้งหมด 22 เหตุการณ์ โดยแต่ละชนิดของเหตุการณ์จะมีเลข Event ID กำกับไว้เช่นเดียวกับ Windows event log ปกติ ดังต่อไปนี้
Event ID 1: Process creation
บันทึกข้อมูลเมื่อพบว่ามีโปรเซสถูกสร้างขึ้นใหม่บนเครื่อง โดยมีการเก็บข้อมูลของ command line ที่ถูกเรียก, ProcessGUID, ค่า Hash ของไฟล์ที่ถูกโปรเซสเรียกมารัน
มี Field name ประกอบด้วย Log Name, Source, Date, Event ID, Task Category, Level, Keywords, User, Computer, Description, UtcTime, ProcessGuid, ProcessId, Image, FileVersion, Description, Product, Company, CommandLine, CurrentDirectory, User, LogonGuid, LogonId, TerminalSessionId, IntegrityLevel, Hashes, ParentProcessGuid, ParentProcessId, ParentImage, ParentCommandLine
Event ID 2: A process changed a file creation time
บันทึกข้อมูลเมื่อพบว่ามีไฟล์บนเครื่องถูกเปลี่ยนเวลาการสร้าง (creation time)
มี Field name ประกอบด้วย Log Name, Source, Date, Event ID, Task Category, Level, Keywords, User, Computer, Description, UtcTime, ProcessGuid, ProcessId, Image, TargetFilename, CreationUtcTime, PreviousCreationUtcTime
Event ID 3: Network connection
บันทึกข้อมูลเมื่อพบว่ามีโปรเซสบนเครื่องที่มีการเชื่อมต่อผ่าน TCP/UDP โดยจะมีการเก็บข้อมูลของ ProcessId, ProcessGUID, Source host name, Source IP address, Destination host name และ Destination IP address
มี Field name ประกอบด้วย Log Name, Source, Date, Event ID, Task Category, Level, Keywords, User, Computer, Description, UtcTime, ProcessGuid, ProcessId, Image, User, Protocol, Initiated, SourceIsIpv6, SourceIp, SourceHostname, SourcePort, SourcePortName, DestinationIsIpv6, DestinationIp, DestinationHostname, DestinationPort, DestinationPortName
Event ID 4: Sysmon service state changed
บันทึกข้อมูลเมื่อพบว่า sysmon service มีการ start/stop เกิดขึ้น
มี Field name ประกอบด้วย Log Name, Source, Date, Event ID, Task Category, Level, Keywords, User, Computer, Description, UtcTime, State, Version, SchemaVersion
Event ID 5: Process terminated
บันทึกข้อมูลเมื่อพบว่ามีโปรเซสใดๆ บนเครื่องถูกสั่งให้หยุดทำงาน
มี Field name ประกอบด้วย Log Name, Source, Date, Event ID, Task Category, Level, Keywords, User, Computer, Description, UtcTime, ProcessGuid, ProcessId, Image
Event ID 6: Driver loaded
บันทึกข้อมูลเมื่อพบว่ามีการเรียกใช้งาน driver บนเครื่อง โดยจะมีการเก็บข้อมูลค่า hash ของไฟล์ที่ถูกเรียกด้วย
มี Field name ประกอบด้วย Log Name, Source, Date, Event ID, Task Category, Level, Keywords, User, Computer, Description, UtcTime, ImageLoaded, Hashes, Signed, Signature, SignatureStatus
Event ID 7: Image loaded
บันทึกข้อมูลเมื่อพบว่าโปรเซสใดๆ มีการเรียกใช้งาน module (dll) เพิ่มเติม โดยจะมีการเก็บข้อมูลค่า hash ของ module ไฟล์ที่ถูกเรียก
มี Field name ประกอบด้วย Log Name, Source, Date, Event ID, Task Category, Level, Keywords, User, Computer, Description, UtcTime, ProcessGuid, ProcessId, Image, ImageLoaded, FileVersion, Description, Product, Company, Hashes, Signed, Signature, SignatureStatus
Event ID 8: CreateRemoteThread
บันทึกข้อมูลเมื่อพบว่าโปรเซสใดๆ มีการสร้าง Thread บนโปรเซสอื่นๆ เพิ่มเติม โดยจะมีการเก็บข้อมูลของทั้งโปรเซสที่ทำการเรียก (source) และโปรเซสที่ถูกเรียก (target)
มี Field name ประกอบด้วย Log Name, Source, Date, Event ID, Task Category, Level, Keywords, User, Computer, Description, UtcTime, SourceProcessGuid, SourceProcessId, SourceImage, TargetProcessGuid, TargetProcessId, TargetImage, NewThreadId, StartAddress, StartModule, StartFunction
Event ID 9: RawAccessRead
บันทึกข้อมูลเมื่อพบว่าโปรเซสใดๆ มีความพยายามเข้าถึงไฟล์บนเครื่องผ่านการใช้ \\.\ ซึ่งมักเป็นพฤติกรรมของมัลแวร์ในการพยายามเข้าถึงไฟล์สำคัญบนเครื่องที่มีการป้องกัน เพื่อขโมยข้อมูล โดยจะมีการเก็บข้อมูลของโปรเซสต้นทางที่พยายามจะเข้าถึง และอุปกรณ์ปลายทางที่พยายามเข้าถึง
มี Field name ประกอบด้วย Log Name, Source, Date, Event ID, Task Category, Level, Keywords, User, Computer, Description, RawAccessRead, UtcTime: Time event occurred, ProcessGuid: The GUID of the process that generated the event, ProcessID: ID of the process that generated the event, Image: File used to generate the event, Device
Event ID 10: ProcessAccess
บันทึกข้อมูลเมื่อพบว่าโปรเซสใดๆ พยายามที่จะเรียกหรือเข้าถึงโปรเซสอื่นๆ ซึ่งอาจเป็นพฤติกรรมที่น่าสงสัยของมัลแวร์ในการพยายามอ่านข้อมูลที่อยู่บนโปรเซสสำคัญอื่นๆ เช่น Lsass.