Inspection of Windows Phone applications
Dmitriy Evdokimov Andrey Chasovskikh
Inspection of Windows Phone applications Dmitriy Evdokimov Andrey - - PowerPoint PPT Presentation
Inspection of Windows Phone applications Dmitriy Evdokimov Andrey Chasovskikh About us Dmitriy D1g1 Evdokimov - Security researcher at ERPScan - Editor of Russian hacking magazine - DEFCON Russia (DCG #7812) organizer Andrey
Dmitriy Evdokimov Andrey Chasovskikh
Dmitriy ‘D1g1’ Evdokimov
Andrey Chasovskikh
2
3
WINDOWS PHONE INTRO
announced
time version
WP7 WP7 NoDo WP7.5 Mango WP7.5 Tango WP8 27 Sep 2011 29 Oct 2012 21 Oct 2011
5
Source: Gartner, November 2012
6
enterprise applications etc.
7
SECURITY MODEL
Kernel, kernel-mode drivers
Services, user-mode drivers
Pre-installed applications
Applications from WP store
9
Kernel, kernel-mode drivers
All other software: services, pre-installed apps, application from WP store
10
Windows Phone 7
Etc.
Undocumented
properties
Etc.
WMAppManifest.xml
Windows Phone 8
Etc. 11
App1 Isolated chamber App2 Isolated chamber Isolated storage for App1 Isolated storage for App2
hidden
12
13
Isolated Storage Isolated Settings Storage
Files Database
Isolated File Storage Directory Physical File Storage 14
format (since Aug 2012)
15
ALL ABOUT APPLICATIONS
Applications Developer Platform (XAML, XNA, Device services) .NET Compact Framework (BCL + Silverlight flavor) WP7 OS, WinCE based
17
???
18
Applications Developer Platform (XAML, XNA, Device services) .NET Framework (CoreCLR) WP8 OS, Win8 based
19
20
* — optional for WP7, absent in WP8
21
App Creation App Submission XAP File Validation Adding Metadata Certification Testing Signing Publication in Marketplace Source code .xap 22
WP7: \Applications
\Install\<ProductID>\Install\
\Data\<ProductID>\Data\IsolatedStorage Same idea in WP8, i.e. install path: C:\Data\Programs\<ProductID>\Install\
23
NOT ALL APPLICATIONS ARE SECURE
Server Device/Emulator Data channel App 25 App
Prepare environment
Static analysis
Dynamic analysis
26
27
WP7 (C#/VB) WP8 (C#/VB/C/C++) iOS (Objective-C) Android (Java)
Note: Main programming languages in brackets
Platform independent vulnerabilities Platform specific vulnerabilities 28
TOOLS OVERVIEW
30
Static analysis is insufficient. Lack of dynamic analysis tools:
31
Solution: static byte code instrumentation.
32
33
34
35
DEEP DIVE: FINDING VULNERABILITIES
Target application Instrumented application Emulator Emulator console Tangerine log Instrumented application Add hooks (1) Resign and deploy Hooked
Log data (2) Repeat
(1) Changing CIL code (2) Emulator console (writing/reading)
38
39
40
CIL Assembly C# Source Code MDIL Assembly C# Compiler MDIL Compiler Cloud MDIL Assembly
Native Image Generator
Native DLL Device
Download Run
41
42
R0 = this R1 = a R0 + 0x10 = j, where j is a field from base class
43
http://github.com/WalkingCat/mdildump/
44
CONCLUSION
46
47
Q&A
Dmitry Evdokimov d.evdokimov@erpscan.com @evdokimovds Andrey Chasovskikh http://andreycha.info @andreycha Tangerine: http://github.com/andreycha/tangerine