Skip to content

MACNEONTOP/macker

Repository files navigation

MacneOnTop 프로젝트

AUL 기반 macOS 이상행위 탐지


📌 프로젝트 개요

macOS의 AUL(Apple Unified Logging System)과 FSEvents 를 활용하여
랜섬웨어 / InfoStealer 등 이상행위를 탐지하는 모니터링 시스템입니다.

🔗 배포 주소

ELK & Agent: [링크]

가이드라인: [링크]


📚 목차


프로젝트 소개

1. 배경 및 목적

2025년 macOS 사용자 수 (OS X + macOS)는 13.1%로 적지않은 사용자를 보이고 있습니다. [출처]

macOS는 다른 운영체제에 비해 상대적으로 안전하다는 평가가 있지만, 최근 macOS를 대상으로 랜섬웨어, 스피어피싱, 공급망 공격, 스파이웨어 등 다양한 위협의 표적이 되고 있습니다. [출처1][출처2][출처3]

2016년세계 개발자 컨퍼런스 ( WWDC, Apple WorldWide Developers Conference)에서 Apple은 기존에 사용하던 syslog와 Apple이 독자적으로 개발한 ASL(Apple System Log) 을 통합한 AUL (Apple Unified Logging System) 통합 로깅 체제을 소개하였습니다.

팀 '막내온탑'은 이러한 AUL을 활용하여 macOS 환경에서 랜섬웨어를 포함한 다양한 이상행위를 탐지할 수 있는 모니터링 도구를 개발하였습니다.

2. 산출물

✔ 1) 이상행위 모니터링 도구 - macker

macOS의 AUL 로그를 기반으로 행위를 분석하고, 이상 징후(InfoStealer, Ransomware 등)를 탐지하는 에이전트/ELK 기반 시스템.

✔ 2) 논문

  1. macOS AUL 기반 행위 탐지 시스템
  2. macOS 버전별 AUL 차이점 분석

✔ 3) 가이드라인

  • macOS 정보유출 분석 가이드라인

탐지 룰 작성

1. Mitre att&ck 매핑

macOS 플랫폼에서 발생 가능한 MITRE ATT&CK 기술(Techniques)에 대해 직접 행위를 재현한 뒤, AUL에 남는 로그를 수집하여 각 기술을 단일 로그에 매핑하였습니다.

또한, Sigma Rule 규칙(Sigma Rule Format)을 기반으로 탐지룰을 작성하여, 보안 전문가들이 쉽게 읽고, 수정하고, 공유할 수 있도록 규칙 표준화를 진행하였습니다.


이상 행위 탐지 방안

1. 스코어링 기반 탐지

본 프로젝트는 아래 두 논문을 기반으로 공격기술 단위 스코어링(Technique Scoring)을 적용합니다.

  • 조성영, 박용우, 이건호, 최창희, 신찬호 and 이경식. (2022). MITRE ATT&CK을 이용한 APT 공격 스코어링 방법 연구. 정보보호학회논문지, 32(4), 673-689.
  • Manocha, H., Srivastava, A., Verma, C., Gupta, R., & Bansal, B. (2021). Security Assessment Rating Framework for Enterprises using MITRE ATT&CK® Matrix. arXiv preprint arXiv:2108.06559.

2. 주요 탐지 룰

Threshold, Sequence 기반 탐지 룰 모음입니다. 각 룰은 특정 공격 패턴이나 이상 행위가 임계값을 초과할 때 알림을 생성합니다.


1. Discovery Storm (내부 정찰 급증)

Rule ID: threshold-001-discovery-storm-v2

설명: 짧은 시간 내에 여러 Discovery 유형의 보안 알림이 발생했습니다. 공격자가 시스템 정보를 수집하고 있을 가능성이 있습니다.

심각도: Medium (Risk Score: 50)

