
Windows 포렌식 아티팩트를 신속하게 검색하고 헌팅하세요
Chainsaw는 이벤트 로그 및 MFT 파일과 같은 Windows 포렌식 아티팩트 내에서 위협을 신속하게 식별할 수 있는 강력한 '1차 대응(first-response)' 기능을 제공합니다. Chainsaw는 이벤트 로그에서 키워드를 검색하는 일반적이고 빠른 방법을 제공하며, Sigma 탐지 규칙에 대한 기본 제공 지원과 사용자 정의 Chainsaw 탐지 규칙을 통해 위협을 식별합니다.
확장 정보는 이 도구의 Wiki에서 확인할 수 있습니다: https://github.com/WithSecureLabs/chainsaw/wiki
WithSecure Countercept에서는 EDR 에이전트를 통해 엔드포인트의 다양한 텔레메트리 소스를 수집하여 관리형 탐지 및 대응 서비스를 제공합니다. 그러나 EDR이 포착하지 못한 포렌식 아티팩트를 신속하게 분석해야 하는 상황이 있습니다. 대표적인 예로 침해 당시 EDR이 설치되지 않은 환경에서의 침해 사고 대응 조사가 있습니다. Chainsaw는 위협 헌터와 침해 사고 대응 컨설턴트가 이러한 상황에서 포렌식 아티팩트를 신속하게 분류(triage)할 수 있는 도구를 제공하기 위해 만들어졌습니다.
Windows 이벤트 로그는 위협 헌팅 및 침해 사고 대응 조사에 유용한 풍부한 포렌식 정보 소스입니다. 안타깝게도 이벤트 로그를 처리하고 검색하는 작업은 느리고 시간이 많이 걸리는 프로세스일 수 있으며, 대부분의 경우 ELK 스택이나 Splunk 인스턴스와 같은 주변 인프라의 오버헤드가 필요합니다. 이러한 오버헤드로 인해 블루 팀은 Windows 이벤트 로그를 신속하게 분류하여 조사를 진행하는 데 필요한 방향성과 결론을 도출하지 못하는 경우가 많습니다. Chainsaw는 Windows 이벤트 로그를 빠르게 검색하고 헌팅할 수 있게 해주므로 이 문제를 해결합니다.
현재 시점에서, Windows 이벤트 로그를 분류하고, 로그 내 흥미로운 요소를 식별하며, Sigma와 같은 탐지 로직 규칙 형식을 적용하여 악성 활동의 징후를 감지할 수 있는 간단하고 빠른 방법을 제공하는 오픈소스 독립형 도구는 거의 없습니다. 테스트 결과, 기존 도구들은 대량의 이벤트 로그에 탐지 로직을 효율적으로 적용하지 못하여 빠른 분류가 필요한 시나리오에는 적합하지 않았습니다.
--sigma 및 --mapping 매개변수를 사용하여 SIGMA 탐지 규칙의 하위 집합(또는 전체 SIGMA git 저장소)이 포함된 디렉터리를 지정하면 chainsaw가 자동으로 해당 규칙을 로드, 변환 및 제공된 이벤트 로그에 대해 실행합니다. 매핑 파일은 규칙 매칭에 사용할 이벤트 로그의 필드를 chainsaw에 알려줍니다. 기본적으로 Chainsaw는 광범위한 이벤트 로그 유형을 지원하며, 여기에는 다음이 포함되지만 이에 국한되지는 않습니다:
규칙 탐지에 사용되는 전체 필드 목록은 매핑 파일을 참조하고, 필요에 따라 자유롭게 확장하십시오.
Sigma 규칙 지원 외에도 Chainsaw는 사용자 정의 규칙 형식을 지원합니다. 저장소에는 사용자가 다음을 수행할 수 있게 해주는 다양한 Chainsaw 규칙이 포함된 rules 디렉터리가 있습니다:
Chainsaw v2 릴리스와 함께, 우리는 Sigma 규칙 및 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 규칙 및 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
However, if you want to build chainsaw yourself, using Nix, you can once again utilize `flake.nix`, which is provided with this repository.
To build the binary, please run the following, in the root dir of cloned repo```
nix build .#
이렇게 하면 ./result 디렉터리가 생성되며, chainsaw 바이너리는 ./result/bin/chainsaw 아래에 위치합니다.
chainsaw를 다운로드하여 실행할 때 로컬 EDR/안티바이러스 엔진이 Chainsaw를 악성으로 탐지하는 경우가 있습니다. 이에 대한 예시는 다음 GitHub 이슈에서 확인할 수 있습니다: 예제1, 예제2.
이러한 경고는 일반적으로 악성 문자열(예: "mimikatz")에 대한 참조를 포함하는 예제 이벤트 로그 및/또는 Sigma 규칙 때문입니다. 또한 일부 소수의 안티바이러스 엔진이 일종의 휴리스틱 탐지로 인해 Chainsaw 바이너리를 탐지하는 사례도 확인되었습니다.
2022년 7월에 우리는 Chainsaw가 작동하는 방식을 대대적으로 개편한 버전 2를 출시했습니다. Chainsaw v2에는 다음과 같은 주요 개선 사항이 포함되어 있습니다:
여전히 Chainsaw 버전 1을 사용하려면 릴리스 섹션에서 컴파일된 바이너리를 찾거나, v1.x.x 브랜치에서 소스 코드에 접근할 수 있습니다. Chainsaw v1은 더 이상 유지관리되지 않으며, 모든 사용자는 Chainsaw v2로 전환하는 것이 좋습니다.
@AlexKornitzer 님께 큰 감사를 드립니다. 그는 Chainsaw v1의 "Christmas Project" 코드베이스를 v2에서 완성도 높은 제품으로 전환했습니다.
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
모든 .evtx 파일에서 대소문자를 구분하지 않는 문자열 "mimikatz" 검색
./chainsaw search mimikatz -i evtx_attack_samples/
*모든 .evtx 파일에서 PowerShell 스크립트 블록 이벤트(Event ID 4014) 검색
./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 매개변수에 대한 예시 패턴 파일은 analysis/shimcache_patterns.txt에 포함되어 있습니다.제공된 정규식 패턴으로 shimcache 아티팩트를 분석하고, 타임스탬프 근접 쌍 탐지를 활성화한 amcache 보강을 사용합니다. 결과를 csv 파일로 출력합니다.
./chainsaw analyse shimcache ./SYSTEM --regexfile ./analysis/shimcache_patterns.txt --amcache ./Amcache.hve --tspair --output ./output.csv
제공된 정규식 패턴으로 shimcache 아티팩트를 분석합니다 (amcache 보강 없이). 결과를 터미널에 출력합니다.
./chainsaw analyse shimcache ./SYSTEM --regexfile ./analysis/shimcache_patterns.txt
하나 이상의 .evtx 파일 내에서 선택적 이벤트 로그 변조의 두 가지 징후를 탐지합니다:
RecordID 갭: 각 채널의 EventRecordID 값은 일반적으로 구멍 없이 단조 증가합니다. 단일 evtx 파일 내부의 구멍(즉, 로그 순환 경계가 아닌 경우)은 비정상적이며, 시끄러운 "로그 지워짐" 이벤트(EID 1102)를 트리거하지 않고 개별 레코드를 수술적으로 삭제하는 도구(예: Eventlogedit 스타일 기법)가 남기는 지문입니다.
시간 갭: 일반적으로 활동이 많은 채널에서 연속 이벤트 사이에 예기치 않게 긴 조용한 구간은 해당 구간의 레코드가 제거되었음을 나타낼 수 있습니다. 임계값은 구성 가능하며, 호스트별 기준선 설정은 분석가의 몫입니다.
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
기본 30분 임계값으로 evtx 파일 디렉터리에서 RecordID 및 시간 갭을 모두 스캔합니다:
./chainsaw analyse gaps ./Logs/
선택적으로 삭제된 레코드(RecordID 구멍)만 찾고, 머신이 읽을 수 있는 JSON을 출력합니다:
./chainsaw analyse gaps ./Logs/ --no-time-gaps --json -o ./gaps.json
Chainsaw에 구현된 SRUM 데이터베이스 파서는 테이블에 대한 하드코딩된 값에 의존하지 않는다는 점에서 다른 파서와 다릅니다. 정보는 필수 인자인 SOFTWARE 하이브에서 직접 추출됩니다. 목표는 알 수 없는 테이블과 관련된 오류를 피하는 것입니다.
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
SRUM 데이터베이스를 분석합니다 (SOFTWARE 하이브는 필수입니다)
./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 database file loaded from "/home/user/Documents/SRUDB.dat"
[+] Parsing the ESE database...
[+] SOFTWARE hive loaded from "/home/user/Documents/SOFTWARE"
[+] Parsing the SOFTWARE registry hive...
[+] Analysing the SRUM database...
[+] Details about the tables related to the SRUM extensions:
+------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
| 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 database parsed successfully
[+] Saving output to "/home/user/Documents/output.json"
[+] Saved output to "/home/user/Documents/output.json"
이 아티팩트와 관련된 새로운 포렌식 인사이트에 대한 정보는 위키에서 확인할 수 있습니다: https://github.com/WithSecureLabs/chainsaw/wiki/SRUM-Analysis.
USAGE:
chainsaw dump [OPTIONS] <PATH>
ARGUMENTS:
<PATH> The path to an artefact to dump
OPTIONS:
-j, --json Dump in json format
--jsonl Print the output in jsonl format
--load-unknown Allow chainsaw to try and load files it cannot identify
-o, --output <OUTPUT> A path to output results to
-q Suppress informational output
--skip-errors Continue to hunt when an error is encountered
-h, --help Print 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 |