
Swift 기반 macOS 사고 대응 프레임워크로, 파일 시스템 타임스탬프, 브라우저 데이터, 통합 로그, 지속성 메커니즘 및 프로세스 트리를 포함한 호스트 아티팩트를 수집 및 분석하며, 내장된 분석 및 타임라인 생성 기능을 제공합니다.

Aftermath는 Swift 기반의 오픈 소스 침해 대응 프레임워크입니다.
Aftermath는 방어자가 손상된 호스트의 데이터를 수집하고 분석하기 위해 사용할 수 있습니다. Aftermath는 MDM(이상적)을 통해 배포하거나, 감염된 사용자의 명령줄에서 독립적으로 실행할 수도 있습니다.
Aftermath는 먼저 일련의 모듈을 실행하여 정보를 수집합니다. 출력 결과는 -o 또는 --output 옵션을 통해 원하는 위치에 저장하거나, 기본적으로 /tmp 디렉토리에 기록됩니다.
수집이 완료되면 최종 zip/아카이브 파일을 최종 사용자의 디스크에서 가져올 수 있습니다. 이 파일은 --analyze 인수를 사용하여 아카이브 파일을 지정해 분석할 수 있습니다. 분석 결과는 /tmp 디렉토리에 기록됩니다. 관리자는 해당 분석 디렉토리의 압축을 풀고 로컬에서 수집된 데이터베이스의 파싱된 뷰, 파일 생성/최종 접근/최종 수정 날짜(사용 가능한 경우)가 포함된 파일 타임라인, 그리고 파일 메타데이터, 데이터베이스 변경 사항, 브라우저 정보를 포함하여 감염 경로를 추적할 수 있는 스토리라인을 확인할 수 있습니다.
로컬에서 Aftermath를 빌드하려면 리포지토리에서 클론합니다.
git clone https://github.com/jamf/aftermath.git
cd로 Aftermath 디렉토리로 이동합니다.
cd <path_to_aftermath_directory>
Xcode를 사용하여 빌드합니다.
xcodebuild -scheme "aftermath"
cd로 Release 폴더로 이동합니다.
cd build/Release
aftermath를 실행합니다.
sudo ./aftermath
Aftermath를 실행하려면 루트 권한이 필요하며, 전체 디스크 접근(FDA) 권한도 필요합니다. FDA는 실행 중인 터미널 앱에 부여할 수 있습니다.
기본 사용법은 다음과 같습니다.
sudo ./aftermath
특정 옵션을 지정하려면
sudo ./aftermath [option1] [option2]
예시
sudo ./aftermath -o /Users/user/Desktop --deep
sudo ./aftermath --analyze <path_to_collection_zip>
사용자는 --logs 또는 -l 인수를 사용하여 통합 로그 조건절(predicate)이 포함된 텍스트 파일을 Aftermath에 전달할 수 있습니다. Aftermath에 전달되는 파일은 텍스트 파일이어야 하며, 각 predicate는 줄바꿈으로 구분되어야 합니다. 또한 각 줄 항목은 딕셔너리 객체가 됩니다. 딕셔너리의 키는 사용자가 해당 predicate를 부르고자 하는 이름입니다. 예를 들어, 모든 로그인 이벤트를 보려면 login_events라는 predicate를 생성할 수 있습니다.
login_events: processImagePath contains "loginwindow" and eventMessage contains "com.apple.sessionDidLogin
tcc: process == "tccd"
eslogger와 tcpdump는 별도의 스레드에서 실행되며 가능한 많은 데이터를 수집하는 것이 목표이므로 aftermath가 종료될 때 함께 종료됩니다. 이로 인해 eslogger JSON 파일 또는 tcpdump로 생성된 pcap 파일의 마지막 줄이 잘릴 수 있습니다.
Releases에서 Aftermath.pkg를 사용할 수 있습니다. 이 pkg는 서명 및 공증(notarized)되었습니다. 바이너리를 /usr/local/bin/에 설치합니다. MDM을 통해 배포하는 이상적인 방법입니다. bin에 설치되므로 다음과 같이 aftermath를 실행할 수 있습니다.
sudo aftermath [option1] [option2]
aftermath 바이너리를 제거하려면 Releases에서 AftermathUninstaller.pkg를 실행합니다. 이렇게 하면 바이너리가 제거되고 aftermath --cleanup도 실행되어 aftermath 디렉토리가 삭제됩니다. --output 명령을 사용하여 다른 위치에 aftermath 디렉토리가 남아 있는 경우, 해당 디렉토리를 삭제하는 것은 사용자/관리자의 책임입니다.
--analyze -> analyze the results of the Aftermath results
usage: --analyze <path_to_aftermath_collection_file>
--collect-dirs -> specify locations of (space-separated) directories to dump those raw files
usage: --collect-dirs <path_to_dir> <path_to_another_dir>
--deep or -d -> perform a deep scan of the file system for modified and accessed timestamped metadata
WARNING: This will be a time-intensive, memory-consuming scan.
--disable -> disable a set of aftermath features that may collect personal user data
Available features to disable: browsers -> collecting browser information | browser-killswitch -> force-closes browers | -> databases -> tcc & lsquarantine databases | filesystem -> walking the filesystem for timestamps | proc-info -> collecting process information via TrueTree and eslogger | slack -> slack data | ul -> unified logging modules | all -> all aforementioned options
usage: --disable browsers browser-killswitch databases filesystem proc-info slack
--disable all
--es-logs -> specify which Endpoint Security events (space-separated) to collect (defaults are: create exec mmap). To disable, see --disable es-logs
usage: --es-logs setuid unmount write
--logs -> specify an external text file with unified log predicates (as dictionary objects) to parse
usage: --logs /Users/<USER>/Desktop/myPredicates.txt
-o or --output -> specify an output location for Aftermath collection results (defaults to /tmp)
usage: -o Users/user/Desktop
--pretty -> colorize Terminal output
--cleanup -> remove Aftermath folders from default locations ("/tmp", "/var/folders/zz/)
이 프로젝트는 Jaron Bradley가 작성하고 라이선스를 제공한 오픈 소스 TrueTree 프로젝트를 활용합니다.