탐지 조건:

  • 쿼리: kibana.alert.rule.tags: "attack.discovery"
  • Threshold: 동일 호스트에서 10회 이상 발생
  • 시간 범위: 6분 이내
  • 검사 주기: 5분

관련 태그:

  • attack.discovery
  • Meta_Alert

2. Critical Impact Sequence (치명적 영향 연속 활동)

Rule ID: threshold-002-impact-activity-v2

설명: 시스템 복구 비활성화 및 서비스 중단과 같은 Impact 유형 알림이 연속적으로 발생했습니다. 랜섬웨어의 징후일 수 있습니다.

심각도: Critical (Risk Score: 90)

탐지 조건:

  • 쿼리: kibana.alert.rule.tags: "attack.impact"
  • Threshold: 동일 호스트에서 2회 이상 발생
  • 시간 범위: 11분 이내
  • 검사 주기: 10분

관련 태그:

  • attack.impact
  • Ransomware_Detection

3. Credential Access Spike (자격증명 탈취 시도 급증)

Rule ID: threshold-003-credential-spike-v2

설명: 짧은 시간 내에 Credential Access 관련 알림이 급증했습니다.

심각도: High (Risk Score: 70)

탐지 조건:

  • 쿼리: kibana.alert.rule.tags: "attack.credential_access"
  • Threshold: 동일 호스트에서 5회 이상 발생
  • 시간 범위: 6분 이내
  • 검사 주기: 5분

관련 태그:

  • attack.credential_access
  • Meta_Alert

4. High Risk Alert Cluster (고위험 알림 클러스터)

Rule ID: threshold-004-high-risk-cluster-v2

설명: 짧은 시간 내에 CRITICAL 또는 HIGH Risk Level을 가진 여러 알림이 발생했습니다.

심각도: High (Risk Score: 85)

탐지 조건:

  • 쿼리: threat_score_1_risk_level: ("CRITICAL" OR "HIGH")
  • Threshold: 동일 호스트에서 3회 이상 발생
  • 시간 범위: 11분 이내
  • 검사 주기: 10분

관련 태그:

  • Risk_Based_Detection

5. SSH Brute Force Attack Detection (SSH 브루트 포스 공격 탐지)

Rule ID: threshold-005-ssh-brute-force

설명: SSH 브루트 포스 공격으로 인해 단일 호스트(대상 서버)에서 5분 이내에 Credential Access 알림이 5회 이상 발생했습니다. 즉각적인 대응이 필요합니다.

심각도: High (Risk Score: 75)

탐지 조건:

  • 쿼리: kibana.alert.rule.tags: "attack.credential_access" AND kibana.alert.rule.name: "*Brute Force via ssh*"
  • Threshold: 동일 호스트에서 5회 이상 발생
  • 시간 범위: 6분 이내
  • 검사 주기: 5분

관련 태그:

  • attack.credential_access
  • Brute_Force_SSH

6. Lateral Movement Indicators (측면 이동 지표)

Rule ID: threshold-lateral-movement-001

설명: 10분 이내에 동일 호스트에서 Lateral Movement 또는 Remote Services 관련 알림이 3회 이상 발생했습니다. APT 공격의 측면 이동 단계입니다.

심각도: High (Risk Score: 80)

탐지 조건:

  • 쿼리: kibana.alert.rule.tags: "attack.lateral_movement"
  • Threshold: 동일 호스트에서 3회 이상 발생
  • 시간 범위: 10분 이내
  • 검사 주기: 5분

관련 태그:

  • attack.lateral_movement

7. Privilege Escalation Attempts (권한 상승 시도)

Rule ID: threshold-privilege-escalation-001

설명: 15분 이내에 동일 호스트에서 Privilege Escalation 관련 알림이 3회 이상 발생했습니다. 반복적인 권한 상승 시도가 탐지되었습니다.

심각도: High (Risk Score: 70)

탐지 조건:

  • 쿼리: kibana.alert.rule.tags: "attack.privilege_escalation"
  • Threshold: 동일 호스트에서 3회 이상 발생
  • 시간 범위: 16분 이내
  • 검사 주기: 5분

