• Stars
    star
    368
  • Rank 111,900 (Top 3 %)
  • Language
    C
  • License
    Apache License 2.0
  • Created over 5 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An Open-Source Pre and Post Callback-Based Framework for macOS Kernel Monitoring.

Kemon

An Open Source Pre and Post Callback-based Framework for macOS Kernel Monitoring.

[ Breaking News - 08/28/2019 ]
macOS Catalina 10.15 Beta 7 Release Notes
https://developer.apple.com/documentation/macos_release_notes/macos_catalina_10_15_beta_7_release_notes

Endpoint Security

  • The kauth API has been removed. (50419013)

/* After testing, I found that these Kauth interfaces are not really removed, and Kemon still works. But I think this release note means that the door to the macOS kernel is closing. (08/28/2019) */

What is Kemon?

Kemon is an open source Pre and Post callback-based framework [1] for macOS kernel monitoring [2]. With the power of Kemon, we can easily implement XPC/IPC communication monitoring [3], Mandatory Access Control (MAC) policy filtering, network traffic and kernel extension firewall, etc. In general, from an attacker's perspective, this framework can help achieve more powerful Rootkit. From the perspective of defense, Kemon can help construct more granular monitoring capabilities.

I also implemented several kernel fuzzers [4] [7] based on this framework, which helped me find many kernel vulnerabilities, such as:

  1. Graphics related kernel extensions:
    CVE-2017-7155, CVE-2017-7163, CVE-2017-13883 [10], CVE-2018-4350, CVE-2018-4396, CVE-2018-4418 [11], CVE-2019-8807 [12], CVE-2022-22631, CVE-2022-22661, CVE-2022-46706 [22], etc.

  2. Wi-Fi IO80211FamilyV1/V2 [5] [9]:
    CVE-2020-9832, CVE-2020-9833, CVE-2020-9834 [14], CVE-2020-9899 [15], CVE-2020-10013 [16] [17] [18], CVE-2022-26761 [23], CVE-2022-26762 [24], CVE-2022-32837, CVE-2022-32847, CVE-2022-32860 [25] [26] [27], CVE-2022-32925, CVE-2022-46709 [28] [29], etc.

  3. Bluetooth Host Controller Interface (HCI) [6]:
    CVE-2020-3892, CVE-2020-3893, CVE-2020-3905, CVE-2020-3907, CVE-2020-3908, CVE-2020-3912, CVE-2020-9779, CVE-2020-9853 [13], CVE-2020-9831 [14], CVE-2020-9928, CVE-2020-9929 [15], etc.

  4. Kernel memory mapping mechanism [8]:
    CVE-2020-27914, CVE-2020-27915, CVE-2020-27936 [19] [20], CVE-2021-30678 [21], etc.

Supported Features

Kemon's features include:

  • file operation monitoring
  • process creation monitoring
  • dynamic library and kernel extension monitoring
  • network traffic monitoring
  • Mandatory Access Control (MAC) policy monitoring, etc.

In addition, Kemon project can also extend the Pre and Post callback-based monitoring interfaces for any macOS kernel function.

Getting Started

How to build the Kemon kernel extension

Please use Xcode project or makefile to build the Kemon kext driver

How to use the Kemon kernel extension

Please turn off macOS System Integrity Protection (SIP) check if you don't have a valid kernel certificate
Use the command "sudo chown -R root:wheel kemon.kext" to change the owner of the Kemon kernel extension
Use the command "sudo kextload kemon.kext" to install the Kemon kernel extension
Use the command "sudo kextunload kemon.kext" to uninstall the Kemon kernel extension

Contributing

Welcome to contribute by creating issues or sending pull requests. See Contributing Guide for guidelines.

License

Kemon is licensed under the Apache License 2.0. See the LICENSE file.

