-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
189 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
import subprocess | ||
import os | ||
import sys | ||
import glob | ||
|
||
#requires | ||
#brew install --HEAD usbmuxd brew install --HEAD libimobiledevice brew install --HEAD ideviceinstaller | ||
|
||
frozen = 'not' | ||
if getattr(sys, 'frozen', False): | ||
# we are running in a bundle | ||
frozen = 'ever so' | ||
bundle_dir = sys._MEIPASS | ||
else: | ||
# we are running in a normal Python environment | ||
bundle_dir = os.path.dirname(os.path.abspath(__file__)) | ||
|
||
udid = '' | ||
ecid = '' | ||
boardid = '' | ||
deviceid = '' | ||
apnonce = '' | ||
iosversion = 0 | ||
|
||
hashes = '27325c8258be46e69d9ee57fa9a8fbc28b873df434e5e702a8b27999551138ae','3a88b7c3802f2f0510abc432104a15ebd8bd7154' ,'15400076bc4c35a7c8caefdcae5bda69c140a11bce870548f0862aac28c194cc','603be133ff0bdfa0f83f21e74191cf6770ea43bb' | ||
|
||
savePath = os.getcwd() | ||
|
||
if (os.path.isdir(savePath + '/SaveMe') is False): | ||
try: | ||
os.mkdir(savePath + '/SaveMe') | ||
except FileExistsError: | ||
print('\n\n[*] Skipping creating SaveMe folder as it already exists') | ||
|
||
savePath = savePath + '/SaveMe' | ||
|
||
os.chdir(bundle_dir) | ||
|
||
print('[*] Connect Device To Start..') | ||
input('[*] Press ENTER when Device is connected > ') | ||
os.chdir(os.getcwd() + '/SupportFiles/') | ||
|
||
popen = subprocess.Popen('ideviceinfo.exe | findstr UniqueDeviceID: ', shell = True, stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf8') | ||
communicateRes = popen.communicate() | ||
udid, stdErrValue = communicateRes | ||
udid = udid.strip() | ||
udid = udid.replace('UniqueDeviceID: ','') | ||
|
||
popen = subprocess.Popen('ideviceinfo.exe | findstr UniqueChipID: ', shell = True, stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf8') | ||
communicateRes = popen.communicate() | ||
ecid, stdErrValue = communicateRes | ||
ecid = ecid.strip() | ||
ecid = ecid.replace('UniqueChipID: ','') | ||
|
||
popen = subprocess.Popen('ideviceinfo.exe | findstr HardwarePlatform: ', shell = True, stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf8') | ||
communicateRes = popen.communicate() | ||
platform, stdErrValue = communicateRes | ||
platform = platform.strip() | ||
platform = platform.replace('HardwarePlatform: ','') | ||
|
||
popen = subprocess.Popen('ideviceinfo.exe | findstr ProductType: ', shell = True, stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf8') | ||
communicateRes = popen.communicate() | ||
deviceid, stdErrValue = communicateRes | ||
deviceid = deviceid.strip() | ||
deviceid = deviceid.replace('ProductType: ','') | ||
|
||
popen = subprocess.Popen('ideviceinfo.exe | findstr HardwareModel: ', shell = True, stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf8') | ||
communicateRes = popen.communicate() | ||
boardid, stdErrValue = communicateRes | ||
boardid = boardid.strip() | ||
boardid = boardid.replace('HardwareModel: ','') | ||
|
||
popen = subprocess.Popen('ideviceenterrecovery.exe %s' %udid, shell = True, stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf8') | ||
communicateRes = popen.communicate() | ||
enterRecovery, stdErrValue = communicateRes | ||
|
||
print('[*] ' + enterRecovery) | ||
input('[*] Press ENTER when Device is in Recovery Mode > ') | ||
|
||
popen = subprocess.Popen('igetnonce.exe', stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf8') | ||
communicateRes = popen.communicate() | ||
igetNonceOuput, stdErrValue = communicateRes | ||
igetNonceOuput = igetNonceOuput.split('\n') | ||
|
||
for s in igetNonceOuput: | ||
if s.startswith('ApNonce='): | ||
apnonce = s | ||
apnonce = apnonce.replace('ApNonce=','') | ||
|
||
if (platform.find('t8020') != -1 or platform.find('t8027') != -1): | ||
print('[*] Detected A12(X) Device') | ||
|
||
else: | ||
for x in hashes: | ||
if (apnonce == x) is True: | ||
print('[*] Detected Non A12(X) Device') | ||
print('[*] Device ApNonce matches the default unc0ver or chimera generator') | ||
break; | ||
|
||
else: | ||
print('[*] Detected Non A12(X) Device') | ||
print('[*] Device ApNonce does not match the unc0ver or chimera generator') | ||
break; | ||
|
||
print('[D] Device Model = ' + deviceid) | ||
print('[D] Device UDID = ' + udid) | ||
print('[D] BoardConfig = ' + boardid) | ||
print('[D] ECID = ' + ecid) | ||
print('[D] ApNonce = ' + apnonce) | ||
|
||
iosversion = input('[D] Enter the iOS version to save the ticket for > ') | ||
|
||
if (os.path.isdir(savePath + '/' + ecid) is False): | ||
try: | ||
os.mkdir(savePath + '/' + ecid) | ||
except FileExistsError: | ||
print('[*] Skipping creating ECID folder as %s it already exists' %ecid) | ||
|
||
savePath = savePath + '/' + ecid | ||
|
||
if (os.path.isdir(savePath + '/' + iosversion) is False): | ||
try: | ||
os.mkdir(savePath + '/' + iosversion) | ||
except FileExistsError: | ||
print('[*] Skipping creating iOS version folder as %s it already exists' %ecid) | ||
|
||
savePath = savePath + '/' + iosversion | ||
|
||
popen = subprocess.Popen('tsschecker.exe -d %s' %deviceid + ' -e %s' %ecid + ' --boardconfig %s' %boardid + ' --ios %s' %iosversion + ' --apnonce %s' %apnonce + ' -s --save-path %s' %savePath, shell = True, stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf8') | ||
|
||
print('[*] Checking ticket against device in Recovery Mode') | ||
input('[*] Press Enter When File is Saved > ') | ||
|
||
ticket = '' | ||
for file in glob.glob(os.path.join(savePath, "*.shsh2")): | ||
ticket = file | ||
|
||
print('[*] Checking this ticket ' + ticket) | ||
|
||
popen = subprocess.Popen('futurerestore.exe -w -t %s ' %ticket, shell = True, stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf8') | ||
communicateRes = popen.communicate() | ||
ticketCheck, stdErrValue = communicateRes | ||
print('\n\n[*] %s' %ticketCheck) | ||
print('[*] Exiting Recovery Mode') | ||
|
||
popen = subprocess.Popen('futurerestore.exe --exit', shell = True, stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf8') | ||
if (ticket != None) is True: | ||
print('[*] File Save as ' + ticket) | ||
else: | ||
print('Problem occurred when saving SHSH ticket') | ||
print('[*] Exiting') |
Binary file not shown.