
我試圖從安全事件日誌中過濾掉那些與透過在鍵盤上輸入密碼登入的使用者(我)相對應的日誌。我希望它能夠檢測解鎖螢幕以及打開電腦後登入。
我相信造成此問題的事件 ID 是 4624。
我的問題是,每次登入時都會建立大量事件 ID。
為了過濾掉這個問題,我在所有 4624 個事件 ID 的 XML 中檢查:
如果
"LogonType" == 2
,則將第二種類型指派給互動式鍵盤/螢幕登入。如果
"TargetUsername" == Myusername
,這將刪除其他服務啟動的所有登入事件。如果
"LogonGuid" != "00000000-0000-0000-0000-000000000000"
,這將刪除登入事件的冗餘副本,該事件也有我的名字,並且在ID 不為零的"TargetUsername"
登入後幾毫秒內發生。GUID
我不確定這是否是正確的方法,因為使用它似乎會在啟動後錯過登入事件。我關閉後第一次登入時發生的所有事件均未滿足所有三個條件。
今天 9:30 左右,有一系列 4624 事件,但沒有一個符合我的標準。以下是我的登入/登出摘錄,有兩個連續的登出事件,中間沒有登入。不過我確實是在 9:30 左右登入的。
Log in: 12-10T13:45:09.92629
Log out: 12-10T13:06:44.29530
Log in: 12-10T09:59:15.51808
Log out: 12-10T09:48:59.63086 <--
Log out: 12-07T17:36:59.08875 <--
Log in: 12-07T15:12:21.93870
Log out: 12-07T15:10:52.82871
Log in: 12-07T14:05:37.53658
Log out: 12-07T13:57:03.61220
Log in: 12-07T13:35:47.04114
Log out: 12-07T13:35:33.83213
Log in: 12-07T13:19:58.33986
Log out: 12-07T13:19:49.87156
Log in: 12-07T12:54:40.80056
Log out: 12-07T12:15:52.70091
Log in: 12-07T09:50:54.37527
Log out: 12-07T09:33:20.24622
Log in: 12-07T09:32:22.36908
Log out: 12-06T17:10:28.06655
Log in: 12-06T16:37:02.14689
Log out: 12-06T16:26:36.92315
Log in: 12-06T12:58:48.43339
Log out: 12-06T12:04:33.35497
有一個事件的LogonType
值為2
,但它是TargetUserName
,UMFD-0
同時還有另一個事件,其使用者名稱 (mne) 與正確的使用者名稱 (mne) 相同,TargetUserName
但它LogonType
是11
。
我重新啟動並嘗試再次找到它,這次有一個事件滿足這三個過濾器。我不確定這是否是一次性的,或者更可能是我的理解有很大偏差。
如何建立腳本來尋找使用 Windows 事件 ID 從鍵盤登入的時間?
謝謝!
答案1
看來我的過濾方法只是部分正確,因為並非每個鍵盤登入都會在事件檢視器中顯示為類型 2 的事件 4624。終極Windows安全。
Logon Description
Type
-----------------------------------------------------------------------------------------------------
2 Interactive (logon at keyboard and screen of system)
3 Network (i.e. connection to shared folder on this computer from elsewhere on network)
4 Batch (i.e. scheduled task)
5 Service (Service startup)
7 Unlock (i.e. unnattended workstation with password protected screen saver)
8 NetworkCleartext (Logon with credentials sent in the clear text. Most often indicates
a logon to IIS with "basic authentication")
9 NewCredentials such as with RunAs or mapping a network drive with alternate credentials.
This logon type does not seem to show up in any events. If you want to track users attempting
to logon with alternate credentials see 4648. MS says "A caller cloned its current token and
specified new credentials for outbound connections. The new logon session has the same local
identity, but uses different credentials for other network connections."
10 RemoteInteractive (Terminal Services, Remote Desktop or Remote Assistance)
11 CachedInteractive (logon with cached domain credentials such as
when logging on to a laptop when away from the network)
互動式登入的確切定義對我來說仍然有點模糊,因為我發現定義相互衝突,但類型 10 和 11 在其描述中包含「互動式」。當我在未連接到網路的情況下登入工作站時,會發生類型 11。
將該事件和類型新增至篩選器使我能夠找出所有登入事件。