
프로세스 모니터에 "부팅 로깅 활성화" 기능이 있다는 것을 알고 있습니다.
하지만 이는 다음 부팅에만 적용됩니다.
앞으로 모든 부팅에 대해 부팅 로깅을 활성화하는 방법이 있습니까?
답변1
부팅 로깅을 영구적으로 활성화하는 일반적인 방법은 모르지만 부팅 로깅은 Procmon
드라이버 구성의 두 레지스트리 값에 의해 제어되는 것 같습니다. 아마도 (예: 시작 스크립트를 사용하여) 이러한 값을 (다시) 생성하면 원하는 대로 작동할 것입니다.
if not exist %SystemRoot%\System32\Drivers\PROCMON23.sys copy PROCMON23.sys %SystemRoot%\System32\Drivers\
reg add HKLM\SYSTEM\CurrentControlSet\services\PROCMON23 /v ImagePath /t REG_SZ /d "System32\Drivers\PROCMON23.sys" /f
reg add HKLM\SYSTEM\CurrentControlSet\services\PROCMON23 /v Start /t REG_DWORD /d 0x0 /f
reg add HKLM\SYSTEM\CurrentControlSet\services\PROCMON23 /v Type /t REG_DWORD /d 0x1 /f
하지만 그런 것을 시도하기 전에 먼저 "정기적인" 모니터링(부팅 로깅 없이)을 시도해 보겠습니다. 프로세스 모니터를 한 번 시작하고 hosts
파일에 대한 액세스만 모니터링하도록 구성합니다(필터 → 필터...). 해당 구성을 파일 C:\hosts.pmc
(파일 → 구성 내보내기...). 그런 다음 시작 스크립트에서 다음과 같이 실행하십시오.
procmon /LoadConfig C:\hosts.pmc /BackingFile C:\hosts_%DATE:/=-%.pml /Quiet > C:\hosts.log 2>&1
그러면 내보낸 구성으로 프로세스 모니터가 시작되고( /LoadConfig C:\hosts.pmc
), 필터 설정 확인 메시지 없이 모니터링이 시작되고( /Quiet
), 기록된 이벤트가 현재 날짜와 함께 로그 파일에 기록됩니다( /BackingFile C:\hosts_%DATE:/=-%.pml
). 이 표현식은 슬래시가 하이픈으로 대체된 %DATE:/=-%
현재 날짜를 생성합니다 . 날짜 형식이 아닌 경우 이에 따라 이 표현식을 수정해야 합니다./
-
MM/DD/YYYY
시작 스크립트는 다양한 방법으로 구성할 수 있습니다( Run
레지스트리의 키, 예약된 작업, 그룹 정책 등). 다음에 대한 답변 보기이 질문개요를 보려면 StackOverflow를 참조하세요.
답변2
Adam Collett/adjman666은 이를 수행하기 위해 vbscript를 작성하고 이를 sysinternals 포럼에 게시했습니다.. 이것이 작동하려면 \server\procmon 공유에 "도메인 컴퓨터"가 해당 위치에서 읽을 수 있도록 공유 및 파일 권한이 설정되어 있어야 합니다. 그렇지 않으면 스크립트에서 "액세스 거부" 메시지와 함께 오류가 발생합니다.
'Script to enable boot logging in Process Monitor at every shutdown to ensure we capture all activity, every time.
'Declare the objects used in the script
Dim objFSO, objShell, objRegistry
'Declare the variables used in the script
Dim strProcmon20KeyPath, strInstancesKeyPath, strPMIKeyPath, strStartValueName, strGroupValueName, strTypeValueName, strImagePathValueName
Dim strDefInstanceValueName, strAltitudeValueName, strFlagsValueName, strComputer
'Declare the constants used in the script
Const HKEY_LOCAL_MACHINE = &H80000002
'Create our FileSystem, Shell and Registry objects
Set objFSO=CreateObject("Scripting.FileSystemObject")
Set objShell=WScript.CreateObject("WScript.Shell")
strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
'Set all variables ready for use
strProcmon20KeyPath = "SYSTEM\CurrentControlSet\Services\PROCMON20\"
strInstancesKeyPath = "SYSTEM\CurrentControlSet\Services\PROCMON20\Instances\"
strPMIKeyPath = "SYSTEM\CurrentControlSet\Services\PROCMON20\Instances\Process Monitor Instance\"
strStartValueName = "Start"
strGroupValueName = "Group"
strTypeValueName = "Type"
strImagePathValueName = "ImagePath"
strDefInstanceValueName = "DefaultInstance"
strAltitudeValueName = "Altitude"
strFlagsValueName = "Flags"
'Check for the Process Monitor Executable, copy it in if not already on the system.
If not objFSO.FileExists("C:\Windows\System32\procmon.exe") Then
objFSO.CopyFile "\\server\procmon\procmon.exe", "C:\Windows\System32\", true
End If
'Now import the registry settings, one at a time
objShell.RegWrite "HKEY_LOCAL_MACHINE\" & strProcmon20KeyPath & strStartValueName, "0", "REG_DWORD"
objShell.RegWrite "HKEY_LOCAL_MACHINE\" & strProcmon20KeyPath & strGroupValueName, "FSFilter Activity Monitor", "REG_SZ"
objShell.RegWrite "HKEY_LOCAL_MACHINE\" & strProcmon20KeyPath & strTypeValueName, "1", "REG_DWORD"
objShell.RegWrite "HKEY_LOCAL_MACHINE\" & strProcmon20KeyPath & strImagePathValueName, "System32\Drivers\PROCMON20.SYS", "REG_EXPAND_SZ"
objShell.RegWrite "HKEY_LOCAL_MACHINE\" & strInstancesKeyPath & strDefInstanceValueName, "Process Monitor Instance", "REG_SZ"
objShell.RegWrite "HKEY_LOCAL_MACHINE\" & strPMIKeyPath & strAltitudeValueName, "385200", "REG_SZ"
objShell.RegWrite "HKEY_LOCAL_MACHINE\" & strPMIKeyPath & strFlagsValueName, "0", "REG_DWORD"
'Now copy over the PROCMON20.SYS file to the C:\Windows\System32\Drivers folder
If not objFSO.FileExists("C:\Windows\System32\Drivers\PROCMON20.SYS") Then
objFSO.CopyFile "\\server\procmon\PROCMON20.SYS", "C:\Windows\System32\Drivers\", true
End If
'End of Script