관련 태그:

  • attack.privilege_escalation

8. Persistence Establishment Attempts (지속성 확립 시도)

Rule ID: threshold-persistence-attempts-001

설명: 20분 이내에 동일 호스트에서 Persistence 관련 알림이 3회 이상 발생했습니다. 시스템 지속성 확립 시도가 탐지되었습니다.

심각도: High (Risk Score: 75)

탐지 조건:

  • 쿼리: kibana.alert.rule.tags: "attack.persistence"
  • Threshold: 동일 호스트에서 3회 이상 발생
  • 시간 범위: 10분 이내
  • 검사 주기: 5분

관련 태그:

  • attack.persistence

9. Rapid Encryption Activity Detected (고속 암호화 활동)

Rule ID: ransomware-entropy-threshold-001

설명: 높은 엔트로피(>= 7.5)와 낮은 카이제곱 점수(<= 300)로 특징지어지는 잠재적 랜섬웨어 활동을 탐지합니다. 이 룰은 압축 파일을 제외하며, 5분 창 내에 단일 호스트에서 5회 이상의 이벤트가 발생할 때 트리거됩니다.

심각도: Critical (Risk Score: 99)

탐지 조건:

  • 쿼리: fsevents.file.entropy >= 7.5 and fsevents.ransomware.chi_square <= 300
  • Threshold: 동일 호스트에서 5회 이상 발생
  • 시간 범위: 6분 이내
  • 검사 주기: 5분

MITRE ATT&CK:

  • Technique: Data Encrypted for Impact (T1486)

관련 태그:

  • Ransomware
  • Entropy
  • Chi-Square
  • macOS
  • Impact
  • T1486

10. Malware Kill Chain Pattern

Rule ID: eql-malware-killchain-high-risk-001

설명: 30분 이내에 동일 호스트에서 Initial Access → Execution → Persistence 단계 알림이 순차적으로 발생하고, 각 알림의 risk_score가 high 이상일 때 탐지됩니다.

심각도: Critical (Risk Score: 95)

탐지 조건:

sequence by host.name with maxspan=30m
  [any where kibana.alert.rule.tags : "attack.initial_access" and kibana.alert.risk_score >= 70]
  [any where kibana.alert.rule.tags : "attack.execution" and kibana.alert.risk_score >= 70]
  [any where kibana.alert.rule.tags : "attack.persistence" and kibana.alert.risk_score >= 70]

관련 태그:

  • Malware_Pattern
  • Kill_Chain
  • High_Risk
  • attack.initial_access
  • attack.execution
  • attack.persistence

11. Infostealer Kill Chain Pattern

Rule ID: eql-infostealer-killchain-critical-002

설명: 20분 이내에 동일 호스트에서 Discovery → Collection → Exfiltration 단계 알림이 순차적으로 발생하고, 각 알림의 risk_score가 medium 이상일 때 탐지됩니다.

심각도: Critical (Risk Score: 98)

탐지 조건:

sequence by host.name with maxspan=20m
  [any where kibana.alert.rule.tags : "attack.discovery"]
  [any where kibana.alert.rule.tags : "attack.collection"]
  [any where kibana.alert.rule.tags : "attack.exfiltration"]

관련 태그:

  • Infostealer_Pattern
  • Kill_Chain
  • attack.discovery
  • attack.collection
  • attack.exfiltration
  • macOS

위험도 레벨 정의

Risk Score Severity 설명
76-100 Critical 즉각적인 대응 필요, 심각한 보안 위협
56-75 High 높은 우선순위로 조사 필요
41-55 Medium 모니터링 및 검토 필요
1-40 Low 참고용, 정기 검토

시스템 구성 요소

1. Agent

  • macOS 환경에서 실시간 로그를 수집하여 중앙 서버로 전송하는 구성 요소입니다.

