Skip to content

Instantly share code, notes, and snippets.

@profiles
Forked from ptrstr/ipsw_research.py
Last active August 9, 2024 03:34
Show Gist options
  • Save profiles/a95ca2a726c7309d1f74fe23d03d1461 to your computer and use it in GitHub Desktop.
Save profiles/a95ca2a726c7309d1f74fe23d03d1461 to your computer and use it in GitHub Desktop.
Small script to find all IPSW files with research (symbolicated) kernelcaches. Uses ipsw.me API
from remotezip import RemoteZip
import requests
import concurrent.futures
def ipsw_api(endpoint):
return requests.get('https://api.ipsw.me/v4/' + endpoint).json()
def process_firmware(firmware):
try:
with RemoteZip(firmware['url']) as zip:
for zip_info in zip.infolist():
if zip_info.filename.startswith('kernelcache.research'):
print(' [+] %s - %s %s %s (%s)' % (zip_info.filename, firmware['identifier'], firmware['version'], firmware['buildid'], firmware['url']))
break
except:
pass
def scan_device(device):
print(' [*] Device %s %s' % (device['identifier'], device['name']))
firmwares = ipsw_api('device/' + device['identifier'])['firmwares']
with concurrent.futures.ThreadPoolExecutor() as executor:
executor.map(process_firmware, firmwares)
def scan():
devices = reversed(ipsw_api('devices'))
with concurrent.futures.ThreadPoolExecutor() as executor:
executor.map(scan_device, devices)
if __name__ == '__main__':
scan()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment