
Windows 포렌식 아티팩트를 신속하게 검색하고 추적
Chainsaw는 이벤트 로그 및 MFT 파일과 같은 Windows 포렌식 아티팩트 내에서 위협을 신속하게 식별할 수 있는 강력한 '초동 대응' 기능을 제공합니다. Chainsaw는 이벤트 로그에서 키워드를 검색하는 일반적이고 빠른 방법을 제공하며, 내장된 Sigma 탐지 규칙 지원과 사용자 정의 Chainsaw 탐지 규칙을 통해 위협을 식별합니다.
추가 정보는 이 도구의 Wiki에서 확인할 수 있습니다: https://github.com/WithSecureLabs/chainsaw/wiki
WithSecure Countercept에서는 관리형 탐지 및 대응 서비스를 제공하기 위해 EDR 에이전트를 통해 엔드포인트로부터 다양한 텔레메트리 소스를 수집합니다. 그러나 EDR이 캡처하지 못한 포렌식 아티팩트를 신속하게 분석해야 하는 상황이 있으며, 흔한 예로 침해 시점에 EDR이 설치되지 않았던 환경에서의 사고 대응 조사를 들 수 있습니다. Chainsaw는 이러한 상황에서 위협 헌터와 사고 대응 컨설턴트가 포렌식 아티팩트를 신속하게 트리아지할 수 있는 도구를 제공하기 위해 만들어졌습니다.
Windows 이벤트 로그는 위협 헌팅 및 사고 대응 조사를 위한 풍부한 포렌식 정보 소스를 제공합니다. 안타깝게도 이벤트 로그를 처리하고 검색하는 것은 느리고 시간이 많이 소요되는 과정일 수 있으며, 대부분의 경우 로그 데이터를 효율적으로 헌팅하고 탐지 로직을 적용하기 위해 ELK 스택이나 Splunk 인스턴스와 같은 주변 인프라의 오버헤드가 필요합니다. 이러한 오버헤드는 종종 블루팀이 조사를 진행하는 데 필요한 방향과 결론을 제공하기 위해 Windows 이벤트 로그를 신속하게 트리아지할 수 없게 만듭니다. Chainsaw는 Windows 이벤트 로그를 신속하게 검색하고 헌팅할 수 있게 해줌으로써 이 문제를 해결합니다.
이 글을 작성하는 시점에서 Windows 이벤트 로그를 트리아지하고, 로그 내에서 흥미로운 요소를 식별하며, Sigma와 같은 탐지 로직 규칙 형식을 적용하여 악성 활동의 징후를 탐지하는 간단하고 빠른 방법을 제공하는 오픈소스 독립 실행형 도구는 거의 없습니다. 우리의 테스트에서 기존에 존재하던 도구들은 대량의 이벤트 로그에 탐지 로직을 효율적으로 적용하는 데 어려움을 겪어 신속한 트리아지가 필요한 시나리오에 적합하지 않았습니다.
--sigma 및 --mapping 매개변수를 사용하면 SIGMA 탐지 규칙의 하위 집합(또는 전체 SIGMA git 저장소)이 포함된 디렉터리를 지정할 수 있으며, chainsaw는 이러한 규칙을 자동으로 로드, 변환하고 제공된 이벤트 로그에 대해 실행합니다. 매핑 파일은 chainsaw에게 규칙 매칭에 사용할 이벤트 로그의 필드를 알려줍니다. 기본적으로 Chainsaw는 다음을 포함하되 이에 국한되지 않는 다양한 이벤트 로그 유형을 지원합니다:
규칙 탐지에 사용되는 필드의 전체 목록은 매핑 파일을 참조하고, 필요에 따라 자유롭게 확장하십시오.
Sigma 규칙 지원 외에도 Chainsaw는 사용자 정의 규칙 형식도 지원합니다. 저장소에는 사용자가 다음을 수행할 수 있게 해주는 다양한 Chainsaw 규칙이 포함된 rules 디렉터리가 있습니다:
Chainsaw v2 릴리스와 함께, 우리는 더 이상 Sigma Rules 및 EVTX-Attack-Samples 저장소를 Chainsaw 서브모듈로 포함하지 않기로 결정했습니다. 최신 버전을 확보하려면 이러한 저장소를 별도로 클론할 것을 권장합니다.
Chainsaw 바이너리, Sigma 규칙 및 예제 이벤트 로그를 포함하는 올인원 패키지가 여전히 필요한 경우, 이 GitHub 저장소의 릴리스 섹션에서 다운로드할 수 있습니다. 이 릴리스 섹션에서는 다양한 플랫폼 및 아키텍처용으로 미리 컴파일된 바이너리 전용 Chainsaw 버전도 찾을 수 있습니다.
Chainsaw를 직접 컴파일하려면 Chainsaw 저장소를 클론할 수 있습니다:
git clone https://github.com/WithSecureLabs/chainsaw.git
그런 다음 cargo build --release를 실행하여 코드를 직접 컴파일하십시오. 빌드가 완료되면 target/release 폴더에서 컴파일된 바이너리 사본을 찾을 수 있습니다.
--release 플래그로 빌드해야 하며, 이는 실행 시간을 상당히 단축시켜 줍니다.
Chainsaw가 실행될 때 어떤 모습인지 빠르게 확인하고 싶다면, Sigma Rules 및 EVTX-Attack-Samples 저장소를 클론할 수 있습니다:``` git clone https://github.com/SigmaHQ/sigma git clone https://github.com/sbousseaden/EVTX-ATTACK-SAMPLES.git
그런 다음 아래 매개변수로 Chainsaw를 실행합니다:```
./chainsaw hunt EVTX-ATTACK-SAMPLES/ -s sigma/ --mapping mappings/sigma-event-logs-all.yml
├───devShells │ └───x86_64-linux │ └───default: development environment 'nix-shell' ├───formatter │ └───x86_64-linux: package 'alejandra-3.1.0' └───packages └───x86_64-linux ├───chainsaw: package 'chainsaw-2.10.1' └───default: package 'chainsaw-2.10.1'
Chainsaw는 패키지로서 [nixpkgs](https://search.nixos.org/packages?query=chainsaw)를 통해 사용할 수 있습니다.
NixOS를 사용 중이라면 시스템 구성 파일에 `chainsaw`를 추가하기만 하면 됩니다.
하지만 NixOS를 사용하지 않더라도 Nix를 통해 Chainsaw를 설치할 수 있습니다. 권장하는 방법은 `nix-shell`을 사용하는 것이며, 이는 $PATH 환경 변수를 일시적으로 수정합니다.
그렇게 하려면 다음을 실행하세요:```
nix-shell -p chainsaw
이 저장소가 flake라는 사실을 활용하여 다음을 실행할 수도 있습니다:``` nix profile install github:WithSecureLabs/chainsaw
그러나 Nix를 사용하여 chainsaw를 직접 빌드하려는 경우, 이 저장소와 함께 제공되는 `flake.nix`를 다시 한번 활용할 수 있습니다.
바이너리를 빌드하려면, 클론한 저장소의 루트 디렉터리에서 다음을 실행하십시오```
nix build .#
이렇게 하면 ./result 디렉터리가 생성되며, chainsaw 바이너리는 ./result/bin/chainsaw 아래에 위치합니다.
chainsaw를 다운로드하고 실행할 때 로컬 EDR / AntiVirus 엔진이 Chainsaw를 악성으로 탐지하는 경우가 있습니다. 다음 GitHub 이슈에서 그 예를 확인할 수 있습니다: Example1, Example2.
이러한 경고는 일반적으로 악성 문자열(예: "mimikatz")에 대한 참조를 포함하는 예제 이벤트 로그 및/또는 Sigma 규칙 때문입니다. 또한 일부 휴리스틱 탐지 형태로 인해 소수의 Anti-Virus 엔진에서 Chainsaw 바이너리가 탐지된 사례도 확인했습니다.
2022년 7월에 Chainsaw의 작동 방식에 대한 대대적인 개편인 버전 2를 출시했습니다. Chainsaw v2에는 다음과 같은 주요 개선 사항이 포함되어 있습니다:
Chainsaw 버전 1을 계속 사용하고 싶다면 releases 섹션에서 컴파일된 바이너리를 찾거나 v1.x.x 브랜치에서 소스 코드에 접근할 수 있습니다. Chainsaw v1은 더 이상 유지 관리되지 않으며, 모든 사용자는 Chainsaw v2로 이동하는 것을 고려해야 합니다.
Chainsaw v1의 "Christmas Project" 코드베이스를 v2의 완성된 제품으로 전환한 @AlexKornitzer에게 큰 감사를 전합니다.
USAGE:
chainsaw search [FLAGS] [OPTIONS] <pattern> [--] [path]...
FLAGS:
-h, --help Prints help information
-i, --ignore-case Ignore the case when searching patterns
--json Print the output in json format
--load-unknown Allow chainsaw to try and load files it cannot identify
--local Output the timestamp using the local machine's timestamp
-q Suppress informational output
--skip-errors Continue to search when an error is encountered
-V, --version Prints version information
OPTIONS:
--extension <extension>... Only search through files with the provided extension
--from <from> The timestamp to search from. Drops any documents older than the value provided
-o, --output <output> The path to output results to
-e, --regex <pattern>... A string or regular expression pattern to search for
-t, --tau <tau>... Tau expressions to search with. e.g. 'Event.System.EventID: =4104'
--timestamp <timestamp> The field that contains the timestamp
--timezone <timezone> Output the timestamp using the timezone provided
--to <to> The timestamp to search up to. Drops any documents newer than the value provided
ARGS:
<pattern> A string or regular expression pattern to search for. Not used when -e or -t is specified
<path>... The paths containing event logs to load and hunt through
대소문자를 구분하지 않고 "mimikatz" 문자열을 모든 .evtx 파일에서 검색
./chainsaw search mimikatz -i evtx_attack_samples/
*powershell 스크립트 블록 이벤트(Event ID 4014)를 모든 .evtx 파일에서 검색
./chainsaw search -t 'Event.System.EventID: =4104' evtx_attack_samples/
특정 evtx 로그에서 로그온 이벤트를 일치하는 정규식 패턴으로 검색하고 JSON 형식으로 출력
./chainsaw search -e "DC[0-9].insecurebank.local" evtx_attack_samples --json
USAGE:
chainsaw hunt [FLAGS] [OPTIONS] [--] [path]...
FLAGS:
--csv Print the output in csv format
--full Print the full values for the tabular output
-h, --help Prints help information
--json Print the output in json format
--load-unknown Allow chainsaw to try and load files it cannot identify
--local Output the timestamp using the local machine's timestamp
--log Print the output in log like format
--metadata Display additional metadata in the tablar output
-q Suppress informational output
--skip-errors Continue to hunt when an error is encountered
-V, --version Prints version information
OPTIONS:
--column-width <column-width> Set the column width for the tabular output
--extension <extension>... Only hunt through files with the provided extension
--from <from> The timestamp to hunt from. Drops any documents older than the value provided
--kind <kind>... Restrict loaded rules to specified kinds
--level <level>... Restrict loaded rules to specified levels
-m, --mapping <mapping>... A mapping file to tell Chainsaw how to use third-party rules
-o, --output <output> A path to output results to
-r, --rule <rule>... A path containing additional rules to hunt with
-s, --sigma <sigma>... A path containing Sigma rules to hunt with
--status <status>... Restrict loaded rules to specified statuses
--timezone <timezone> Output the timestamp using the timezone provided
--to <to> The timestamp to hunt up to. Drops any documents newer than the value provided
ARGS:
<rules> The path to a collection of rules to use for hunting
<path>... The paths containing event logs to load and hunt through
Sigma 규칙을 탐지 로직으로 사용하여 모든 evtx 파일을 헌팅
./chainsaw hunt evtx_attack_samples/ -s sigma/ --mapping mappings/sigma-event-logs-all.yml
Sigma 규칙과 Chainsaw 규칙을 탐지 로직으로 사용하여 모든 evtx 파일을 헌팅하고 CSV 형식으로 results 폴더에 출력
./chainsaw hunt evtx_attack_samples/ -s sigma/ --mapping mappings/sigma-event-logs-all.yml -r rules/ --csv --output results
Sigma 규칙을 탐지 로직으로 사용하여 모든 evtx 파일을 헌팅하고, 특정 타임스탬프 사이만 검색하며, 결과를 JSON 형식으로 출력
./chainsaw hunt evtx_attack_samples/ -s sigma/ --mapping mappings/sigma-event-logs-all.yml --from "2019-03-17T19:09:39" --to "2019-03-17T19:09:50" --json
$ ./chainsaw hunt -r rules/ evtx_attack_samples -s sigma/rules --mapping mappings/sigma-event-logs-all.yml --level critical
██████╗██╗ ██╗ █████╗ ██╗███╗ ██╗███████╗ █████╗ ██╗ ██╗
██╔════╝██║ ██║██╔══██╗██║████╗ ██║██╔════╝██╔══██╗██║ ██║
██║ ███████║███████║██║██╔██╗ ██║███████╗███████║██║ █╗ ██║
██║ ██╔══██║██╔══██║██║██║╚██╗██║╚════██║██╔══██║██║███╗██║
╚██████╗██║ ██║██║ ██║██║██║ ╚████║███████║██║ ██║╚███╔███╔╝
╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚══╝╚══╝
By WithSecure Countercept (@FranticTyping, @AlexKornitzer)
[+] Loading detection rules from: ../../rules/, /tmp/sigma/rules
[+] Loaded 129 detection rules (198 not loaded)
[+] Loading event logs from: ../../evtx_attack_samples (extensions: .evtx)
[+] Loaded 268 EVTX files (37.5 MB)
[+] Hunting: [========================================] 268/268
[+] Group: Antivirus
┌─────────────────────┬────────────────────┬──────────┬───────────┬─────────────┬────────────────────────────────┬──────────────────────────────────┬────────────────────┐
│ timestamp │ detections │ Event ID │ Record ID │ Computer │ Threat Name │ Threat Path │ User │
├─────────────────────┼────────────────────┼──────────┼───────────┼─────────────┼────────────────────────────────┼──────────────────────────────────┼────────────────────┤
│ 2019-07-18 20:40:00 │ ‣ Windows Defender │ 1116 │ 37 │ MSEDGEWIN10 │ Trojan:PowerShell/Powersploit. │ file:_C:\AtomicRedTeam\atomic- │ MSEDGEWIN10\IEUser │
│ │ │ │ │ │ M │ red-team-master\atomics\T1056\ │ │
│ │ │ │ │ │ │ Get-Keystrokes.ps1 │ │
├─────────────────────┼────────────────────┼──────────┼───────────┼─────────────┼────────────────────────────────┼──────────────────────────────────┼────────────────────┤
│ 2019-07-18 20:53:31 │ ‣ Windows Defender │ 1117 │ 106 │ MSEDGEWIN10 │ Trojan:XML/Exeselrun.gen!A │ file:_C:\AtomicRedTeam\atomic- │ MSEDGEWIN10\IEUser │
│ │ │ │ │ │ │ red-team-master\atomics\T1086\ │ │
│ │ │ │ │ │ │ payloads\test.xsl │ │
└─────────────────────┴────────────────────┴──────────┴───────────┴─────────────┴────────────────────────────────┴──────────────────────────────────┴────────────────────┘
[+] Group: Log Tampering
┌─────────────────────┬───────────────────────────────┬──────────┬───────────┬────────────────────────────────┬───────────────┐
│ timestamp │ detections │ Event ID │ Record ID │ Computer │ User │
├─────────────────────┼───────────────────────────────┼──────────┼───────────┼────────────────────────────────┼───────────────┤
│ 2019-01-20 07:00:50 │ ‣ Security Audit Logs Cleared │ 1102 │ 32853 │ WIN-77LTAPHIQ1R.example.corp │ Administrator │
└─────────────────────┴───────────────────────────────┴──────────┴───────────┴────────────────────────────────┴───────────────┘[+] Group: Sigma
┌─────────────────────┬────────────────────────────────┬───────┬────────────────────────────────┬──────────┬───────────┬──────────────────────────┬──────────────────────────────────┐
│ timestamp │ detections │ count │ Event.System.Provider │ Event ID │ Record ID │ Computer │ Event Data │
├─────────────────────┼────────────────────────────────┼───────┼────────────────────────────────┼──────────┼───────────┼──────────────────────────┼──────────────────────────────────┤
│ 2019-04-29 20:59:14 │ ‣ Malicious Named Pipe │ 1 │ Microsoft-Windows-Sysmon │ 18 │ 8046 │ IEWIN7 │ --- │
│ │ │ │ │ │ │ │ Image: System │
│ │ │ │ │ │ │ │ PipeName: "\\46a676ab7f179e511 │
│ │ │ │ │ │ │ │ e30dd2dc41bd388" │
│ │ │ │ │ │ │ │ ProcessGuid: 365ABB72-D9C4-5CC │
│ │ │ │ │ │ │ │ 7-0000-0010EA030000 │
│ │ │ │ │ │ │ │ ProcessId: 4 │
│ │ │ │ │ │ │ │ RuleName: "" │
│ │ │ │ │ │ │ │ UtcTime: "2019-04-29 20:59:14. │
│ │ │ │ │ │ │ │ 430" │
├─────────────────────┼────────────────────────────────┼───────┼────────────────────────────────┼──────────┼───────────┼──────────────────────────┼──────────────────────────────────┤
│ 2019-04-30 20:26:51 │ ‣ CobaltStrike Service │ 1 │ Microsoft-Windows-Sysmon │ 13 │ 9806 │ IEWIN7 │ --- │
│ │ Installations in Registry │ │ │ │ │ │ Details: "%%COMSPEC%% /b /c st │
│ │ │ │ │ │ │ │ art /b /min powershell.exe -no │
│ │ │ │ │ │ │ │ p -w hidden -noni -c \"if([Int │
│ │ │ │ │ │ │ │ Ptr]::Size -eq 4){$b='powershe │
│ │ │ │ │ │ │ │ ll.exe'}else{$b=$env:windir+'\ │
│ │ │ │ │ │ │ │ \syswow64\\WindowsPowerShell\\ │
│ │ │ │ │ │ │ │ v1.0\\powershell.exe'};$s=New- │
│ │ │ │ │ │ │ │ Object System.Diagnostics.Proc │
│ │ │ │ │ │ │ │ essStartInfo;$s.FileName=$b;$s │
│ │ │ │ │ │ │ │ .Arguments='-noni -nop -w hidd │
│ │ │ │ │ │ │ │ en -c &([scriptblock]::create( │
│ │ │ │ │ │ │ │ (New-Object IO.StreamReader(Ne │
│ │ │ │ │ │ │ │ w-Object IO.Compression.GzipSt │
│ │ │ │ │ │ │ │ ream((New-Object IO.MemoryStre │
│ │ │ │ │ │ │ │ am(,[Convert]::FromBase64Strin │
│ │ │ │ │ │ │ │ g(''H4sIAIuvyFwCA7VW+2/aSBD+OZ │
│ │ │ │ │ │ │ │ H6P1... │
│ │ │ │ │ │ │ │ (use --full to show all content) │
│ │ │ │ │ │ │ │ EventType: SetValue │
│ │ │ │ │ │ │ │ Image: "C:\\Windows\\system32\ │
│ │ │ │ │ │ │ │ \services.exe" │
│ │ │ │ │ │ │ │ ProcessGuid: 365ABB72-2586-5CC │
│ │ │ │ │ │ │ │ 9-0000-0010DC530000 │
│ │ │ │ │ │ │ │ ProcessId: 460 │
│ │ │ │ │ │ │ │ RuleName: "" │
│ │ │ │ │ │ │ │ TargetObject: "HKLM\\System\\C │
│ │ │ │ │ │ │ │ urrentControlSet\\services\\he │
│ │ │ │ │ │ │ │ llo\\ImagePath" │
│ │ │ │ │ │ │ │ UtcTime: "2019-04-30 20:26:51. │
│ │ │ │ │ │ │ │ 934" │
├─────────────────────┼────────────────────────────────┼───────┼────────────────────────────────┼──────────┼───────────┼──────────────────────────┼──────────────────────────────────┤
│ 2019-05-12 12:52:43 │ ‣ Meterpreter or Cobalt │ 1 │ Service Control Manager │ 7045 │ 10446 │ IEWIN7 │ --- │
│ │ Strike Getsystem Service │ │ │ │ │ │ AccountName: LocalSystem │
│ │ Installation │ │ │ │ │ │ ImagePath: "%COMSPEC% /c ping │
│ │ │ │ │ │ │ │ -n 1 127.0.0.1 >nul && echo 'W │
│ │ │ │ │ │ │ │ inPwnage' > \\\\.\\pipe\\WinPw │
│ │ │ │ │ │ │ │ nagePipe" │
│ │ │ │ │ │ │ │ ServiceName: WinPwnage │
│ │ │ │ │ │ │ │ ServiceType: user mode service │
│ │ │ │ │ │ │ │ StartType: demand start │
├─────────────────────┼────────────────────────────────┼───────┼────────────────────────────────┼──────────┼───────────┼──────────────────────────┼──────────────────────────────────┤
│ 2019-06-21 07:35:37 │ ‣ Dumpert Process Dumper │ 1 │ Microsoft-Windows-Sysmon │ 11 │ 238375 │ alice.insecurebank.local │ --- │
│ │ │ │ │ │ │ │ CreationUtcTime: "2019-06-21 0 │
│ │ │ │ │ │ │ │ 6:53:03.227" │
│ │ │ │ │ │ │ │ Image: "C:\\Users\\administrat │
│ │ │ │ │ │ │ │ or\\Desktop\\x64\\Outflank-Dum │
│ │ │ │ │ │ │ │ pert.exe" │
│ │ │ │ │ │ │ │ ProcessGuid: ECAD0485-88C9-5D0 │
│ │ │ │ │ │ │ │ C-0000-0010348C1D00 │
│ │ │ │ │ │ │ │ ProcessId: 3572 │
│ │ │ │ │ │ │ │ RuleName: "" │
│ │ │ │ │ │ │ │ TargetFilename: "C:\\Windows\\ │
│ │ │ │ │ │ │ │ Temp\\dumpert.dmp" │
│ │ │ │ │ │ │ │ UtcTime: "2019-06-21 07:35:37. │
│ │ │ │ │ │ │ │ 324" │
└─────────────────────┴────────────────────────────────┴───────┴────────────────────────────────┴──────────┴───────────┴──────────────────────────┴──────────────────────────────────┘
COMMAND:
analyse shimcache Create an execution timeline from the shimcache with optional amcache enrichments
USAGE:
chainsaw analyse shimcache [OPTIONS] <SHIMCACHE>
ARGUMENTS:
<SHIMCACHE> The path to the shimcache artefact (SYSTEM registry file)
OPTIONS:
-e, --regex <pattern> A string or regular expression for detecting shimcache entries whose timestamp matches their insertion time
-r, --regexfile <REGEX_FILE> The path to a newline delimited file containing regex patterns for detecting shimcache entries whose timestamp matches their insertion time
-o, --output <OUTPUT> The path to output the result csv file
-a, --amcache <AMCACHE> The path to the amcache artefact (Amcache.hve) for timeline enrichment
-p, --tspair Enable near timestamp pair detection between shimcache and amcache for finding additional insertion timestamps for shimcache entries
-h, --help Print help
--regexfile parameter is included in analysis/shimcache_patterns.txt.Analyse a shimcache artefact with the provided regex patterns, and use amcache enrichment with timestamp near pair detection enabled. Output to a csv file.
./chainsaw analyse shimcache ./SYSTEM --regexfile ./analysis/shimcache_patterns.txt --amcache ./Amcache.hve --tspair --output ./output.csv
Analyse a shimcache artefact with the provided regex patterns (without amcache enrichment). Output to the terminal.
./chainsaw analyse shimcache ./SYSTEM --regexfile ./analysis/shimcache_patterns.txt
Detects two indicators of selective event-log tampering inside one or more .evtx files:
RecordID gaps: per-channel EventRecordID values are normally monotonically increasing with no holes. A hole inside a single evtx file (i.e., not a log-rotation boundary) is unusual and is the fingerprint left by tools that surgically delete individual records (e.g., Eventlogedit-style techniques) without triggering the noisy "log cleared" event (EID 1102).
Time gaps: unexpectedly long quiet windows between consecutive events on a normally-chatty channel can indicate that records inside that window were removed. The threshold is configurable; per-host baselining is left to the analyst.
COMMAND: analyse gaps Detect chronological or RecordID gaps in evtx files (possible selective record deletion)
USAGE: chainsaw analyse gaps [OPTIONS] [PATH]...
ARGUMENTS: [PATH]... The path(s) to evtx files or directories containing them
OPTIONS: --min-time-gap-minutes Minimum time gap (in minutes) between consecutive events to flag as suspicious [default: 30] --no-record-id-gaps Skip RecordID gap detection (only flag time gaps) --no-time-gaps Skip time gap detection (only flag RecordID gaps) -j, --json Print the output in json format -o, --output Save the output to a file -q Suppress informational output --skip-errors Continue when an error is encountered -h, --help Print help
Scan a directory of evtx files for both RecordID and time gaps with the default 30-minute threshold:
./chainsaw analyse gaps ./Logs/
Only look for selectively deleted records (RecordID holes), and emit machine-readable JSON:
./chainsaw analyse gaps ./Logs/ --no-time-gaps --json -o ./gaps.json
The SRUM database parser implemented in Chainsaw differs from other parsers because it does not rely on hardcoded values about the tables. The information is extracted directly from the SOFTWARE hive, which is a mandatory argument. The goal is to avoid errors related to unknown tables.
COMMAND:
analyse srum Analyse the SRUM database
USAGE:
chainsaw analyse srum [OPTIONS] --software <SOFTWARE_HIVE_PATH> <SRUM_PATH>
ARGUMENTS:
<SRUM_PATH> The path to the SRUM database
OPTIONS:
-s, --software <SOFTWARE_HIVE_PATH> The path to the SOFTWARE hive
--stats-only Only output details about the SRUM database
-q Suppress informational output
-o, --output <OUTPUT> Save the output to a file
-h, --help Print help
Analyse the SRUM database (the SOFTWARE hive is mandatory)
./chainsaw analyse srum --software ./SOFTWARE ./SRUDB.dat --output ./output.json
$ ./chainsaw analyse srum --software ./SOFTWARE ./SRUDB.dat -o ./output.json
██████╗██╗ ██╗ █████╗ ██╗███╗ ██╗███████╗ █████╗ ██╗ ██╗
██╔════╝██║ ██║██╔══██╗██║████╗ ██║██╔════╝██╔══██╗██║ ██║
██║ ███████║███████║██║██╔██╗ ██║███████╗███████║██║ █╗ ██║
██║ ██╔══██║██╔══██║██║██║╚██╗██║╚════██║██╔══██║██║███╗██║
╚██████╗██║ ██║██║ ██║██║██║ ╚████║███████║██║ ██║╚███╔███╔╝
╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚══╝╚══╝
By WithSecure Countercept (@FranticTyping, @AlexKornitzer)[+] ESE 데이터베이스 파일을 "/home/user/Documents/SRUDB.dat"에서 로드했습니다
[+] ESE 데이터베이스를 파싱하는 중...
[+] SOFTWARE 하이브를 "/home/user/Documents/SOFTWARE"에서 로드했습니다
[+] SOFTWARE 레지스트리 하이브를 파싱하는 중...
[+] SRUM 데이터베이스를 분석하는 중...
[+] SRUM 확장과 관련된 테이블에 대한 세부 정보:
+------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
| Table GUID | Table Name | DLL Path | Timeframe of the data | Expected Retention Time |
+------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
| {5C8CF1C7-7257-4F13-B223-970EF5939312} | App Timeline Provider | %SystemRoot%\System32\eeprov.dll | 2022-03-10 16:34:59 UTC | 7 days |
| | | | 2022-03-10 21:10:00 UTC | |
+------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
| {B6D82AF1-F780-4E17-8077-6CB9AD8A6FC4} | Tagged Energy Provider | %SystemRoot%\System32\eeprov.dll | No records | 3 days |
+------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
| {D10CA2FE-6FCF-4F6D-848E-B2E99266FA86} | WPN SRUM Provider | %SystemRoot%\System32\wpnsruprov.dll | 2022-03-10 20:09:00 UTC | 60 days |
| | | | 2022-03-10 21:09:00 UTC | |
+------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
| {D10CA2FE-6FCF-4F6D-848E-B2E99266FA89} | Application Resource Usage Provider | %SystemRoot%\System32\appsruprov.dll | 2022-03-10 16:34:59 UTC | 60 days |
| | | | 2022-03-10 21:10:00 UTC | |
+------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
| {FEE4E14F-02A9-4550-B5CE-5FA2DA202E37} | Energy Usage Provider | %SystemRoot%\System32\energyprov.dll | No records | 60 days |
+------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
| {FEE4E14F-02A9-4550-B5CE-5FA2DA202E37}LT | Energy Usage Provider (Long Term) | %SystemRoot%\System32\energyprov.dll | No records | 1820 days |
+------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
| {973F5D5C-1D90-4944-BE8E-24B94231A174} | Windows Network Data Usage Monitor | %SystemRoot%\System32\nduprov.dll | 2022-03-10 16:34:59 UTC | 60 days |
| | | | 2022-03-10 21:10:00 UTC | |
+------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
| {7ACBBAA3-D029-4BE4-9A7A-0885927F1D8F} | vfuprov | %SystemRoot%\System32\vfuprov.dll | 2022-03-10 20:09:00 UTC | 60 days |
| | | | 2022-03-10 21:10:00 UTC | |
+------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
| {DA73FB89-2BEA-4DDC-86B8-6E048C6DA477} | Energy Estimation Provider | %SystemRoot%\System32\eeprov.dll | No records | 7 days |
+------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
| {DD6636C4-8929-4683-974E-22C046A43763} | Windows Network Connectivity Usage Monitor | %SystemRoot%\System32\ncuprov.dll | 2022-03-10 16:34:59 UTC | 60 days |
| | | | 2022-03-10 21:10:00 UTC | |
+------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
[+] SRUM 데이터베이스를 성공적으로 파싱했습니다
[+] 출력을 "/home/user/Documents/output.json"에 저장하는 중
[+] 출력을 "/home/user/Documents/output.json"에 저장했습니다
이 아티팩트와 관련된 새로운 포렌식 인사이트에 대한 정보는 위키에서 확인할 수 있습니다: https://github.com/WithSecureLabs/chainsaw/wiki/SRUM-Analysis.
USAGE:
chainsaw dump [OPTIONS] <PATH>
ARGUMENTS:
<PATH> 덤프할 아티팩트의 경로
OPTIONS:
-j, --json json 형식으로 덤프
--jsonl 출력을 jsonl 형식으로 인쇄
--load-unknown chainsaw가 식별할 수 없는 파일을 로드하도록 허용
-o, --output <OUTPUT> 결과를 출력할 경로
-q 정보성 출력 억제
--skip-errors 오류가 발생하면 계속 헌트
-h, --help 도움말 인쇄
SOFTWARE 하이브 덤프
./chainsaw dump ./SOFTWARE.hve --json --output ./output.json
| 이벤트 유형 | 이벤트 ID |
|---|
| 프로세스 생성 (Sysmon) | 1 |
| 네트워크 연결 (Sysmon) | 3 |
| 이미지 로드 (Sysmon) | 7 |
| 파일 생성 (Sysmon) | 11 |
| 레지스트리 이벤트 (Sysmon) | 13 |
| Powershell 스크립트 블록 | 4104 |
| 프로세스 생성 | 4688 |
| 예약된 작업 생성 | 4698 |
| 서비스 생성 | 7045 |