filebeat

  • macOS에서 생성되는 AUL(Apple Unified Log)을 실시간 수집
  • 프로세스 단위로 필터링된 로그를 Elasticsearch로 전송하여 즉각적인 분석이 가능하도록 함

fsevents_logger

  • macOS 파일 시스템 이벤트(FSEvents)를 실시간 수집
  • 파일 생성, 수정, 삭제, 권한 변경 등 랜섬웨어 탐지의 데이터 제공

2. ELK

Elasticsearch

  • Agent가 전송한 AUL 및 FSEvents 로그를 저장
  • Sigma Rule 기반으로 변환된 Detection Rule을 실행하여 이상행위 탐지 결과(alert)를 생성

Logstash

  • Agent에서 수신한 로그를 Elasticsearch가 이해할 수 있는 형태로 파싱함
  • Agent와 ELK 스택을 연결하는 중간 처리 역할을 수행함

Kibana

  • 수집된 로그와 탐지 결과를 시각화
  • 대시보드 제공

MacneOnTop Project (English Version)

macOS Anomaly Detection Based on AUL



📌 Project Overview

This is a monitoring system that utilizes macOS AUL (Apple Unified Logging System) and FSEvents to detect anomalous behaviors such as Ransomware and InfoStealer.

🔗 Deployment Links

ELK & Agent: [Link]

Guidelines: [Link]


📚 Table of Contents


Project Introduction

1. Background and Purpose

In 2025, the number of macOS users (OS X + macOS) accounts for 13.1% of the market, showing a significant user base. [Source]

While macOS is evaluated as relatively safer compared to other operating systems, it has recently become a target for various threats such as Ransomware, Spear Phishing, Supply Chain Attacks, and Spyware. [Source 1][Source 2][Source 3]

At the 2016 WWDC (Apple Worldwide Developers Conference), Apple introduced the AUL (Apple Unified Logging System), which integrates the existing syslog and the Apple-developed ASL (Apple System Log).

Team 'MacneOnTop' has developed a monitoring tool capable of detecting various anomalous behaviors, including ransomware, in the macOS environment by utilizing this AUL.

2. Outputs

✔ 1) Anomaly Monitoring Tool - macker

An Agent/ELK-based system that analyzes behaviors based on macOS AUL logs to detect anomalies (InfoStealer, Ransomware, etc.).

✔ 2) Papers

  1. macOS AUL-based Behavior Detection System
  2. Analysis of AUL Differences by macOS Version

✔ 3) Guidelines

  • macOS Information Leakage Analysis Guideline

Writing Detection Rules

1. MITRE ATT&CK Mapping

We reproduced behaviors for MITRE ATT&CK Techniques applicable to the macOS platform, collected the resulting AUL logs, and mapped each technique to a single log.

Additionally, we standardized the rules based on the Sigma Rule Format so that security experts can easily read, modify, and share them.


Anomaly Detection Methods

1. Scoring-Based Detection

This project applies Technique Scoring based on the following two papers:

  • Cho Seong-young, Park Yong-woo, Lee Geon-ho, Choi Chang-hee, Shin Chan-ho, and Lee Kyung-sik. (2022). A Study on APT Attack Scoring Method Using MITRE ATT&CK. Journal of the Korea Institute of Information Security & Cryptology, 32(4), 673-689.
  • Manocha, H., Srivastava, A., Verma, C., Gupta, R., & Bansal, B. (2021). Security Assessment Rating Framework for Enterprises using MITRE ATT&CK® Matrix. arXiv preprint arXiv:2108.06559.

2. Key Detection Rules

A collection of Threshold and Sequence-based detection rules. Each rule generates an alert when a specific attack pattern or anomalous behavior exceeds a defined threshold.


1. Discovery Storm (Surge in Internal Reconnaissance)

Rule ID: threshold-001-discovery-storm-v2

Description: Multiple Discovery-type security alerts occurred within a short period. An attacker may be collecting system information.

Severity: Medium (Risk Score: 50)

Detection Conditions:

  • Query: kibana.alert.rule.tags: "attack.discovery"
  • Threshold: Occurs 10 or more times on the same host
  • Time Range: Within 6 minutes
  • Check Interval: 5 minutes

Related Tags:

  • attack.discovery
  • Meta_Alert

2. Critical Impact Sequence (Continuous Impact Activity)

Rule ID: threshold-002-impact-activity-v2

Description: Continuous Impact-type alerts, such as disabling system recovery or service interruption, have occurred. This may be a sign of ransomware.

Severity: Critical (Risk Score: 90)

Detection Conditions:

  • Query: kibana.alert.rule.tags: "attack.impact"
  • Threshold: Occurs 2 or more times on the same host
  • Time Range: Within 11 minutes
  • Check Interval: 10 minutes

Related Tags:

  • attack.impact
  • Ransomware_Detection

3. Credential Access Spike (Surge in Credential Theft Attempts)

Rule ID: threshold-003-credential-spike-v2

Description: Alerts related to Credential Access surged within a short period.

Severity: High (Risk Score: 70)

Detection Conditions:

  • Query: kibana.alert.rule.tags: "attack.credential_access"
  • Threshold: Occurs 5 or more times on the same host
  • Time Range: Within 6 minutes
  • Check Interval: 5 minutes

Related Tags:

  • attack.credential_access
  • Meta_Alert

4. High Risk Alert Cluster

Rule ID: threshold-004-high-risk-cluster-v2

Description: Multiple alerts with a CRITICAL or HIGH Risk Level occurred within a short period.

Severity: High (Risk Score: 85)

Detection Conditions:

  • Query: threat_score_1_risk_level: ("CRITICAL" OR "HIGH")
  • Threshold: Occurs 3 or more times on the same host
  • Time Range: Within 11 minutes
  • Check Interval: 10 minutes

Related Tags:

  • Risk_Based_Detection

5. SSH Brute Force Attack Detection

Rule ID: threshold-005-ssh-brute-force

Description: Credential Access alerts caused by SSH Brute Force attacks occurred 5 or more times on a single host (target server) within 5 minutes. Immediate response is required.

Severity: High (Risk Score: 75)

Detection Conditions:

  • Query: kibana.alert.rule.tags: "attack.credential_access" AND kibana.alert.rule.name: "*Brute Force via ssh*"
  • Threshold: Occurs 5 or more times on the same host
  • Time Range: Within 6 minutes
  • Check Interval: 5 minutes

Related Tags:

  • attack.credential_access
  • Brute_Force_SSH

6. Lateral Movement Indicators

Rule ID: threshold-lateral-movement-001

Description: Alerts related to Lateral Movement or Remote Services occurred 3 or more times on the same host within 10 minutes. This indicates the lateral movement phase of an APT attack.

Severity: High (Risk Score: 80)

Detection Conditions:

  • Query: kibana.alert.rule.tags: "attack.lateral_movement"
  • Threshold: Occurs 3 or more times on the same host
  • Time Range: Within 10 minutes
  • Check Interval: 5 minutes

Related Tags:

  • attack.lateral_movement

7. Privilege Escalation Attempts

Rule ID: threshold-privilege-escalation-001

Description: Alerts related to Privilege Escalation occurred 3 or more times on the same host within 15 minutes. Repeated privilege escalation attempts were detected.

Severity: High (Risk Score: 70)

Detection Conditions:

  • Query: kibana.alert.rule.tags: "attack.privilege_escalation"
  • Threshold: Occurs 3 or more times on the same host
  • Time Range: Within 16 minutes
  • Check Interval: 5 minutes

Related Tags:

  • attack.privilege_escalation

8. Persistence Establishment Attempts

Rule ID: threshold-persistence-attempts-001

Description: Alerts related to Persistence occurred 3 or more times on the same host within 20 minutes. Attempts to establish system persistence were detected.

Severity: High (Risk Score: 75)

Detection Conditions:

  • Query: kibana.alert.rule.tags: "attack.persistence"
  • Threshold: Occurs 3 or more times on the same host
  • Time Range: Within 10 minutes
  • Check Interval: 5 minutes

Related Tags:

  • attack.persistence

9. Rapid Encryption Activity Detected

Rule ID: ransomware-entropy-threshold-001

Description: Detects potential ransomware activity characterized by high entropy (>= 7.5) and low chi-square scores (<= 300). This rule excludes compressed files and triggers when 5 or more events occur on a single host within a 5-minute window.

Severity: Critical (Risk Score: 99)

Detection Conditions:

  • Query: fsevents.file.entropy >= 7.5 and fsevents.ransomware.chi_square <= 300
  • Threshold: Occurs 5 or more times on the same host
  • Time Range: Within 6 minutes
  • Check Interval: 5 minutes

MITRE ATT&CK:

  • Technique: Data Encrypted for Impact (T1486)

Related Tags:

  • Ransomware
  • Entropy
  • Chi-Square
  • macOS
  • Impact
  • T1486

10. Malware Kill Chain Pattern

Rule ID: eql-malware-killchain-high-risk-001

Description: Detected when alerts for Initial Access → Execution → Persistence stages occur sequentially on the same host within 30 minutes, and the risk_score for each alert is High or above.

Severity: Critical (Risk Score: 95)

Detection Conditions:

sequence by host.name with maxspan=30m
  [any where kibana.alert.rule.tags : "attack.initial_access" and kibana.alert.risk_score >= 70]
  [any where kibana.alert.rule.tags : "attack.execution" and kibana.alert.risk_score >= 70]
  [any where kibana.alert.rule.tags : "attack.persistence" and kibana.alert.risk_score >= 70]

Related Tags:

  • Malware_Pattern
  • Kill_Chain
  • High_Risk
  • attack.initial_access
  • attack.execution
  • attack.persistence

11. Infostealer Kill Chain Pattern

Rule ID: eql-infostealer-killchain-critical-002

Description: Detected when alerts for Discovery → Collection → Exfiltration stages occur sequentially on the same host within 20 minutes, and the risk_score for each alert is Medium or above.

Severity: Critical (Risk Score: 98)

Detection Conditions:

sequence by host.name with maxspan=20m
  [any where kibana.alert.rule.tags : "attack.discovery"]
  [any where kibana.alert.rule.tags : "attack.collection"]
  [any where kibana.alert.rule.tags : "attack.exfiltration"]

Related Tags:

  • Infostealer_Pattern
  • Kill_Chain
  • attack.discovery
  • attack.collection
  • attack.exfiltration
  • macOS

Risk Level Definitions

Risk Score Severity Description
76-100 Critical Immediate response required, severe security threat
56-75 High Investigation required with high priority
41-55 Medium Monitoring and review required
1-40 Low For reference, regular review

System Components

1. Agent

  • A component that collects real-time logs in the macOS environment and sends them to the central server.

filebeat

  • Collects AUL (Apple Unified Log) generated in macOS in real-time.
  • Sends logs filtered by process to Elasticsearch to enable immediate analysis.

fsevents_logger

  • Collects macOS File System Events (FSEvents) in real-time.
  • Provides data for ransomware detection such as file creation, modification, deletion, and permission changes.

2. ELK

Elasticsearch

  • Stores AUL and FSEvents logs sent by the Agent.
  • Executes Detection Rules converted based on Sigma Rules to generate anomaly detection results (alerts).

Logstash

  • Parses logs received from the Agent into a format that Elasticsearch can understand.
  • Acts as an intermediate processor connecting the Agent and the ELK stack.

Kibana

  • Visualizes collected logs and detection results.
  • Provides Dashboards.

About

macker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors