Skip to content
KitploitKITPLOIT
도구블로그
제출
도구블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
macos_xprotect — Apple의 내장 악성코드 보호 기능에 대한 교육적 심층 분석: 서명 데이터베이스, YARA 규칙, Gatekeeper 통합, 복구 바이너리 및 macOS 탐지 흐름. | Kitploit
도구/GitHubGitHub/yo-yo-yo-jbo/macos_xprotect
Defensive ToolsMalware AnalysisBinary AnalysisLearning & Education
GitHubyo-yo-yo-jbo/macos_xprotect

macos_xprotect

Apple의 내장 악성코드 보호 기능에 대한 교육적 심층 분석: 서명 데이터베이스, YARA 규칙, Gatekeeper 통합, 복구 바이너리 및 macOS 탐지 흐름.

저장소 보기
311개월 전아직 검토되지 않음

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

macOS - XProtect 소개

macOS 소개 블로그 포스트 시리즈에 이어서, XProtect에 관한 짧은 블로그 포스트를 작성하기로 했습니다.

XProtect란 무엇인가?

XProtect는 Apple이 macOS에 내장한 안티바이러스 및 악성코드 시그니처 시스템입니다.
XProtectService의 일부로 작동하며, 알려진 악성코드 시그니처가 있는지 애플리케이션 및 기타 실행 콘텐츠를 검사합니다.
XProtect는 백그라운드에서 작동하며 Apple이 XProtectRemediator 메커니즘을 통해 자동으로 업데이트합니다(자세한 내용은 나중에 설명).
다음과 같은 3가지 주요 기능이 있습니다:

  • 시그니처 기반 탐지 – 알려진 악성코드 시그니처 데이터베이스를 기준으로 파일을 검사합니다.
  • 행동 기반 탐지(XProtect Remediator) – macOS Monterey에서 도입되었으며, 정적 시그니처뿐만 아니라 의심스러운 행동을 기반으로 XProtect가 악성코드를 선제적으로 검사하고 제거할 수 있게 합니다.
  • 실시간 차단 – XProtect는 알려진 악성 소프트웨어가 실행되기 전에 실행을 차단합니다.

기존 XProtect

/Library/Apple/System/Library/CoreServices/XProtect.bundle 디렉터리는 XProtect 구성과 시그니처 정의가 포함된 기본 번들입니다.
읽기 전용 시스템 디렉터리이며 Apple이 XProtect 업데이트를 통해 자동으로 업데이트합니다.
그 아래에는 흥미로운 파일 몇 개가 있는데, 모두 Apple이 주기적으로 업데이트하며 시스템 무결성 보호(SIP)로 보호됩니다.

XProtect.plist

/Library/Apple/System/Library/CoreServices/XProtect.bundle/Contents/Resources/XProtect.plist 파일에는 XProtect가 알려진 위협을 탐지하는 데 사용하는 악성코드 시그니처가 저장되어 있습니다.
이 파일에는 해시와 파일명 패턴을 포함하여 악성코드 패밀리를 특정 탐지 규칙에 매핑하는 항목이 포함되어 있습니다.
다음은 한 악성코드 패밀리인 Bundalore의 예시입니다:

root@kitploit:~
<dict>
        <key>Description</key>
        <string>OSX.Bundlore.D</string>
        <key>LaunchServices</key>
        <dict>
                <key>LSItemContentType</key>
                <string>com.apple.application-bundle</string>
        </dict>
        <key>Matches</key>
        <array>
                <dict>
                        <key>MatchFile</key>
                        <dict>
                                <key>NSURLTypeIdentifierKey</key>
                                <string>com.apple.applescript.script</string>
                        </dict>
                        <key>MatchType</key>
                        <string>Match</string>
                        <key>Pattern</key>
                        <string>46617364554153</string>
                </dict>
                <dict>
                        <key>MatchFile</key>
                        <dict>
                                <key>NSURLTypeIdentifierKey</key>
                                <string>com.apple.applescript.script</string>
                        </dict>
                        <key>MatchType</key>
                        <string>Match</string>
                        <key>Pattern</key>
                        <string>20006500630068006F002000</string>
                </dict>
                <dict>
                        <key>MatchFile</key>
                        <dict>
                                <key>NSURLTypeIdentifierKey</key>
                                <string>com.apple.applescript.script</string>
                        </dict>
                        <key>MatchType</key>
                        <string>Match</string>
                        <key>Pattern</key>
                        <string>20007C0020006F00700065006E00730073006C00200065006E00630020002D006100650073002D003200350036002D0063006600620020002D007000610073007300200070006100730073003A</string>
                </dict>
                <dict>
                        <key>MatchFile</key>
                        <dict>
                                <key>NSURLTypeIdentifierKey</key>
                                <string>com.apple.applescript.script</string>
                        </dict>
                        <key>MatchType</key>
                        <string>Match</string>
                        <key>Pattern</key>
                        <string>002D00730061006C00740020002D00410020002D00610020002D00640020007C002000620061007300680020002D0073</string>
                </dict>
        </array>
</dict>

이 표현은 꽤 읽기 쉬운 편이며, 주목할 만한 유일한 부분은 각 매치의 string 인자가 16진수 표현이라는 점입니다. 예를 들어 002D00730061006C00740020002D00410020002D00610020002D00640020007C002000620061007300680020002D0073는 -salt -A -a -d | bash -s에 해당합니다.
물론 이는 정확히 어떤 패턴을 피해야 하는지 알 수 있는, 악성코드 작성자에게는 금광과 같은 정보입니다.

XProtect.meta.plist

/Library/Apple/System/Library/CoreServices/XProtect.bundle/XProtect.meta.plist 파일은 적용 정책과 버전 정보를 포함하여 XProtect에 대한 추가 규칙을 정의하는 메타데이터 파일입니다.
특정 XProtect 규칙을 적용하는 macOS 버전, 탐지 시 수행되는 조치, 그리고 플러그인 블랙리스트를 지정합니다.
다음은 예시입니다:

root@kitploit:~
<key>JavaWebComponentVersionMinimum</key>
<string>1.6.0_45-b06-451</string>
<key>PlugInBlacklist</key>
<dict>
        <key>10</key>
        <dict>
                <key>com.apple.java.JavaAppletPlugin</key>
                <dict>
                        <key>MinimumPlugInBundleVersion</key>
                        <string>14.8.0</string>
                        <key>PlugInUpdateAvailable</key>
                        <true/>
                </dict>
                <key>com.apple.java.JavaPlugin2_NPAPI</key>
                <dict>
                        <key>MinimumPlugInBundleVersion</key>
                        <string>14.8.0</string>
                        <key>PlugInUpdateAvailable</key>
                        <true/>
                </dict>
                <key>com.macromedia.Flash Player ESR.plugin</key>
                <dict>
                        <key>MinimumPlugInBundleVersion</key>
                        <string>18.0.0.382</string>
                        <key>PlugInUpdateAvailable</key>
                        <true/>
                </dict>
                <key>com.macromedia.Flash Player.plugin</key>
                <dict>
                        <key>MinimumPlugInBundleVersion</key>
                        <string>32.0.0.101</string>
                        <key>PlugInUpdateAvailable</key>
                        <true/>
                </dict>
                <key>com.microsoft.SilverlightPlugin</key>
                <dict>
                        <key>MinimumPlugInBundleVersion</key>
                        <string>5.1.41212.0</string>
                        <key>PlugInUpdateAvailable</key>
                        <true/>
                </dict>
                <key>com.oracle.java.JavaAppletPlugin</key>
                <dict>
                        <key>MinimumPlugInBundleVersion</key>
                        <string>1.8.51.16</string>
                        <key>PlugInUpdateAvailable</key>
                        <true/>
                </dict>
        </dict>
</dict>

보시다시피, 여기에는 예를 들어 "블랙리스트에 등재된" 플러그인에 대한 버전 정보가 포함되어 있습니다.

XProtect.yara

최근 버전에서 XProtect는 YARA를 지원하기 시작한 것으로 보입니다.
/Library/Apple/System/Library/CoreServices/XProtect.bundle/Contents/Resources/XProtect.yara 파일에는 텍스트 형식의 여러 YARA 규칙이 포함되어 있습니다. 그중 짧은 예시는 다음과 같습니다:

root@kitploit:~
rule XProtect_MACOS_SLEEPYSTEGOSAURUS_SYM {
    meta:
        description = "MACOS.SLEEPYSTEGOSAURUS.SYM"
        uuid = "BB4F7D16-C939-4047-A9AF-E74E7B51FAC1"
    strings:
        $a1 = { 45 78 65 63 43 6D 64 }
        $a2 = { 47 65 74 48 6F 73 74 49 6E 66 6F }
        $a3 = { 52 75 6E 53 63 72 69 70 74 }
        $a4 = { 52 75 6E 53 63 72 69 70 74 55 72 6C }
        $a5 = { 4C 61 75 6E 63 68 50 6C 69 73 74 }
        $a6 = { 43 68 65 63 6B 50 72 6F 63 65 73 73 }
        $a7 = { 43 68 65 63 6B 49 6E }
        $a8 = { 52 75 6E 43 6D 64 46 69 6C 65 }
        $a9 = { 53 68 6F 77 48 74 6D 6C }
        $a10 = { 50 6C 69 73 74 48 65 6C 70 65 72 }
        $a11 = { 4C 61 75 6E 63 68 64 48 65 6C 70 65 72 }
        $a12 = { 43 6F 6D 6D 61 6E 64 46 69 6C 65 }
        $a13 = { 57 72 69 74 65 50 6C 69 73 74 }
        $a14 = { 4A 53 4F 4E 46 69 6C 65 50 72 6F 63 65 73 73 6F 72 }
        $a15 = { 43 68 72 6F 6D 65 48 65 6C 70 65 72 }
        $a16 = { 53 61 6E 64 62 6F 78 65 72 }
    condition:
        Macho and filesize < 2MB and all of them
}

이 글은 YARA 규칙에 관한 블로그 포스트는 아니지만, 앞서 말한 대로 이는 악성코드 작성자에게 금광과 같은 정보입니다 (예: 43 68 65 63 6B 50 72 6F 63 65 73 73는 CheckProcess).

gk.db

여기에서 Apple이 XProtect를 Gatekeeper와 통합하도록 설계한 방식을 볼 수 있습니다. 다만 이 파일은 주로 syspolicyd가 사용합니다.
/Library/Apple/System/Library/CoreServices/XProtect.bundle/Contents/Resources/gk.db 파일은 차단할 파일 해시와 팀 ID의 "블랙리스트"가 포함된 SQLite 데이터베이스입니다.
sqlite3 유틸리티로 확인할 수 있습니다:

root@kitploit:~
jbo@McJbo ~ $ sqlite3 "/Library/Apple/System/Library/CoreServices/XProtect.bundle/Contents/Resources/gk.db" .schema
CREATE TABLE settings (name TEXT, value TEXT, PRIMARY KEY (name));
CREATE TABLE blocked_hashes (hash BLOB, hash_type INTEGER, flags INTEGER, PRIMARY KEY (hash, hash_type));
CREATE TABLE blocked_teams (team_id TEXT, flags INTEGER, PRIMARY KEY (team_id));
jbo@McJbo ~ $ sqlite3 "/Library/Apple/System/Library/CoreServices/XProtect.bundle/Contents/Resources/gk.db" "SELECT * FROM blocked_teams LIMIT 5;"
F9X83Q5222|1
Q6XAB4776L|0
DK5C9Y86C8|0
8VK2WEPW22|0
5LWMEF3EX3|0
jbo@McJbo ~ $

이것 역시 악성코드 작성자에게 흥미로운 정보입니다. 예를 들어 자기 악성코드 서명에 사용한 팀 ID가 Apple의 레이더에 언제 포착되는지 알 수 있기 때문입니다.

치료(Remediation) 바이너리

XProtect 바이너리는 /Library/Apple/System/Library/CoreServices/XProtect.app/Contents/MacOS/에 있지만, 그곳에는 추가 바이너리도 있습니다.
특정 패밀리를 위한 치료 파일들입니다:

root@kitploit:~
jbo@McJbo ~ $ ls -l /Library/Apple/System/Library/CoreServices/XProtect.app/Contents/MacOS/
total 47256
-rwxr-xr-x  1 root  wheel   513696 Feb 27 16:54 XProtect
-rwxr-xr-x  1 root  wheel  2498784 Feb 27 16:54 XProtectRemediatorAdload
-rwxr-xr-x  1 root  wheel  2367952 Feb 27 16:54 XProtectRemediatorBadGacha
-rwxr-xr-x  1 root  wheel  2053968 Feb 27 16:54 XProtectRemediatorBlueTop
-rwxr-xr-x  1 root  wheel  2332752 Feb 27 16:54 XProtectRemediatorBundlore
-rwxr-xr-x  1 root  wheel  2299648 Feb 27 16:54 XProtectRemediatorCardboardCutout
-rwxr-xr-x  1 root  wheel  2333248 Feb 27 16:54 XProtectRemediatorColdSnap
-rwxr-xr-x  1 root  wheel  2052736 Feb 27 16:54 XProtectRemediatorCrapyrator
-rwxr-xr-x  1 root  wheel  2859040 Feb 27 16:54 XProtectRemediatorDolittle
-rwxr-xr-x  1 root  wheel  2205520 Feb 27 16:54 XProtectRemediatorDubRobber
-rwxr-xr-x  1 root  wheel  2334752 Feb 27 16:54 XProtectRemediatorEicar
-rwxr-xr-x  1 root  wheel  2053120 Feb 27 16:54 XProtectRemediatorFloppyFlipper
-rwxr-xr-x  1 root  wheel  2053616 Feb 27 16:54 XProtectRemediatorGenieo
-rwxr-xr-x  1 root  wheel  2053504 Feb 27 16:54 XProtectRemediatorGreenAcre
-rwxr-xr-x  1 root  wheel  2332800 Feb 27 16:54 XProtectRemediatorKeySteal
-rwxr-xr-x  1 root  wheel  4659088 Feb 27 16:54 XProtectRemediatorMRTv3
-rwxr-xr-x  1 root  wheel  2382448 Feb 27 16:54 XProtectRemediatorPirrit
-rwxr-xr-x  1 root  wheel  2333024 Feb 27 16:54 XProtectRemediatorRankStank
-rwxr-xr-x  1 root  wheel  2299728 Feb 27 16:54 XProtectRemediatorRoachFlight
-rwxr-xr-x  1 root  wheel  2384416 Feb 27 16:54 XProtectRemediatorSheepSwap
-rwxr-xr-x  1 root  wheel  2053232 Feb 27 16:54 XProtectRemediatorSnowBeagle
-rwxr-xr-x  1 root  wheel  2350624 Feb 27 16:54 XProtectRemediatorSnowDrift
-rwxr-xr-x  1 root  wheel  2019712 Feb 27 16:54 XProtectRemediatorToyDrop
-rwxr-xr-x  1 root  wheel  2105696 Feb 27 16:54 XProtectRemediatorTrovi
-rwxr-xr-x  1 root  wheel  2332768 Feb 27 16:54 XProtectRemediatorWaterNet
jbo@McJbo ~ $

XProtect Remediator

/Library/Apple/System/Library/CoreServices/XProtect.app로 저장된 새로운 XProtect 시스템 앱은 macOS Monterey에서 도입되었으며 XProtect Remediator 실행을 담당합니다.
주로 시그니처 기반 탐지를 사용했던 기존 XProtect와 달리, XProtect Remediator는 감염된 시스템에서 악성코드를 적극적으로 검사하고 제거합니다.
백그라운드 프로세스로 실행되며 사용자 개입 없이 탐지된 위협을 자동으로 제거할 수 있습니다.
/Library/Apple/System/Library/CoreServices/XProtect.app/Contents/Resources 디렉터리에는 능동 검색을 위한 치료 스크립트와 추가 탐지 로직이 포함되어 있습니다.

com.apple.XProtect.agent.scan.plist

/Library/Apple/System/Library/CoreServices/XProtect.app/Contents/Resources/com.apple.XProtect.agent.scan.plist 파일에는 주기적 검사를 실행할 시점에 대한 설정이 포함되어 있습니다.
예를 들어:

root@kitploit:~
<key>com.apple.XProtect.PluginService.agent.slow.scan</key>
<dict>
        <key>Repeating</key>
        <true/>
        <key>PowerNap</key>
        <true/>
        <key>CPUIntensive</key>
        <true/>
        <key>DiskIntensive</key>
        <true/>
        <key>AllowBattery</key>
        <false/>
        <key>Priority</key>
        <string>Utility</string>
        <key>Interval</key>
        <integer>604800</integer>
</dict>

여기에는 특정 성능 조건과 검사 주기(604800초 = 7일에 한 번)도 표시됩니다.

MRT

여러분 중 일부는 MRT(Malware Removal Tool)에 대해 들어본 적이 있을 것입니다.
/Library/Apple/System/Library/CoreServices/MRT.app에 저장된 MRT는 XProtect와 함께 작동하는 또 다른 macOS 보안 구성 요소입니다.
XProtect가 탐지한 악성코드를 제거하는 역할을 하며 백그라운드에서 자동으로 작동합니다.
MRT는 탐지된 위협을 제거하는 데 있어 XProtect보다 더 적극적이며, 현재 실행 중인 악성 파일도 제거할 수 있습니다.
XProtect와 달리 MRT는 구성 파일을 유지하지 않는다는 점에 유의하세요. 모든 것이 바이너리에 내장되어 있습니다.
메인 바이너리(/Library/Apple/System/Library/CoreServices/MRT.app/Contents/MacOS/MRT)의 문자열을 살펴보면 흥미로운 문자열이 드러납니다. 예:

root@kitploit:~
import sys,base64;exec(base64.b64decode('
import sys,base64,warnings;warnings.filterwarnings('ignore');exec(base64.b64decode('
import sys;import re, subprocess;cmd = "ps -ef | grep Little\ Snitch | grep -v grep"

모든 것이 어떻게 함께 작동하는가

브라우저나 애플리케이션(예: Safari, Mail, Messages)을 통해 파일을 다운로드하면 해당 파일에 격리 플래그(com.apple.quarantine)가 표시됩니다. 저는 제 이전 Gatekeeper 블로그 포스트에서 이미 이 플래그를 언급한 바 있습니다.
Gatekeeper는 파일이 서명되고 공증(notarized)되었는지 확인합니다. 그렇지 않으면 실행 전에 사용자에게 경고가 표시됩니다.
실행이 허용되면 XProtect는 알려진 악성코드 시그니처(XProtect.plist, XProtect.yara 등)를 기준으로 파일을 검사합니다.
악성코드가 탐지되면 시스템은 실행을 차단합니다. 악성코드가 알려져 있고 치료가 가능한 경우 XProtect Remediator 또는 MRT가 이를 삭제하거나 무력화할 수 있습니다.
Apple은 XProtectService 프로세스를 통해 XProtect, MRT, XProtect Remediator를 백그라운드에서 자동으로 업데이트합니다.

특별 언급 - Banshee

올해 초, CheckPoint는 Banshee라고 불리는 악성코드 샘플에 관한 블로그 포스트를 게시했습니다.
XProtect Remediator 바이너리가 "YARA 규칙을 숨기기 위해" 사용하는 것과 동일한 암호화 알고리즘을 사용했기 때문에 많은 주목을 받았습니다.
알고리즘 자체는 단순합니다:

root@kitploit:~
def macos_xprotect_string_decryption(encrypted: bytes, encr_key: int) -> str:
    """
    Author: @Check Point Research
    Decrypts MacOS Xprotect binaries & Banshee Stealer encrypted strings.
    """
    decrypted = "".join(
        chr(
            (encr_key >> ((i * 8) & 0x38) & 0xFF) ^ encrypted[i]
        )
        for i in range(len(encrypted))
    )
    return decrypted.partition("\\x00")[0]

분명 악성코드 작성자들은 이 알고리즘이 정적 시그니처로 탐지될 수 없다고 생각했습니다(오탐(false positive)을 생성하는 것이 보장되기 때문입니다).
대부분의 치료 바이너리에서 유사한 코드를 발견했습니다. 예:

root@kitploit:~
10000592a      if (data_1000ffe7e != 0)
10000592c          void* rax_1 = &data_1000fb0a0
100005933          int64_t i = 0
100005951          do
100005940              *rax_1 = *rax_1 ^ (0x363a34363a303900 u>> (i.b & 0x38)).b
100005943              i = i + 8
100005947              rax_1 = rax_1 + 1
100005951          while (i != 0x26ef0)
100005953          data_1000ffe7e = 0

이를 처음 발견한 보안 연구원(ald3ns)은 XPR-dump라는 도구를 공개했는데, 최신 XProtect 버전에서도 여전히 작동하는 것으로 보입니다. 꼭 확인해 보세요!

요약

이 블로그 포스트에서 가장 중요한 점은 XProtect가 (다른 안티바이러스와 마찬가지로) 공격자와 숨바꼭질 게임을 한다는 것입니다. 블랙리스트, YARA 실행, 단순 정적 시그니처 등이 모두 그 범위에 포함됩니다.
이러한 파일이 모든 엔드포인트에 배포되고 분석하기 쉽다는 사실은 악성코드 작성자가 많은 검사를 쉽게 우회할 방법을 찾는 것을 매우 쉽게 만듭니다.

계속 지켜봐 주세요!

Jonathan Bar Or (https://jonathanbaror.com)

도구 다운로드