Bypassing iPhone Code Signatures

Bypassing iPhone Code
Signatures

  Starting with the recent beta releases of the iPhoneOS, Apple has
started requiring that all code on
the device is signed
. This is mostly to make it impossible for
programs running through Apple‘s AppStore to download more software and run it
(so no competition for AppStore).

  iOS要求所有程序都必须签名。

  In order to get around this (and thereby to install our own
code onto the device) the iPhone
Dev Team has patched the signature verification out of the
kernel
. However, another half of
the codesign problem is that the
binary contains a number of SHA1 verification hashes that are checked in
numerous locations throughout the kernel
. Patching this out is
A) difficult (especially to track as Apple makes changes) and B) of marginal
benefit as adding these hashes is easy. This means
you do still have to at least pay lipservice to
the code signature process. There are currently three viable
options.

  iPhone Dev
Team已经把签名校验机制从内核中抽离出来。可是,对于SHA1的校验确无处不在,A)把所有这些校验机制抽离出来很困难(尤其是要跟得上苹果的变化),B)添加这些hashes很容易。

  所以有以下3种方式可以用来帮助绕过这些SHA1校验:

  1、Option #1: Self-Signing

    使用苹果的签名工具codesign进行签名即可。

  2、Option #2: Pseudo-Signing

    codesign是macos平台上的工具,linux平台可以使用ldid。

  3、Option #3: Disable Checks

    关闭所有的校验。

Entitlements

  Every executable also has an XML file (specifically an Objective-C
Property List) that is signed into it that is its block of "entitlements". This
area is read (I‘m not certain by who, but I‘d guess the kernel) to determine
what seatbelt profile to apply to that process and what extra abilities it
gets.

  To dump or set the entitlements of a binary we can use ldid.
Dumping uses -e and setting involves passing
an argument to -S as you sign the file. You
can also pass --entitlements to
codesign.

  ldid
-e选项用于从bin中导出entitlements权限,-S选项用于签名,给-S添加参数的是一个entitlements文件
。也可通过给codesign
--entitlements选项来设置权限。如下:

  

Entitlement实战

  

参考:http://www.saurik.com/id/8

时间: 2024-08-06 14:24:41

Bypassing iPhone Code Signatures的相关文章

ipa重签名

为什么要研究重签名问题? 将程序打包成ipa包后,ipa包中会包括Provisioning Profile和_CodeSignature等文件,里面包括了对整个ipa的签名信息.一旦改动ipa中的任何内容,例如增加一个头文件,签名就会失效,导致ipa无法安装.(貌似改变Info.plist是不影响的) 因此,如果要通过修改ipa包中的内容来得到篡改信息或注入代码的话,就需要解决ipa包的重签名问题. 准备 在重签名之前要做一些准备工作. 1.首先要下载并安装Xcode,里面有个codesign_

命令行工具打包

前言: iOS程序包分为“.app格式的二进制文件包”和“.ipa格式的渠道包”两种.xcodebuild 是一款用来打包 Xcode projects 或者 workspaces 的命令行工具.用xcodebuild把工程打成 app格式后,再用xcrun来签名和打成ipa格式的包.本篇文章简单讲解一下自己使用的app打包命令. 正文: 一.通过xcodebuild命令和xcrun命令打包 xcodebuild命令和xcrun两个命令必需在xxx.xcodeproj或者xxx.xcworksp

github上所有大于800 star OC框架

https://github.com/XCGit/awesome-objc-frameworks#awesome-objc-frameworks awesome-objc-frameworks ID Framework Images 1 AFNetworking/AFNetworking 19,058 A delightful iOS and OS X networking framework 2 rs/SDWebImage 10,139 Asynchronous image downloade

How to remove a Trojan, Virus, Worm, or other Malw

bleepingcomputer (这网站直翻是哔哔电脑么2333 其实一直都觉得国外的杀毒优化软件还是蛮好用,就是动不动要钱(天朝劣根性... 国内免费就是各种绑定+广告,,不过金山用着还是满顺手的,清清垃圾什么的. How to remove a Trojan, Virus, Worm, or other Malware Dialers, Trojans, Viruses, and Worms Oh My! If you use a computer, read the newspaper,

laravel框架手机发送验证码

https://blog.csdn.net/sunny_lg/article/details/52471225 现在登录注册时 我们的验证方法 不在单一化  手机发送验证码 已经成为常态 让我们 一起来实现以下吧 ! 首先我们要先找短信的接口 我用的是  云信使   这里是他的地址http://sms.sms.cn/login.php?cgh 大家可以去注册一下 1.进入视图 <ul class="register"> <li> <label>手机号

实现动静分离

目录 nginx 实现动静分离 Nginx动静分离基本概述 Nginx动静分离场景实践 多台服务器实现动静分离 Nginx资源分离场景实践 根据iphone.安卓,pc跳转不通的页面环境规划 实际上的配置 nginx 实现动静分离 Nginx动静分离基本概述 动静分离,通过中间件将动静分离和静态请求进行分离: 通过中间件将动态请求和静态请求分离,可以建上不必要的请求消耗,同事能减少请求的延时. 通过中间件将动态请求和静态请求分离,逻辑图如下: 动静分离只有好处:动静分离后,即使动态服务不可用,但

中间件 | Nginx实现动静分离

Nginx动静分离基本概述 动静分离,通过中间件将动静分离和静态请求进行分离: 通过中间件将动态请求和静态请求分离,可以建上不必要的请求消耗,同事能减少请求的延时. 通过中间件将动态请求和静态请求分离,逻辑图如下: ?动静分离只有好处:动静分离后,即使动态服务不可用,但静态资源不会受到影响. Nginx动静分离场景实践 单台服务器实现动静分离 location / { root /code/wordpress; index.php;}location ~* \.(png|jpg|mp4|)${

Bypassing PatchGuard on Windows x64

[说明] 1.  本文是意译,加之本人英文水平有限.windows底层技术属菜鸟级别,本文与原文存在一定误差,请多包涵. 2.  由于内容较多,从word拷贝过来排版就乱了.故你也可以下载附件. 3.  如有不明白的地方,各位雪友可通过附件中的联系方式联系我,同时建议各位参照原文阅读...... [64位windows系统的PatchGuard] 原文:Bypassing PatchGuard on Windows x64.pdf 关于windows x64上的PatchGuard是干什么用的,

Is it too late to learn to code?

Erin Parker, Founder Spitfire Athlete, iOS Engineer 9k upvotes by Francis Chen, Gaurav Baheti, Yue-Wing Yau, Maria Guryanova,(more) It's never too late. So much can happen in a year, it can amaze you. I majored in Economics. When I was about 23, I ra