Created
April 27, 2021 10:16
-
-
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
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
#!/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 | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorted Output: (using
cat out | sort -t : -k2 -h
)