iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021....

44
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications Presenter: Ken Fang May 18, 2021

Transcript of iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021....

Page 1: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

iOS, Your OS, Everybody’s OS: Vetting and Analyzing NetworkServices of iOS Applications

Presenter: Ken Fang

May 18, 2021

Page 2: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Introduction▶ Network service is used to provide networked data storage, or other online

functionality to apps.

▶ Network service is wildly used in mobile applications.

▶ Mobile Device Management.▶ Receive command from a peripheral equipment (IoT device).▶ File delivering, voice calls, etc., (Point-to-Point Network).▶ File or media sharing, etc., (Content Delivery Network).

Page 3: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Introduction▶ Network service is used to provide networked data storage, or other online

functionality to apps.▶ Network service is wildly used in mobile applications.

▶ Mobile Device Management.▶ Receive command from a peripheral equipment (IoT device).▶ File delivering, voice calls, etc., (Point-to-Point Network).▶ File or media sharing, etc., (Content Delivery Network).

Page 4: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Introduction▶ Network service is used to provide networked data storage, or other online

functionality to apps.▶ Network service is wildly used in mobile applications.

▶ Mobile Device Management.

▶ Receive command from a peripheral equipment (IoT device).▶ File delivering, voice calls, etc., (Point-to-Point Network).▶ File or media sharing, etc., (Content Delivery Network).

Page 5: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Introduction▶ Network service is used to provide networked data storage, or other online

functionality to apps.▶ Network service is wildly used in mobile applications.

▶ Mobile Device Management.▶ Receive command from a peripheral equipment (IoT device).

▶ File delivering, voice calls, etc., (Point-to-Point Network).▶ File or media sharing, etc., (Content Delivery Network).

Page 6: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Introduction▶ Network service is used to provide networked data storage, or other online

functionality to apps.▶ Network service is wildly used in mobile applications.

▶ Mobile Device Management.▶ Receive command from a peripheral equipment (IoT device).▶ File delivering, voice calls, etc., (Point-to-Point Network).

▶ File or media sharing, etc., (Content Delivery Network).

Page 7: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Introduction▶ Network service is used to provide networked data storage, or other online

functionality to apps.▶ Network service is wildly used in mobile applications.

▶ Mobile Device Management.▶ Receive command from a peripheral equipment (IoT device).▶ File delivering, voice calls, etc., (Point-to-Point Network).▶ File or media sharing, etc., (Content Delivery Network).

Page 8: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Motivation

▶ Recent research evaluating the security of open port usage in Android apps hasdemonstrated new attack avenues that can exploit the vulnerability of networkservices and access unauthorized sensitive data previously unthought of.

▶ There are many works on how to solve limitations on static analysis android appssuch as handle dynamic code loading, complex implicit control/data flows, oradvanced code obfuscation.

What about iOS?

Page 9: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Motivation

▶ Recent research evaluating the security of open port usage in Android apps hasdemonstrated new attack avenues that can exploit the vulnerability of networkservices and access unauthorized sensitive data previously unthought of.

▶ There are many works on how to solve limitations on static analysis android appssuch as handle dynamic code loading, complex implicit control/data flows, oradvanced code obfuscation.

What about iOS?

Page 10: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Motivation

▶ Recent research evaluating the security of open port usage in Android apps hasdemonstrated new attack avenues that can exploit the vulnerability of networkservices and access unauthorized sensitive data previously unthought of.

▶ There are many works on how to solve limitations on static analysis android appssuch as handle dynamic code loading, complex implicit control/data flows, oradvanced code obfuscation.

What about iOS?

Page 11: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Goals

▶ Vetting and analyzing network services of iOS applications.

▶ Understanding network service of iOS ecosystem.

Page 12: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Goals

▶ Vetting and analyzing network services of iOS applications.▶ Understanding network service of iOS ecosystem.

Page 13: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Challenges

▶ Public repository of iOS apps is not available

▶ Practical tools for automatically analyzing iOS apps are not well developed.▶ Network service libraries of iOS apps are not available.

Page 14: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Challenges

▶ Public repository of iOS apps is not available▶ Practical tools for automatically analyzing iOS apps are not well developed.

▶ Network service libraries of iOS apps are not available.

Page 15: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Challenges

▶ Public repository of iOS apps is not available▶ Practical tools for automatically analyzing iOS apps are not well developed.▶ Network service libraries of iOS apps are not available.

Page 16: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Design Overview

Page 17: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Collecting iOS Apps

▶ Download apps from iTunes app storeutilizing iTunes’ dll file

▶ Decrypt the app by only delivering theexecutable

Page 18: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Collecting iOS Apps

▶ Download apps from iTunes app storeutilizing iTunes’ dll file

▶ Decrypt the app by only delivering theexecutable

Page 19: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Collecting iOS Apps – cont

Figure: Performance of decryption

Page 20: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Vetting

▶ Dynamic analysis

▶ Static analysis▶ Manual confirmation

Page 21: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Vetting

