1、使用iTunes将手机备份在本地。
2、下载iBackupBot,打开后在左侧可以看到你的历史备份,选择刚刚备份的文件。依次选择System Files -> HomeDomain -> Library,之后在右侧搜索框搜索文件com.apple.restrictionspassword.plist 并打开。获得RestrictionsPasswordKey和RestrictionsPasswordSalt的值。
3、运行这段python代码,输入RestrictionsPasswordKey和RestrictionsPasswordSalt的值计算即可,原理就是从0000到9999暴力穷举计算。
import hashlib
import string
import base64
import itertools
import os
import sys def calc_key(myKey, mySalt): for i in itertools.product(range(10), repeat=4):
nPass = ''.join(map(str, i)) code = hashlib.pbkdf2_hmac('sha1', nPass.encode(), base64.b64decode(mySalt), 1000, dklen=None) if base64.b64encode(code).decode() == myKey:
print ("")
print ("Your Restrictions Passcode is \"" + nPass + "\"")
break def main():
restrictionKey = input("Enter your RestrictionPasswordKey: ")
restrictionSalt = input("Enter your RestrictionPasswordSalt: ") if restrictionKey or restrictionSalt:
calc_key(restrictionKey, restrictionSalt) if __name__ == "__main__":
main()