MacOS 스틸러, 관찰됨: 방어자들이 주의해야 할 것
Detection stack
- AIDR
- Alert
- ETL
- Query
요약
이 기사는 AMOS 에코시스템과 관련된 macOS 자격 증명 도용기를 프로파일링하며, 가짜 소프트웨어 업데이트 페이지를 통해 전달됩니다. 피해자들은 rvdownloads.com에서 헬퍼 바이너리를 끌어오는 명령 체인을 실행하도록 압박받고, 이를 zsh를 통해 실행하며 비밀번호, 브라우저 아티팩트, 암호화 지갑 확장, Apple Notes 및 로컬 파일을 수집하기 위해 난독화된 AppleScript를 트리거합니다. 지속성은 합법적인 Spotlight 구성 요소로 가장하는 악성 LaunchAgent plist를 사용하여 설정됩니다. 이 글은 또한 관찰된 IOCs 및 감염 흐름을 검증하는 데 사용된 분석 단계를 공유합니다.
조사
연구자는 Base64로 인코딩된 URL을 가져오는 초기 curl 원라이너를 캡처하고, 헬퍼 바이너리의 후속 curl 다운로드를 관찰했습니다. 헬퍼는 VM 탐지를 위한 하나의 AppleScript와 수집 및 유출을 처리하는 또 다른 AppleScript를 실행했습니다. 도용기는 Keychain에서 자격 증명을 가져오고 보안 도구를 종료하려 시도하며, 브라우저와 지갑 데이터를 수확하고, Apple Notes를 복사하고, 결과를 아카이브로 묶어 laislivon.com으로 업로드합니다. 지속성은 사용자 로그인 시 전체 스크립트 체인을 다시 실행하는 LaunchAgent를 설치함으로써 생성됩니다.
완화
식별된 악성 도메인을 차단하고, 서명되지 않은 스크립트 실행을 제한하며, 새로운 LaunchAgents에 연결된 비정상적인 launchctl 로드 활동을 모니터링하여 노출을 줄일 수 있습니다. 특히 익숙하지 않은 호스트에서 원격 콘텐츠를 가져올 때 suspicious한 curl과 osascript 조합을 플래그화하는 엔드포인트 컨트롤을 사용하십시오. 가능한 경우 특권 실행을 제한하고 신뢰할 수 없는 헬퍼 바이너리가 실행되지 않도록 애플리케이션 허용 목록을 적용하십시오.
대응
지표가 발견되면 엔드포인트를 격리하고, 활성 악성 프로세스를 종료하며, 헬퍼 바이너리를 제거하고, 악성 LaunchAgent plist를 삭제하십시오. 잠재적으로 노출된 자격 증명과 토큰을 재설정하여 Keychain 비밀과 브라우저에 저장된 데이터를 우선적으로 처리하십시오. 나열된 IOC에 대한 포렌식 아티팩트를 수집하고, curl/osascript 실행에 대한 시스템 로그를 검토하며, 동일한 C2 인프라에 연결된 반복적인 콜백 또는 다운로드 시도를 모니터링하십시오.
"graph TB %% Class Definitions classDef action fill:#99ccff classDef tool fill:#cccccc classDef technique fill:#ffedcc classDef process fill:#e2e2ff %% Nodes u2013 Actions action_initial_access["<b>Action</b> – <b>T1219 Remote Access Tools</b><br/>Execute a curl command that decodes a base64 URL and runs a zsh shell to download a secondary payload from rvdownloads.com/frozenfix/update."] class action_initial_access action action_obfuscation["<b>Action</b> – <b>T1027 Obfuscation</b><br/>Helper script hides strings using Base64, custom arithmetic, binary padding and junk code insertion."] class action_obfuscation action action_sandbox_evasion["<b>Action</b> – <b>T1497.002 Virtualization Sandbox Evasion</b><br/>AppleScript checks system_profiler output for VM indicators such as QEMU, VMware and KVM."] class action_sandbox_evasion action action_credential_harvest["<b>Action</b> – <b>T1056.002 GUI Input Capture</b><br/>Forged osascript dialog prompts for admin password, validates it against the Keychain and stores it in ~/.pwd."] class action_credential_harvest action action_defense_evasion["<b>Action</b> – <b>T1027.005 Indicator Removal from Tools</b><br/>Malware terminates Little Snitch and BlockBlock and unloads their launch agents."] class action_defense_evasion action action_browser_theft["<b>Action</b> – <b>T1217 Browser Information Discovery</b><br/>Enumerates Chrome, Brave, Edge, Opera and Firefox profiles and extracts login data, cookies, autofill and extension data, targeting cryptou2011wallet extensions."] class action_browser_theft action action_notes_theft["<b>Action</b> – Apple Notes Data Theft<br/>Copies the Notes SQLite database and associated media files to a staging folder."] class action_notes_theft action action_data_staging["<b>Action</b> – <b>T1132 Data Encoding</b><br/>Copies collected files to /tmp/stolen_data and compresses them into archive.tar.gz."] class action_data_staging action action_c2["<b>Action</b> – <b>T1102 Web Service</b><br/>Uploads the compressed archive via a curl POST to https://laislivon.com/upload."] class action_c2 action action_persistence["<b>Action</b> – <b>T1543.001 Launch Agent Persistence</b><br/>Writes a LaunchAgent plist (com.apple.mdworker.plist) to ~/Library/LaunchAgents and loads it with launchctl."] class action_persistence action action_execution["<b>Action</b> – <b>T1127.003 Trusted Developer Utilities Proxy Execution</b><br/>Executes the malicious AppleScript on each login using osascript, leveraging trusted developer utilities."] class action_execution action %% Nodes u2013 Tools tool_curl["<b>Tool</b> – <b>Name</b>: curl<br/><b>Description</b>: Transfers data from remote servers using URL syntax."] class tool_curl tool tool_osascript["<b>Tool</b> – <b>Name</b>: osascript<br/><b>Description</b>: Executes AppleScript or JavaScript for Automation scripts on macOS."] class tool_osascript tool tool_launchctl["<b>Tool</b> – <b>Name</b>: launchctl<br/><b>Description</b>: Manages launch agents and daemons on macOS."] class tool_launchctl tool %% Nodes u2013 Techniques (additional detail) tech_T1027_008["<b>Technique</b> – T1027.008 Stripped Payloads<br/>Payloads are stripped of symbols and debugging information to hinder analysis."] class tech_T1027_008 technique tech_T1027_001["<b>Technique</b> – T1027.001 Binary Padding<br/>Adds nonu2011functional bytes to binaries to change size and hash."] class tech_T1027_001 technique tech_T1027_007["<b>Technique</b> – T1027.007 Dynamic API Resolution<br/>Resolves API calls at runtime to avoid static detection."] class tech_T1027_007 technique tech_T1027_016["<b>Technique</b> – T1027.016 Junk Code Insertion<br/>Inserts irrelevant instructions to confuse analysis tools."] class tech_T1027_016 technique tech_T1140["<b>Technique</b> – T1140 Deobfuscate/Decode Files or Information<br/>Decodes or deobfuscates data before execution."] class tech_T1140 technique tech_T1555_001["<b>Technique</b> – T1555.001 Credentials from Password Stores: Keychain<br/>Extracts stored credentials from the macOS Keychain."] class tech_T1555_001 technique tech_T1555_002["<b>Technique</b> – T1555.002 Credentials from Password Stores: Securityd Memory<br/>Reads credentials from the security daemon memory."] class tech_T1555_002 technique tech_T1555_003["<b>Technique</b> – T1555.003 Credentials from Web Browsers<br/>Steals saved passwords from browsers."] class tech_T1555_003 technique tech_T1606_001["<b>Technique</b> – T1606.001 Forge Web Credentials: Web Cookies<br/>Collects browser cookies for session hijacking."] class tech_T1606_001 technique tech_T1132_001["<b>Technique</b> – T1132.001 Standard Encoding<br/>Uses standard encoding (e.g., gzip) for data compression."] class tech_T1132_001 technique tech_T1546_009["<b>Technique</b> – T1546.009 Event Triggered Execution: AppCert DLLs<br/>Triggers execution via trusted system events."] class tech_T1546_009 technique %% Flow Connections action_initial_access –>|uses| tool_curl tool_curl –>|downloads| action_obfuscation action_obfuscation –>|employs| tech_T1027_008 action_obfuscation –>|employs| tech_T1027_001 action_obfuscation –>|employs| tech_T1027_007 action_obfuscation –>|employs| tech_T1027_016 action_obfuscation –>|employs| tech_T1140 action_obfuscation –>|leads to| action_sandbox_evasion action_sandbox_evasion –>|checks for| tech_T1497_002 action_sandbox_evasion –>|leads to| action_credential_harvest action_credential_harvest –>|uses| tool_osascript action_credential_harvest –>|captures| tech_T1056_002 action_credential_harvest –>|extracts| tech_T1555_001 action_credential_harvest –>|extracts| tech_T1555_002 action_credential_harvest –>|leads to| action_defense_evasion action_defense_evasion –>|removes| tech_T1027_005 action_defense_evasion –>|leads to| action_browser_theft action_browser_theft –>|discovers| tech_T1217 action_browser_theft –>|steals| tech_T1555_003 action_browser_theft –>|collects| tech_T1606_001 action_browser_theft –>|leads to| action_notes_theft action_notes_theft –>|stores in| action_data_staging action_data_staging –>|compresses with| tech_T1132 action_data_staging –>|uses encoding| tech_T1132_001 action_data_staging –>|leads to| action_c2 action_c2 –>|uploads via| tool_curl action_c2 –>|uses| tech_T1102 action_c2 –>|leads to| action_persistence action_persistence –>|creates| tech_T1543_001 action_persistence –>|loads with| tool_launchctl action_persistence –>|leads to| action_execution action_execution –>|executes with| tool_osascript action_execution –>|leverages| tech_T1127_003 action_execution –>|triggered by| tech_T1546_009 "
공격 흐름
탐지
Possible System_profiler Enumeration Attempt (via process_creation)
보기
Possible Collection by macOS Local Credential Input (via cmdline)
보기
Archive Was Created In MacOS Temporary Folder (via file_event)
보기
Possible MacOS Browser Password Discovery Attempt (via cmdline)
보기
Suspicious Curl Execution Attempt [MacOS] (via cmdline)
보기
Possible Base64 Encoded Strings Manipulation [MacOS] (via cmdline)
보기
Detection of Malicious curl and Base64 Command Execution [Linux Process Creation]
보기
Detection of macOS Stealer Persistence and Data Exfiltration [Linux File Event]
보기
시뮬레이션 실행
선행 조건: 텔레메트리 및 기준 프리플라이트 점검이 통과해야 합니다.
이유: 이 섹션은 탐지 규칙을 트리거하도록 설계된 적대적 기술(TTP)의 정확한 실행을 상세히 설명합니다. 명령 및 서술은 반드시 식별된 TTP를 직접 반영해야 하며, 탐지 논리가 기대하는 정확한 텔레메트리를 생성하는 것을 목표로 합니다.
-
공격 서사 및 명령:
사용자 수준 액세스를 획득한 공격자는 지속성을 설정하고 수집한 자격 증명을 유출하려고 합니다.
- 지속성: 공격자는 표준 macOS LaunchAgents 디렉토리에 악성 LaunchAgent plist를 쓰고 (리눅스 수집기에서 홈 디렉토리 경로를 통해 시뮬레이션) 기록됩니다.
- 데이터 수집: 민감한 파일을 스테이징 폴더에 복사합니다.
- 유출 준비: 스테이징된 데이터는
/tmp/archive.tar.gz으로 아카이브됩니다tar네이티브 유틸리티를 사용하여 - 작동: 공격자는
launchctl을 사용하여 LaunchAgent를 로드하여 각 사용자 로그인 시 악성 코드가 실행되도록 합니다.
명령줄은 규칙에서 감시하는 문자열과 정확히 일치하여 경고가 생성되도록 합니다.
-
회귀 테스트 스크립트:
#!/usr/bin/env bash set -euo pipefail # 1. 샘플 "도난" 파일 생성 echo "password123" > /tmp/credentials.txt # 2. 악성 LaunchAgent plist 생성 (시뮬레이션 위치) PLIST_PATH="$HOME/Library/LaunchAgents/com.apple.mdworker.plist" mkdir -p "$(dirname "$PLIST_PATH")" cat > "$PLIST_PATH" <<EOF Labelcom.apple.mdworker ProgramArguments /usr/bin/cat /tmp/credentials.txt RunAtLoad EOF # 3. "도난" 데이터 아카이브 (규칙에서 감시하는 정확한 경로) tar -czf /tmp/archive.tar.gz -C /tmp credentials.txt # 4. LaunchAgent 로드 (규칙에서 모니터링하는 명령줄을 생성합니다) launchctl load "$PLIST_PATH" echo "시뮬레이션 완료 – 탐지가 발신될 것입니다." -
정리 명령:
#!/usr/bin/env bash set -euo pipefail # LaunchAgent 언로드 launchctl unload "$HOME/Library/LaunchAgents/com.apple.mdworker.plist" || true # 파일 제거 rm -f "$HOME/Library/LaunchAgents/com.apple.mdworker.plist" rm -f /tmp/archive.tar.gz rm -f /tmp/credentials.txt echo "정리 완료."