▶ Dynamic analysis▶ Static analysis

▶ Manual confirmation

Page 22: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Vetting

▶ Dynamic analysis▶ Static analysis▶ Manual confirmation

Page 23: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Dynamic analysis

▶ From inspection ofnetwork interface, we canfind out which appprovide network service▶ Deploy an addon on

jailbroken iOS devicesto redirect _bind APIcalls

▶ Fetch parameters of_bind API

▶ Call stack extraction▶ The call stack is

maintained by theaddon for networkservice library analysis

Page 24: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Dynamic analysis

▶ From inspection ofnetwork interface, we canfind out which appprovide network service▶ Deploy an addon on

jailbroken iOS devicesto redirect _bind APIcalls

▶ Fetch parameters of_bind API

▶ Call stack extraction▶ The call stack is

maintained by theaddon for networkservice library analysis

Page 25: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Result of Dynamic Analysis

▶ Dynamic port is for in-app communication

▶ In iOS, attack service bind on loopback is impossible.▶ The app that need static analysis are apps listen on LAN interface.

Page 26: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Result of Dynamic Analysis

▶ Dynamic port is for in-app communication▶ In iOS, attack service bind on loopback is impossible.

▶ The app that need static analysis are apps listen on LAN interface.

Page 27: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Result of Dynamic Analysis

▶ Dynamic port is for in-app communication▶ In iOS, attack service bind on loopback is impossible.▶ The app that need static analysis are apps listen on LAN interface.

Page 28: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Static Analysis

Researcher solution:▶ Supplement semantics of more ARM instructions to the decompiler to reduce

memory usage

▶ Convert inter-procedural data-flow analysis to on-demand inter-procedural tospeed up analysis performance

▶ Formulate and specify rules for the misuse of network services

Page 29: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Static Analysis

Researcher solution:▶ Supplement semantics of more ARM instructions to the decompiler to reduce

memory usage▶ Convert inter-procedural data-flow analysis to on-demand inter-procedural to

speed up analysis performance

▶ Formulate and specify rules for the misuse of network services

Page 30: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Static Analysis

Researcher solution:▶ Supplement semantics of more ARM instructions to the decompiler to reduce

memory usage▶ Convert inter-procedural data-flow analysis to on-demand inter-procedural to

speed up analysis performance▶ Formulate and specify rules for the misuse of network services

Page 31: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Static Analysis – result

Performance overview Analysis result

Page 32: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Manual confirmation

▶ Automated analysis can’t verify specified vulnerabilities.

▶ Mainly focus on remote vulnerabilities for exploits.▶ For example, vulnerable service exposed to cellular network is high risk, medium

risk for exposed to Wi-Fi network.

Page 33: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Manual confirmation

▶ Automated analysis can’t verify specified vulnerabilities.▶ Mainly focus on remote vulnerabilities for exploits.

▶ For example, vulnerable service exposed to cellular network is high risk, mediumrisk for exposed to Wi-Fi network.

Page 34: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Manual confirmation

▶ Automated analysis can’t verify specified vulnerabilities.▶ Mainly focus on remote vulnerabilities for exploits.▶ For example, vulnerable service exposed to cellular network is high risk, medium

risk for exposed to Wi-Fi network.

Page 35: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Signature of Network ServicesSince call stacks don’t have enough information, we need to map them to token.

Page 36: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Signature of Network Services – cont

▶ Third-party libraries have a larger weight on similarity ratio of two different callstacks.

▶ Researchers duplicate the token multiple times according to the weight. Thencalculate the similarity of two new tokens.

Page 37: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Result of signature comparison

▶ Over 40.98% apps use system APIs to provide network services.

▶ Apps in China are more likely to provide network service than apps in US.

Page 38: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Result of signature comparison

▶ Over 40.98% apps use system APIs to provide network services.▶ Apps in China are more likely to provide network service than apps in US.

Page 39: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Overall result

Game App are the most likely to provide network services.

Page 40: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Overall result

Figure: Connection between third-party network service and system network service APIs

Page 41: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Vulnerabilities in iOS Apps

Page 42: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Summary & Mitigation

▶ App developers should avoid use LAN interface as much as possible.

▶ Network admin of Wifi and cellular network should enable strict firewall policy towhitelist connection between same LAN network.

▶ Mobile OS vendor should implement a host-based firewall.

Page 43: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Summary & Mitigation

▶ App developers should avoid use LAN interface as much as possible.▶ Network admin of Wifi and cellular network should enable strict firewall policy to

whitelist connection between same LAN network.

▶ Mobile OS vendor should implement a host-based firewall.

Page 44: iOS, Your OS, Everybody’s OS: Vetting and Analyzing Network Services of iOS Applications · 2021. 5. 18. · Introduction Network service is used to provide networked data storage,

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Summary & Mitigation

▶ App developers should avoid use LAN interface as much as possible.▶ Network admin of Wifi and cellular network should enable strict firewall policy to

whitelist connection between same LAN network.▶ Mobile OS vendor should implement a host-based firewall.