Skip to content

Instantly share code, notes, and snippets.

@robre
Created April 27, 2021 10:16
Show Gist options
  • Save robre/61d580df0b0cfbbc33948f0ab0d11eb3 to your computer and use it in GitHub Desktop.
Save robre/61d580df0b0cfbbc33948f0ab0d11eb3 to your computer and use it in GitHub Desktop.
A script to enumerate how many CVEs were found per component in Apple's recent iOS security content updates
#!/usr/bin/env python3
import requests
urls = ["https://support.apple.com/en-us/HT212317",
"https://support.apple.com/en-us/HT211168",
"https://support.apple.com/en-us/HT211169",
"https://support.apple.com/en-us/HT211102",
"https://support.apple.com/en-us/HT210918",
"https://support.apple.com/en-us/HT210787",
"https://support.apple.com/en-us/HT210785",
"https://support.apple.com/en-us/HT210721",
"https://support.apple.com/en-us/HT210624",
"https://support.apple.com/en-us/HT210590",
"https://support.apple.com/en-us/HT210603",
"https://support.apple.com/en-us/HT210606",
"https://support.apple.com/en-us/HT210549",
"https://support.apple.com/en-us/HT210346",
"https://support.apple.com/en-us/HT210118",
"https://support.apple.com/en-us/HT209599",
"https://support.apple.com/en-us/HT209520",
"https://support.apple.com/en-us/HT209443",
"https://support.apple.com/en-us/HT209340",
"https://support.apple.com/en-us/HT209192",
"https://support.apple.com/en-us/HT209162",
"https://support.apple.com/en-us/HT209106",
"https://support.apple.com/en-us/HT208938",
"https://support.apple.com/en-us/HT208848",
"https://support.apple.com/en-us/HT208743",
"https://support.apple.com/en-us/HT208693",
"https://support.apple.com/en-us/HT212256",
"https://support.apple.com/en-us/HT212257",
"https://support.apple.com/en-us/HT212221",
"https://support.apple.com/en-us/HT212146",
"https://support.apple.com/en-us/HT212003",
"https://support.apple.com/en-us/HT212004",
"https://support.apple.com/en-us/HT211929",
"https://support.apple.com/en-us/HT211940",
"https://support.apple.com/en-us/HT211850",
"https://support.apple.com/en-us/HT211288",
"https://support.apple.com/en-us/HT211214"]
#urls = ["https://support.apple.com/en-us/HT212317", # TESTING
# "https://support.apple.com/en-us/HT211168",
# "https://support.apple.com/en-us/HT211169",]
data = {}
loc = ""
for url in urls:
r = requests.get(url)
name = url.split("/")[-1]
text = r.text.split('\n')
for line in text:
if '</p>' in line:
if 'CVE-20' in line or 'strong' in line:
if '<p><strong>' in line and '</strong>' in line:
loc = line[line.find("<strong>")+len("<strong>"):line.rfind('</strong>')]
continue
if 'CVE-2' in line:
cve = line[line.find("CVE"):line.rfind(':')]
if loc in data:
data[loc].append(cve)
else:
data[loc] = [cve]
#print(f"{loc}: {cve}")
print()
print("-----")
print()
for key in data.keys():
l = len(data[key])
print(f"{key} : {l}")
output = """
-----
Accessibility : 1
App Store : 3
Apple Neural Engine : 1
AppleMobileFileIntegrity : 3
Assets : 2
Audio : 18
CFNetwork : 5
CoreAudio : 13
CoreFoundation : 7
CoreText : 9
FaceTime : 13
FontParser : 17
Foundation : 7
GPU Drivers : 1
Heimdal : 6
ImageIO : 59
iTunes Store : 3
Kernel : 111
libxpc : 10
libxslt : 3
MobileInstallation : 2
Password Manager : 1
Preferences : 3
Safari : 15
Shortcuts : 2
Tailspin : 1
Telephony : 4
Wallet : 2
WebKit : 253
WebKit Storage : 2
WebRTC : 6
Accounts : 5
AirDrop : 2
Bluetooth : 17
File System : 1
IPSec : 3
Mail : 14
Messages : 20
Notifications : 1
rsync : 1
Sandbox : 6
Security : 15
SQLite : 15
System Preferences : 2
USB Audio : 1
Wi-Fi : 14
ActionKit : 1
Icons : 2
Image Processing : 2
IOHIDFamily : 4
libxml2 : 13
Mail Attachments : 1
Messages Composition : 1
Web App : 2
WebKit Page Loading : 6
IOAcceleratorFamily : 2
IOUSBDeviceFamily : 2
Phone : 3
Safari Login AutoFill : 3
Screenshots : 1
wifivelocityd : 1
CallKit : 2
CFNetwork Proxies : 1
IOSurfaceAccelerator : 2
libexpat : 1
libpcap : 5
Photos : 1
Associated Domains : 1
AVEVideoEncoder : 2
Books : 2
Contacts : 5
File System Events : 2
Graphics Driver : 2
Setup Assistant : 1
Screen Recording : 1
WebKit Process Model : 1
AppleFirmwareUpdateKext : 1
mDNSResponder : 1
UIFoundation : 3
VoiceOver : 4
Call History : 1
CoreCrypto : 3
CoreMedia : 3
Face ID : 1
Keyboards : 1
Notes : 3
PluginKit : 3
Quick Look : 5
Core Data : 3
Found in Apps : 1
Game Center : 1
Profiles : 2
Siri : 5
AppleFileConduit : 1
Disk Images : 4
Lock Screen : 1
Mail Message Framework : 1
MobileLockdown : 1
Photos Storage : 1
Status Bar : 3
StreamingZip : 1
sysdiagnose : 2
802.1X : 1
CFString : 1
configd : 1
Exchange ActiveSync : 1
Feedback Assistant : 2
file : 1
GeoServices : 2
iAP : 2
IOKit : 6
IOKit SCSI : 1
MediaLibrary : 1
Power Management : 1
Privacy : 1
ReplayKit : 1
Safari Reader : 6
TrueTypeScaler : 1
XPC : 1
Live Photos in FaceTime : 1
AppleKeyStore : 1
Core Media : 2
CoreAnimation : 3
Keyboard : 3
Natural Language Processing : 1
Airport : 1
File Provider : 1
LinkPresentation : 8
AppleAVD : 2
ICU : 1
NetworkExtension : 2
WiFi : 1
Auto Unlock : 1
Crash Reporter : 7
dyld : 1
Grand Central Dispatch : 1
iBooks : 2
IOMobileFrameBuffer : 1
IOUserEthernet : 1
mDNSOffloadUserClient : 1
MediaRemote : 1
SafariViewController : 2
Symptom Framework : 2
Text : 1
Core Bluetooth : 2
Emoji : 1
CoreGraphics : 3
Magnifier : 1
Siri Contacts : 1
UIKit : 1
Apple TV App : 1
Clock : 1
Files Widget : 1
Find My iPhone : 1
iCloud Drive : 1
NSURLSession : 1
Storage : 1
WindowServer : 1
Analytics : 1
APFS : 1
FairPlay : 1
IOSkywalkFamily : 1
Model I/O : 23
Phone Keypad : 1
Swift : 1
Logging : 1
XNU : 1
CoreCapture : 1
HomeKit : 1
IDE Device Support : 1
WebDAV : 1
WebKit Web Inspector : 1
"""
@robre
Copy link
Author

robre commented Apr 27, 2021

Sorted Output: (using cat out | sort -t : -k2 -h)

802.1X : 1
APFS : 1
Accessibility : 1
ActionKit : 1
Airport : 1
Analytics : 1
Apple Neural Engine : 1
Apple TV App : 1
AppleFileConduit : 1
AppleFirmwareUpdateKext : 1
AppleKeyStore : 1
Associated Domains : 1
Auto Unlock : 1
CFNetwork Proxies : 1
CFString : 1
Call History : 1
Clock : 1
CoreCapture : 1
Emoji : 1
Exchange ActiveSync : 1
Face ID : 1
FairPlay : 1
File Provider : 1
File System : 1
Files Widget : 1
Find My iPhone : 1
Found in Apps : 1
GPU Drivers : 1
Game Center : 1
Grand Central Dispatch : 1
HomeKit : 1
ICU : 1
IDE Device Support : 1
IOKit SCSI : 1
IOMobileFrameBuffer : 1
IOSkywalkFamily : 1
IOUserEthernet : 1
Keyboards : 1
Live Photos in FaceTime : 1
Lock Screen : 1
Logging : 1
Magnifier : 1
Mail Attachments : 1
Mail Message Framework : 1
MediaLibrary : 1
MediaRemote : 1
Messages Composition : 1
MobileLockdown : 1
NSURLSession : 1
Natural Language Processing : 1
Notifications : 1
Password Manager : 1
Phone Keypad : 1
Photos : 1
Photos Storage : 1
Power Management : 1
Privacy : 1
ReplayKit : 1
Screen Recording : 1
Screenshots : 1
Setup Assistant : 1
Siri Contacts : 1
Storage : 1
StreamingZip : 1
Swift : 1
Tailspin : 1
Text : 1
TrueTypeScaler : 1
UIKit : 1
USB Audio : 1
WebDAV : 1
WebKit Process Model : 1
WebKit Web Inspector : 1
WiFi : 1
WindowServer : 1
XNU : 1
XPC : 1
configd : 1
dyld : 1
file : 1
iCloud Drive : 1
libexpat : 1
mDNSOffloadUserClient : 1
mDNSResponder : 1
rsync : 1
wifivelocityd : 1
AVEVideoEncoder : 2
AirDrop : 2
AppleAVD : 2
Assets : 2
Books : 2
CallKit : 2
Core Bluetooth : 2
Core Media : 2
Feedback Assistant : 2
File System Events : 2
GeoServices : 2
Graphics Driver : 2
IOAcceleratorFamily : 2
IOSurfaceAccelerator : 2
IOUSBDeviceFamily : 2
Icons : 2
Image Processing : 2
MobileInstallation : 2
NetworkExtension : 2
Profiles : 2
SafariViewController : 2
Shortcuts : 2
Symptom Framework : 2
System Preferences : 2
Wallet : 2
Web App : 2
WebKit Storage : 2
iAP : 2
iBooks : 2
sysdiagnose : 2
App Store : 3
AppleMobileFileIntegrity : 3
Core Data : 3
CoreAnimation : 3
CoreCrypto : 3
CoreGraphics : 3
CoreMedia : 3
IPSec : 3
Keyboard : 3
Notes : 3
Phone : 3
PluginKit : 3
Preferences : 3
Safari Login AutoFill : 3
Status Bar : 3
UIFoundation : 3
iTunes Store : 3
libxslt : 3
Disk Images : 4
IOHIDFamily : 4
Telephony : 4
VoiceOver : 4
Accounts : 5
CFNetwork : 5
Contacts : 5
Quick Look : 5
Siri : 5
libpcap : 5
Heimdal : 6
IOKit : 6
Safari Reader : 6
Sandbox : 6
WebKit Page Loading : 6
WebRTC : 6
CoreFoundation : 7
Crash Reporter : 7
Foundation : 7
LinkPresentation : 8
CoreText : 9
libxpc : 10
CoreAudio : 13
FaceTime : 13
libxml2 : 13
Mail : 14
Wi-Fi : 14
SQLite : 15
Safari : 15
Security : 15
Bluetooth : 17
FontParser : 17
Audio : 18
Messages : 20
Model I/O : 23
ImageIO : 59
Kernel : 111
WebKit : 253

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment