Try   HackMD

W1 Windows Event Log (事件檢視器)

tags: DFIR

事件檢視器

  • 系統運作過程中會留下各種事件日誌和紀錄,方便系統管理員及時掌控系統上發生的各種狀況,以確保系統正常穩定且安全的運作。

  • Windows的事件檢視器可以讓管理員瀏覽及管理多種事件日誌,並針對特定事件觸發通知或執行程式。

  • Win+R打開執行,輸入eventvwr即可開啟事件檢視器

  • 或是Win+X,選擇事件檢視器

  • 或是Powershell或CMD輸入eventvwr.msc執行

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  • 自訂檢視:

    • "系統管理事件"會列出近期系統上出現的各類問題
    • 可以按右鍵"建立自訂檢視"

Windows記錄檔的類型

  • 事件紀錄檔是紀錄系統中所有"事件"的本機檔案,eg. 存取、刪除、新增檔案或應用程式、修改系統日期、關閉系統、更新系統設定等等
  • 事件檢視器所收集的記錄檔類型包含兩種
    1. Windows紀錄: 包含3個Windows系統可用的紀錄檔及2個全新的紀錄檔

      1. 應用程式紀錄檔:

        • 記錄由應用程式產生的事件,由應用程式開發人員定義
          Image Not Showing Possible Reasons
          • The image file may be corrupted
          • The server hosting the image is unavailable
          • The image path is incorrect
          • The image format is not supported
          Learn More →
        • 依嚴重性(重到輕)分為錯誤、警告、資訊
      2. 安全性紀錄檔

        • 紀錄任何有關系統安全性的事件(eg. 登入登出事件、使用管理者權限開啟應用程式(UAC))

          Image Not Showing Possible Reasons
          • The image file may be corrupted
          • The server hosting the image is unavailable
          • The image path is incorrect
          • The image format is not supported
          Learn More →

        • 由管理員透過"本機安全性原則"及"群組原則"(Windows AD, Active Directory)來定義稽核原則(Audit Policy),以指定安全日誌日誌需紀錄的事件項目

        • eg. 若啟用"登入稽核原則",會記錄登入的嘗試、建立/開啟/刪除檔案等

          • win10家用版沒有gpms.msc (Group Policy Management Console)
        • 由於安全紀錄檔中可能涵蓋機密性資料,因此其檢視所需權限較高,只有Administrator可以檢視其內容

      3. 系統紀錄檔:

        • 由系統元件所記錄的事件, eg. 系統更新失敗
        • 由OS預先決定所需要紀錄的事件類型。包含開機載入、執行各種網路服務、驅動程式的載入
          Image Not Showing Possible Reasons
          • The image file may be corrupted
          • The server hosting the image is unavailable
          • The image path is incorrect
          • The image format is not supported
          Learn More →

          Image Not Showing Possible Reasons
          • The image file may be corrupted
          • The server hosting the image is unavailable
          • The image path is incorrect
          • The image format is not supported
          Learn More →

          Image Not Showing Possible Reasons
          • The image file may be corrupted
          • The server hosting the image is unavailable
          • The image path is incorrect
          • The image format is not supported
          Learn More →
        • 依嚴重程度分為錯誤、警告、資訊
      4. 安裝紀錄檔(Setup)

        • 安裝應用程式的相關事件
          Image Not Showing Possible Reasons
          • The image file may be corrupted
          • The server hosting the image is unavailable
          • The image path is incorrect
          • The image format is not supported
          Learn More →
      5. 轉送事件紀錄檔(Forwarded Events)

        • 事件檢視器支援事件轉寄及訂閱,用以收集遠端電腦的事件紀錄,並儲存於某部電腦(Collector)上以集中維護及檢視。
          • 網路問題有時候涉及多台電腦,必須同時檢視多台電腦上的紀錄
    2. 應用程式及服務紀錄檔: 包含四個子類型

      1. 系統管理(Admin)記錄檔:

        • 排解問題時,當中的事件紀錄會提供如何解決的指引
          Image Not Showing Possible Reasons
          • The image file may be corrupted
          • The server hosting the image is unavailable
          • The image path is incorrect
          • The image format is not supported
          Learn More →
      2. 作業系統(Operational)記錄檔

      3. 分析(Analytic)記錄檔

      4. 偵錯(Debug)記錄檔

事件紀錄檔類型

  • 用於標示事件的嚴重性
    1. 資訊(Information):成功執行的事件

    2. 警告(Warning)

      Image Not Showing Possible Reasons
      • The image file may be corrupted
      • The server hosting the image is unavailable
      • The image path is incorrect
      • The image format is not supported
      Learn More →

    3. 錯誤(Error)

      Image Not Showing Possible Reasons
      • The image file may be corrupted
      • The server hosting the image is unavailable
      • The image path is incorrect
      • The image format is not supported
      Learn More →

    4. 成功稽核(安全性紀錄檔, ex使用者登入到電腦時紀錄成功稽核)

    5. 失敗稽核(未完成成功稽核的安全性事件, ex無法存取網路驅動程式時)

如何分析事件紀錄檔

  • 主要看事件識別碼和事件來源
    • ex. 查詢是否有異常登入
      • 事件識別碼4624為登入成功, 4625為登入失敗
        Image Not Showing Possible Reasons
        • The image file may be corrupted
        • The server hosting the image is unavailable
        • The image path is incorrect
        • The image format is not supported
        Learn More →
    • ex. 開關機時間紀錄
      • 事件識別碼6005為開機, 6006為關機
        Image Not Showing Possible Reasons
        • The image file may be corrupted
        • The server hosting the image is unavailable
        • The image path is incorrect
        • The image format is not supported
        Learn More →

練習

  1. 事件檢視器記錄哪些類別的事件

    1. 應用程式
    2. 安全性
    3. 系統
    4. 安裝
    5. 轉送
  2. 嘗試找出上次登入成功的那筆log

    Windows紀錄 > 安全性 > 篩選目前的紀錄檔 > 事件識別碼4624
    或是使用自訂檢視 > 建立自訂檢視,抓出所有識別碼為4624的事件紀錄

  3. 使用者成功登入的log ID是?

    4624

  4. 登入失敗的log ID是?

    4625

  5. 嘗試自己建立/修改/刪除檔案,並找到那筆log

    需先啟用稽核物件存取

  6. 刪除log的log事件ID?

    Windows紀錄 > 安全性上按右鍵 > 清除紀錄檔可以清除該紀錄檔中的所有事件
    之後在安全性紀錄檔中會留下清除紀錄檔的log


    刪除log事件的ID為1102

  7. 使用FullEventLogView

    • 能夠輕鬆讀取Windows Event Log中所有詳細內容,包含事件的詳細敘述,存取本機或遠端電腦的事件紀錄並儲存成指定格式檔案

ref

  1. https://www.manageengine.com/tw/network-monitoring/Eventlog_Tutorial_Part_I.html
  2. https://www.lijyyh.com/2012/08/windows-windows-system-maintenance.html