SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Downloaden Sie, um offline zu lesen
Research	on	iOS	Device	Protec2on	
nlog2n		
Oct	2015
Objec2ve	
We	study	both	the	underlying	cryptographic	algorithms	
and	firmware	related	vulnerabili2es	for	iOS	in	protec2ng	
against	aDackers	exploi2ng	the	mobile	device	
	
–  Review	of	iOS	cryptography	and	exis2ng	aDacks	against	
code	signing	
	
–  Extrac2ng	AES	keys	for	iOS	firmware	
–  Compromising	code	sign	with	either	downgraded	or	
patched	firmware
Research	Summary	
•  We	have	analyzed	iOS	system	where	cryptography	architecture	and	
algorithms	are	applied,	and	suggested	where	and	how	possibly	certain	
aDacks	can	be	exploited	against	device	protec2on.		
•  We	have	parsed	new	iOS	firmware	format	and	extracted	latest	SHSH	blobs	
for	firmware	code	sign	
–  Firmware	of	new	version	is	not	allowed	to	downgrade	to	old	version	beyond	Apple's	
2me	window.	We	study	the	possibility	to	break	that	limita2on,	where	device	can	be	
boot	with	either	"patched"	firmware	or	downgraded	version,	both	of	which	thus	may	
contain	exploitable	vulnerabili2es.		
•  We	have	par2ally	extracted	some	low-level	derived	AES	keys	from	iOS	
firmware.		
–  These	encryp2on	keys	are	derived	from	hardware	keys,	and	can	be	intercepted	if	we	
break	the	kernel.
1.	iOS	Key	Hierarchy
Passcode	derived	Keys
Encryp'on	keys	for	data	protec'on	
•  UID	key	:	hardware	key	embedded	in	the	applica2on	processor	AES	
engine,	unique	for	each	device.	This	key	can	be	used	but	not	read	
by	the	CPU.	Can	be	used	from	bootloader	and	kernel	mode.	
•  Key	0x835	:	Computed	at	boot	2me	by	the	kernel.	Used	as	"device	
key"	that	protects	class	keys		
–  key835	=	AES(UID,	bytes("01010101010101010101010101010101"))		
•  Key	0x89B	:	Computed	at	boot	2me	by	the	kernel.	Used	to	encrypt	
the	data	par22on	key	stored	on	Flash	memory.	Prevents	reading	
the	data	par22on	key	directly	from	the	NAND	chips.		
–  key89B	=	AES(UID,	bytes("183e99676bb03c546fa468f51c0cbd49"))
Other	Derived	Keys	
•  EMF	key	:	Data	par22on	encryp2on	key.	Also	called	"media	key".	Stored	encrypted	
by	key	0x89B		
•  DKey	:	NSProtec2onNone	class	key.	Used	to	wrap	file	keys	for	"always	accessible"	
files	on	the	data	par22on.	Stored	wrapped	by	key	0x835		
•  BAG1	key	:	System	keybag	payload	key	(+ini2aliza2on	vector).	Stored	unencrypted	
in	effaceable	area.		
•  Passcode	key	:	Computed	from	user	passcode	or	escrow	keybag	BagKey	using	
Apple	custom	deriva2on	func2on.	Used	to	unwrap	class	keys	from	system/escrow	
keybags.	Erased	from	memory	as	soon	as	the	keybag	keys	are	unwrapped.		
•  Filesystem	key	(f65dae950e906c42b254cc58fc78eece)	:	used	to	encrypt	the	
par22on	table	and	system	par22on	(referred	to	as	"NAND	key”)		
•  Metadata	key	(92a742ab08c969bf006c9412d3cc79a5)	:	encrypts	NAND	metadata
2.	Compu2ng	Key	0x835	on	iPhone	
•  Key	0x835	is	computed	by	the	IOAESAccelerator	kernel	service	at	iOS	boot	
by	encryp2ng	a	sta2c	value	01010101010101010101010101010101	with	
UID.		
•  UID	is	a	hardware	encryp2on	key	embedded	in	the	iPhone	applica2on	
processor	AES	engine	and	it	is	unique	for	each	device.	iOS	running	on	the	
iPhone	cannot	read	the	hardware	key	(UID)	but	it	uses	the	key	to	compute	
Key	0x835	in	kernel	mode.	UID	is	not	accessible	to	user	land	process.		
•  This	restric2on	can	be	bypassed	by	patching	the	IOAESAccelerator	kernel	
service.	
Environment:	
MacOS:		10.11	EI	Captain	
Phone	model:	
				Model:	A1586	
				Device:	iPhone	6		(jailbroken)	
IPSW	info:	
				Version:	8.3	
				BuildID:	12F70	
				Release	Date:	08/04/2015	
				Upload	Date:	04/04/2015	
				Filesize:	1.82	GiB
Developed	Tools	
Developed	Tools	(based	on	ios-dataprotec2on	project)	
•  kernel_patch.c:				Patch	kernel	so	we	can	use	
IOAESAccelerator	in	userland			
•  device_infos.c:	extract	encryp2on	keys	(par2al)	
•  Bruteforce.c:		extract	data	protec2on	class	keys	stored	in	the	
system	keybag.	Class	keys	are	protected	with	passcode	key	
and	key	0x835.	The	script	bruteforces	the	passcode	and	
grabs	the	passcode	key.	Later	it	extracts	the	keys	from	
keybag	and	stores	the	result	in	a	plist	file.
Extracted	Keys	(par2ally)	
•  Dkey:	
<string>d379daef24f392fc5bfe94698e758bf114ae296cbdc3eedded
33392bae5b3ba8</string>	
•  ECID:	<integer>5116457374519334</integer>	
•  EMF:	
<string>f67b3fd593717ba3baa74b2fd6718903da2676fcf470a9f8f2
0eeffafa28ea54</string>	
•  Salt:	<string>90deb1a5f99c727345992e57e667edf51999d3c6</
string>	
•  dataVolumeUUID:	<string>eea7c772f92b4020</string>	
•  Udid:	<string>af8e103659fedf12c63d3861c61c1870faan06a</
string>	
•  Uuid:	<string>9c572cf33a8c490da02d4523ce42893f</string>
3.	Extrac2ng	firmware	decryp2on	key	
•  IPSW	firmware	structure	
058-15019-073.dmg	–	restore	
058-14818-073.dmg	–	update	
058-14388-073.dmg	--	user
IM4P	Format	
•  IMG4	firmware	format	is	not	widely	studied	
although	SL8900/IMG3	format	is	well-known	
•  No	exis2ng	decryp2on	key	available	for	
iPhone6	with	iOS	8.3	yet	
typedef	struct	{	
	uint8_t*	magic;	
	uint8_t*	type;	
	uint8_t*	contents;	
	uint8_t*	data;	
	int	dataSize;	
	uint8_t*	kbag;	
	int	kbagSize;	
	AppleImg4_t	*asn1;	
}	img4_file_t;	
See	libimg4	code	package	
The	file	is	an	DER	encoded	ASN.1	object	and	structured	
as	follows:	
30 	Type	,	0x0011	0000:				P/C	constructed,	sequence	
83	,		length	=	125	
8E,	Type,	0x1000	1110:		context,		
86	
D3	
16		Type	tag	indica2ng	IAString	
04	Length	
49	4D	34	50	:	“IM4P”
Extrac2ng	kbags	by	Parsing	IM4	File	
Firmware	decryp2on	key	may	be	further	extracted	from	kbags
4.	Extrac2ng	SHSH	blobs	
•  Users	are	not	allowed	to	downgrade	(or	upgrade)	to	iOS	8.3	auer	Apple	closes	the	
firmware	signing	window	for	iOS	8.3.	Instead,	they	have	to	seDle	for	whatever	firmware	
Apple	is	signing,	which	is	usually	the	latest.	
•  Extract	SHSH	blobs	to	be	prepared	for	possible	downgrade	ability.	
•  Procedure:	
–  Step	1:	Run	TinyUmbrella	
–  Step	2:	Connect	iOS	device	(it	doesn’t	have	to	be	jailbroken!)	
–  Step	3:	Wait	as	TinyUmbrella	fetches	and	saves	blobs	to	file	under	“~/.tu/.shsh/”	directory	in	Mac.
Proposed	Follow-Ups	
•  Further	working	on	extrac2ng	AES	keys	for	iOS	
firmware	
•  Further	working	on	intercep2ng	code	sign	
with	either	downgraded	or	patched	firmware

Weitere ähnliche Inhalte

Was ist angesagt?

iOS and BlackBerry Forensics
iOS and BlackBerry ForensicsiOS and BlackBerry Forensics
iOS and BlackBerry Forensics
Andrey Belenko
 
Network software gotovaya
Network software gotovayaNetwork software gotovaya
Network software gotovaya
Vlad Demensky
 
iOS Forensics: Overcoming iPhone Data Protection
iOS Forensics: Overcoming iPhone Data ProtectioniOS Forensics: Overcoming iPhone Data Protection
iOS Forensics: Overcoming iPhone Data Protection
Andrey Belenko
 
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
Shakacon
 

Was ist angesagt? (20)

Hacking sofware
Hacking sofwareHacking sofware
Hacking sofware
 
Firmware analysis 101
Firmware analysis 101Firmware analysis 101
Firmware analysis 101
 
Ethical hacking for beginners and professionals
Ethical hacking for beginners and professionalsEthical hacking for beginners and professionals
Ethical hacking for beginners and professionals
 
iOS secure app development
iOS secure app developmentiOS secure app development
iOS secure app development
 
I Want More Ninja – iOS Security Testing
I Want More Ninja – iOS Security TestingI Want More Ninja – iOS Security Testing
I Want More Ninja – iOS Security Testing
 
iOS and BlackBerry Forensics
iOS and BlackBerry ForensicsiOS and BlackBerry Forensics
iOS and BlackBerry Forensics
 
Open-Source Software Panel - IP Track
Open-Source Software Panel - IP TrackOpen-Source Software Panel - IP Track
Open-Source Software Panel - IP Track
 
[2.2] Hacking Internet of Things devices - Ivan Novikov
[2.2] Hacking Internet of Things devices - Ivan Novikov[2.2] Hacking Internet of Things devices - Ivan Novikov
[2.2] Hacking Internet of Things devices - Ivan Novikov
 
Outsmarting smartphones
Outsmarting smartphonesOutsmarting smartphones
Outsmarting smartphones
 
Network software gotovaya
Network software gotovayaNetwork software gotovaya
Network software gotovaya
 
How to do Cryptography right in Android Part Two
How to do Cryptography right in Android Part TwoHow to do Cryptography right in Android Part Two
How to do Cryptography right in Android Part Two
 
iOS Forensics: Overcoming iPhone Data Protection
iOS Forensics: Overcoming iPhone Data ProtectioniOS Forensics: Overcoming iPhone Data Protection
iOS Forensics: Overcoming iPhone Data Protection
 
CNIT 128 9. Writing Secure Android Applications
CNIT 128 9. Writing Secure Android ApplicationsCNIT 128 9. Writing Secure Android Applications
CNIT 128 9. Writing Secure Android Applications
 
Bypass Security Checking with Frida
Bypass Security Checking with FridaBypass Security Checking with Frida
Bypass Security Checking with Frida
 
Ethical hacking
Ethical hackingEthical hacking
Ethical hacking
 
Pwning Iot via Hardware Attacks - Chase Schultz - IoT Village - Defcon 23
Pwning Iot via Hardware Attacks - Chase Schultz - IoT Village - Defcon 23Pwning Iot via Hardware Attacks - Chase Schultz - IoT Village - Defcon 23
Pwning Iot via Hardware Attacks - Chase Schultz - IoT Village - Defcon 23
 
CNIT 128 2. Analyzing iOS Applications (Part 1)
CNIT 128 2. Analyzing iOS Applications (Part 1)CNIT 128 2. Analyzing iOS Applications (Part 1)
CNIT 128 2. Analyzing iOS Applications (Part 1)
 
Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...
Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...
Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...
 
16 Ways to Create a Secure Android Application
16 Ways to Create a Secure Android Application16 Ways to Create a Secure Android Application
16 Ways to Create a Secure Android Application
 
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
 

Ähnlich wie Crack ios firmware-nlog2n

Dmitry 'D1g1' Evdokimov - BlackBox analysis of iOS apps
Dmitry 'D1g1' Evdokimov - BlackBox analysis of iOS appsDmitry 'D1g1' Evdokimov - BlackBox analysis of iOS apps
Dmitry 'D1g1' Evdokimov - BlackBox analysis of iOS apps
DefconRussia
 
Static Detection of Application Backdoors
Static Detection of Application BackdoorsStatic Detection of Application Backdoors
Static Detection of Application Backdoors
Tyler Shields
 
Security testing of mobile applications
Security testing of mobile applicationsSecurity testing of mobile applications
Security testing of mobile applications
GTestClub
 

Ähnlich wie Crack ios firmware-nlog2n (20)

CONFidence 2015: iOS Hacking: Advanced Pentest & Forensic Techniques - Omer S...
CONFidence 2015: iOS Hacking: Advanced Pentest & Forensic Techniques - Omer S...CONFidence 2015: iOS Hacking: Advanced Pentest & Forensic Techniques - Omer S...
CONFidence 2015: iOS Hacking: Advanced Pentest & Forensic Techniques - Omer S...
 
Dmitry 'D1g1' Evdokimov - BlackBox analysis of iOS apps
Dmitry 'D1g1' Evdokimov - BlackBox analysis of iOS appsDmitry 'D1g1' Evdokimov - BlackBox analysis of iOS apps
Dmitry 'D1g1' Evdokimov - BlackBox analysis of iOS apps
 
iOS Application Security And Static Analysis.pdf
iOS Application Security And Static Analysis.pdfiOS Application Security And Static Analysis.pdf
iOS Application Security And Static Analysis.pdf
 
Ярослав Воронцов — Пара слов о mobile security.
Ярослав Воронцов — Пара слов о mobile security.Ярослав Воронцов — Пара слов о mobile security.
Ярослав Воронцов — Пара слов о mobile security.
 
OWASP for iOS
OWASP for iOSOWASP for iOS
OWASP for iOS
 
Pentesting iOS Applications
Pentesting iOS ApplicationsPentesting iOS Applications
Pentesting iOS Applications
 
Hacking & Securing of iOS Apps by Saurabh Mishra
Hacking & Securing of iOS Apps by Saurabh MishraHacking & Securing of iOS Apps by Saurabh Mishra
Hacking & Securing of iOS Apps by Saurabh Mishra
 
Android Penetration testing - Day 2
 Android Penetration testing - Day 2 Android Penetration testing - Day 2
Android Penetration testing - Day 2
 
Mobile Forensics on a Shoestring Budget
Mobile Forensics on a Shoestring BudgetMobile Forensics on a Shoestring Budget
Mobile Forensics on a Shoestring Budget
 
The newest hacking tools of 2020 so far | ISOEH
The newest hacking tools of 2020 so far | ISOEHThe newest hacking tools of 2020 so far | ISOEH
The newest hacking tools of 2020 so far | ISOEH
 
iOS-Application-Security-iAmPr3m
iOS-Application-Security-iAmPr3miOS-Application-Security-iAmPr3m
iOS-Application-Security-iAmPr3m
 
Synack at AppSec California with Patrick Wardle
Synack at AppSec California with Patrick WardleSynack at AppSec California with Patrick Wardle
Synack at AppSec California with Patrick Wardle
 
osi semair.pptx
osi semair.pptxosi semair.pptx
osi semair.pptx
 
Static Detection of Application Backdoors
Static Detection of Application BackdoorsStatic Detection of Application Backdoors
Static Detection of Application Backdoors
 
The Seven Most Dangerous New Attack Techniques, and What's Coming Next
The Seven Most Dangerous New Attack Techniques, and What's Coming NextThe Seven Most Dangerous New Attack Techniques, and What's Coming Next
The Seven Most Dangerous New Attack Techniques, and What's Coming Next
 
Untitled 1
Untitled 1Untitled 1
Untitled 1
 
Security testing of mobile applications
Security testing of mobile applicationsSecurity testing of mobile applications
Security testing of mobile applications
 
Enterprise Java: Just What Is It and the Risks, Threats, and Exposures It Poses
Enterprise Java: Just What Is It and the Risks, Threats, and Exposures It PosesEnterprise Java: Just What Is It and the Risks, Threats, and Exposures It Poses
Enterprise Java: Just What Is It and the Risks, Threats, and Exposures It Poses
 
ios device protection review
ios device protection reviewios device protection review
ios device protection review
 
What's in a Jailbreak? - BSides 2019 keynote
What's in a Jailbreak? - BSides 2019 keynoteWhat's in a Jailbreak? - BSides 2019 keynote
What's in a Jailbreak? - BSides 2019 keynote
 

Kürzlich hochgeladen

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Crack ios firmware-nlog2n