References

  1. https://patents.google.com/patent/US11106491B2
  2. https://www.blackhat.com/us-18/arsenal/schedule/#kemon-an-open-source-pre-and-post-callback-based-framework-for-macos-kernel-monitoring-12085
  3. https://www.blackhat.com/us-19/arsenal/schedule/#ksbox-a-fine-grained-macos-malware-sandbox-15059
  4. https://www.defcon.org/html/defcon-26/dc-26-speakers.html#Wang
  5. https://www.blackhat.com/us-20/briefings/schedule/index.html#dive-into-apple-iofamilyv-20023
  6. https://www.blackhat.com/eu-20/briefings/schedule/index.html#please-make-a-dentist-appointment-asap-attacking-iobluetoothfamily-hci-and-vendor-specific-commands-21155
  7. https://www.blackhat.com/us-20/arsenal/schedule/index.html#macos-bluetooth-analysis-suite-mbas-19886
  8. https://www.blackhat.com/asia-21/briefings/schedule/index.html#racing-the-dark-a-new-tocttou-story-from-apples-core-22214
  9. https://www.blackhat.com/us-22/briefings/schedule/#dive-into-apple-iofamily-vol--27728
  10. https://support.apple.com/en-us/HT208331
  11. https://support.apple.com/en-us/HT209193
  12. https://support.apple.com/en-us/HT210722
  13. https://support.apple.com/en-us/HT211100
  14. https://support.apple.com/en-us/HT211170
  15. https://support.apple.com/en-us/HT211289
  16. https://support.apple.com/en-us/HT211843
  17. https://support.apple.com/en-us/HT211849
  18. https://support.apple.com/en-us/HT211850
  19. https://support.apple.com/en-us/HT211931
  20. https://support.apple.com/en-us/HT212011
  21. https://support.apple.com/en-us/HT212529
  22. https://support.apple.com/en-us/HT213183
  23. https://support.apple.com/en-us/HT213257
  24. https://support.apple.com/en-us/HT213258
  25. https://support.apple.com/en-us/HT213346
  26. https://support.apple.com/en-us/HT213345
  27. https://support.apple.com/en-us/HT213344
  28. https://support.apple.com/en-us/HT213446
  29. https://support.apple.com/en-us/HT213486

More Repositories

1

DoKit

一款面向泛前端产品研发全生命周期的效率平台。
Java
19,956
star
2

cube-ui

🔶 A fantastic mobile ui lib implement by Vue
JavaScript
9,110
star
3

chameleon

🦎 一套代码运行多端,一端所见即多端所见
JavaScript
9,024
star
4

VirtualAPK

A powerful and lightweight plugin framework for Android
Java
8,949
star
5

LogicFlow

A flow chart editing framework focusing on business customization. 专注于业务自定义的流程图编辑框架,支持实现脑图、ER图、UML、工作流等各种图编辑场景。
TypeScript
6,812
star
6

KnowStreaming

一站式云原生实时流数据平台,通过0侵入、插件化构建企业级Kafka服务,极大降低操作、存储和管理实时流数据门槛
Java
6,747
star
7

booster

🚀Optimizer for mobile applications
Kotlin
4,752
star
8

nightingale

An enterprise-level cloud-native monitoring system, which can be used as drop-in replacement of Prometheus for alerting and management.
Go
4,510
star
9

mpx

Mpx,一款具有优秀开发体验和深度性能优化的增强型跨端小程序框架
JavaScript
3,531
star
10

mand-mobile

💰 A mobile UI toolkit, based on Vue.js 2, designed for financial scenarios.
Vue
3,429
star
11

sharingan

Sharingan(写轮眼)是一个基于golang的流量录制回放工具,适合项目重构、回归测试等。
Go
2,182
star
12

tinyid

ID Generator id生成器 分布式id生成系统,简单易用、高性能、高可用的id生成系统
Java
2,071
star
13

ChineseNLP

Datasets, SOTA results of every fields of Chinese NLP
HTML
1,767
star
14

DiDiPrism

小桔棱镜,一款专注移动端操作行为的利器! A powerful tool (iOS & Android) that focuses on mobile operation behavior!
Objective-C
1,699
star
15

gendry

a golang library for sql builder
Go
1,500
star
16

DDMQ

DDMQ is a distributed messaging product with low latency, high throughput and high availability.
Java
1,286
star
17

Hummer

一套移动端高性能高可用的动态化跨端开发框架
Objective-C
1,283
star
18

rdebug

Rdebug — Real Debugger
PHP
1,155
star
19

echo

Echo是一款桌面端调试工具,旨在提高客户端的研发调试效率
Objective-C
1,022
star
20

DroidAssist

A lightweight Android Studio gradle plugin based on Javassist for editing bytecode in Android.
Java
881
star
21

AoE

AoE (AI on Edge,终端智能,边缘计算) 是一个终端侧AI集成运行时环境 (IRE),帮助开发者提升效率。
C++
870
star
22

turbo

Turbo is a light-weight flow engine framework, support BPMN2.0. 一款轻量级流程引擎服务框架,可作为底层服务支持各类流程设计、低代码设计、工作流、服务编排等场景
Java
798
star
23

DRouter

Android Router Framework
Java
711
star
24

AgileTC

AgileTC is an agile test case management platform
JavaScript
642
star
25

falcon-log-agent

用于监控系统的日志采集agent,可无缝对接open-falcon
Go
554
star
26

epage

一款基于schema的低代码可视化页面配置工具
Vue
441
star
27

super-jacoco

Java
430
star
28

GateKeeper

A high-performance Golang gateway that supports rapid development and plug-inization
Go
428
star
29

sds

SDS是一个基于Java开发的简单、易用、高性能的服务降级系统,支持限流、熔断和降级等功能,服务端必备!!
Java
406
star
30

KnowSearch

面向Elasticsearch研发与运维人员,围绕集群、索引构建的零侵入、多租户的Elasticsearch GUI管控平台
Java
377
star
31

di18n

一种自动转换、基于配置的前端国际化方案
JavaScript
286
star
32

pile.js

pile.js components build with React.
CSS
267
star
33

ES-Fastloader

Quickly build large-scale ElasticSearch indices by using the fault tolerance and parallelism of Hadoop
Java
259
star
34

KnowAgent

基于日志模板构建,采集任务动态管控、数据质量精确度量,一站式日志采集平台
Java
243
star
35

LogiCommon

Java版 认证、鉴权、管理、任务调度通用功能组件
Java
213
star
36

Tips

JavaScript
187
star
37

maskdetection

C++
179
star
38

xiaoju-survey

「快速」打造「专属」问卷系统, 让调研「更轻松」
Vue
167
star
39

DreamBox

DreamBox是一个为客户端开发者打造的统一视图开发框架,具有性能好、可动态更新的特点
Java
165
star
40

dlflow

DLFlow is a deep learning framework.
Python
156
star
41

hetsann

Source Codes of HetSANN in the AAAI'20 paper: An Attention-based Graph Nerual Network for Heterogeneous Structural Learning.
Python
140
star
42

collection

go collection package for fasting coding
Go
127
star
43

didi.github.io

didi website
HTML
125
star
44

athena

A release version for https://github.com/athena-team/athena
Python
123
star
45

JuShaTa

JuShaTa是一个Java容器,提供模块隔离及模块热加载能力。
Java
114
star
46

logbook

Java
108
star
47

levin

A Quick Way to Bulk Loading
C++
104
star
48

heteta

HetETA: Heterogeneous Information Network Embedding for Estimating Time of Arrival
Python
101
star
49

thrift-mock

A lightweight java test library for mocking thrift server
Java
90
star
50

mand-mobile-rn

💰 Mand Mobile for React Native, designed for financial scenarios.
TypeScript
87
star
51

TrafficIndex

TTI ,Smart Transportation Industry Standard
C++
85
star
52

slime-validator

JavaScript library of validation based on Plugin system and make data validation be easy.
JavaScript
85
star
53

vue-tmap

一个基于腾讯地图JavaScript API GL、TypeScript 封装适用于 Vue3 的高性能地图组件库
TypeScript
81
star
54

mtmc-vt

MTMC Vehicle Tracking For AI City challenge 2019
Jupyter Notebook
69
star
55

sgt

didiyun super-agent daemon
Go
57
star
56

FeatureProbe

开源的高效可视化『功能』管理平台,提供灰度发布、AB实验、配置变更全功能。
53
star
57

ALITA

ALITA is a layer-based data analysis tool. The front-end see
Java
50
star
58

react-tmap

一个基于腾讯地图JavaScript API GL、TypeScript 封装适用于 react 的高性能地图组件库
TypeScript
45
star
59

benchmark-thrift

An open source application designed to load test Thrift applications
Java
44
star
60

elastic-trib

elasticsearch cluster command line tool.
Go
39
star
61

mpx-cube-ui

基于"Mpx 小程序框架"的移动端基础组件库
TypeScript
25
star
62

yarc

基于 eBPF 的流量录制工具
C
24
star
63

paladin

Scala
20
star
64

MEEP

End-to-end framework to build automatic agents (chatbots) for task-oriented dialogs
Python
18
star
65

tg-flow

Go
18
star
66

Unify

Dart
15
star
67

ALITA_UI

ALITA is a layer-based data analysis tool. The back-end see
JavaScript
13
star
68

wmt2021_triangular_mt

The baseline model code for WMT 2021 Triangular MT
Python
13
star
69

MeetDot

Python
11
star
70

DAIBench

Shell
10
star
71

WorkTrans

Python
10
star
72

didi-tech-edu

9
star
73

daedalus

JavaScript
6
star
74

tmap-types

腾讯地图 js api 类型声明,主要用于 react-tmap 和 vue-tmap 组件库
4
star
75

Json-adapter

Java
3
star