博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Mac OS X El Capitan系统完整性保护System Integrity Protection (SIP)
阅读量:6926 次
发布时间:2019-06-27

本文共 2121 字,大约阅读时间需要 7 分钟。

引言:前段时间经历了XCode编译器代码被注入的事件后,这次 Mac OS X El Capitan系统的升级,启用了更高的安全性保护机制:系统完整性保护System Integrity Protection (SIP),是By Design?还是巧合呢?


关于 系统完整性保护System Integrity Protection (SIP),可以从
Apple
官网下载下来学习,从第29页到54页 


关键点:

1、Security policy applying to every process, including privileged code running unsandboxed

2、Extends additional protections to system components on disk and at runtime

3、System binaries can only be modified by Apple Installer and Software Update, and no longer permit runtime attachment or code injection


实际上从Mac AppStore下载的应用是不受影响的;如果不是则可能会受影响,比如:
修改系统文件,安装文件到系统目录中,观察系统进程内存,注入代码到系统进程中等
内核会直接中断这些破坏性的工作,哈哈哈。

所以对于像 /System /bin /usr /sbin 仅仅供系统使用,开发者或者应用程序则无法直接使用,而使用 ~/Library /usr/local /
Application
s,升级之后,那些文件将被移出去。


注入代码到系统进程中等同于修改
硬盘
上的可执行文件,所以会进行各种安全检查确保安全可信,比如签名检查


整个机制主要从三方面入手:

1、文件系统保护(Filesystem protections)

2、运行时保护(Runtime protections)

3、内核扩展签名(Kernel extensions)


总结:
1、新的安全策略机制适用于每一个进程
2、默认下系统启用SIP系统完整性保护机制,无论是对于硬盘还是运行时的进程
     限制对系统目录的写操作
     阻止在运行时附加或注入代码到系统进程中
3、第三方安装的内容必须移入系统目录
4、SIP系统完整性保护机制可以在Recovery OS状态下进行更改,也就是留有余地啊哈哈


如何禁用SIP系统完整性保护机制?

1、重新启动操作系统;

2、按住Command + R键;

3、菜单“实用工具” ==>> "终端" ==>> 输入 csrutil disable 回车

    执行成功后,返回信息如下:

Successfully disabled System Integrity Protection. Please restart the machine for the changes to take effect.

4、这样,更改的
配置
保存到NVRAM中,对整台机器生效,重新启动即可


如何查看SIP系统完整性保护机制?

命令行终端

$ csrutil status

System Integrity Protection status: enabled.


$ csrutil clear / enable / disable 只能在 恢复模式下使用


在禁用掉SIP后,查看状态信息如下

$ csrutil status

System Integrity Protection status: enabled (Custom Configuration).


Configuration:

        Apple Internal: disabled

        Kext Signing: disabled

        Filesystem Protections: disabled

        Debugging Restrictions: disabled

        DTrace Restrictions: disabled

        NVRAM Protections: disabled


This is an unsupported configuration, likely to break in the future and leave your machine in an unknown state.


那么将之前升级而被移走的文件从 /Library/System
Migration
/History 对应移回到原来的目录下,应用程序就可以使用了。


如何对被移出的应用程序进行恢复?

比如Mobility Client,进入终端,并切换到 root 用户下,然后


su -

cd /Library/SystemMigration/History/Migration-*/Quar
ant
ineRoot/usr/libexec

mv MobilityClient/ /usr/libexec/


再启动 Mobility Client 就可以了,不需要重新安装,就这么简单!

转载地址:http://mzyjl.baihongyu.com/

你可能感兴趣的文章
ONE
查看>>
Jmeter常见问题
查看>>
Contoso 大学 - 3 - 排序、过滤及分页
查看>>
Sass介绍及入门教程
查看>>
libCurl的文件上传
查看>>
Can't call commit when autocommit=true(转)
查看>>
一分钟了解:String & StringBuilder & StringBuffer
查看>>
POJ2891:Strange Way to Express Integers(解一元线性同余方程组)
查看>>
如何调试Excel VBA代码
查看>>
写给自己看的小设计2 - 对象设计通用原则(序)
查看>>
学习HTML5之表单
查看>>
cocos2d-x 3.0来做一个简单的游戏教程 win32平台 vs2012 详解献给刚開始学习的人们!...
查看>>
Selenium2(WebDriver)总结(三)---元素定位方法
查看>>
SQLServer 2012异常问题(一)--故障转移群集+镜像环境导致作业执行失败
查看>>
【转】android 最新 NDK r8 在window下开发环境搭建 安装配置与使用 详细图文讲解,完整实际配置过程记录(原创)...
查看>>
ocp 1Z0-043 1-60题解析
查看>>
POJ 2777 Count Color(线段树+位运算)
查看>>
Android英文文档翻译系列(6)——LocalBroadcastManager
查看>>
Unity3D骨骼动画的分解(CleanData.Ani详解)
查看>>
java thread dump日志分析
查看>>