marc rogers, 20 june 2015...by injecting dynamic libraries into apple ios ipa’s it is possible to...

32
Attacking Mobile Applications Marc Rogers, 20 June 2015

Upload: others

Post on 03-Sep-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

Attacking Mobile ApplicationsMarc Rogers, 20 June 2015

Page 2: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

We are not winning the malware battle.

Page 3: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

Total Malware

Page 4: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”
Page 5: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

Two of the main drivers behind these numbers are:

1. It is really easy to make malware.2. It is really hard for antivirus to detect new

malware.

Page 6: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

Lets look at the two main mobile platforms

AndroidiOS

Page 7: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

Demo 1 – Building “0day” malware on Android

Page 8: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

Building new Android malware is actually really easy and can be accomplished by anyone with a few basic java dev skills.

Step 1. Identify your target app – for this demo we will use a password manager app.

Step 2. Decompile the app using APK tool or something similar.Step 3. Edit the application to insert your hostile functionality.

- Keep it simple. For this example we will add an SMS receiver to intercept and relay any SMS the phone receives.

Step 4. Recompile.Step 5. Sign.

Android Malware 101 – Making Malware

Page 9: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

Demo

Page 10: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

Android Malware 101 - Results

In 5 simple steps we created a new piece of mobile malware.- Low barrier to entry, even a child could do this.- Requires user consent to install unless you have physical access.

- However most users just say yes.- Most importantly - it is undetectable by AV.

Many malware authors use this exact methodology in conjunction with purchasing a forgotten or unpopular app in the Play store.- Now you have malware in the play store- Bonus: it will be pushed out as an update to the existing users.- Google’s does look for this, but if the malware author is subtle when

changing ownership and inserting the code it is very hard to detect.

Page 11: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

It’s good that Google validates developer accounts…..

Page 12: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

Demo 2 – Building 0day malware on iOS

Page 13: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

Demo 1 – Building 0day malware on Android

Page 14: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

Making iOS malware is surprising similar to making Android malware.

Step 1. Identify your target app – for this demo we will use a password manager app.

Step 2. Decompress the ipaStep 3. Insert your dynamic library (dylib) containing your code.

- In this example we are injecting a menu to allow editing of application functionality during runtime.

Step 4. Edit the ipa headers to load your dylib.Step 5. re-sign the IPA

iOS Malware 101 – Making Malware

Page 15: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

Demo

Page 16: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

iOS Malware 101 – Additional resultsBy injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time.

This exposes the “soft underbelly” of many apps, and more seriously the often completely unprotected back-end.

Example 1 – Employee mode.

Example 2 – Enable / Disable certificate checking

Example 3 – Bypass authentication

Example 4 – Dumping credentials

Page 17: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

ConclusionsBoth Apple and Android are vulnerable to very similar attack techniques.

The much more mature Android techniques can now readily bypass both antivirus and application vetting. Apple iOS techniques are new but maturing fast.

However, It has been demonstrated that it is possible to inject malware in to BOTH stores.

Application developers are not taking adequate steps to protect their applications. Most are relying on device integrity to protect both their apps and the application servers. This is VERY bad.

Page 18: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

iOS Malware 101 - ResultsThis method is VERY similar to the Android method.- This also creates malware that isn’t detected by Antivirus- Has to be re-signed with a developer certificate.

- User has to agree to trust the application as a result.- Will NOT pass Apple app approval.

Note: It is early days for iOS app hacking and most techniques are only a year or two old.

While it is not possible to get apps into the Apple store using this method, it is possible to do it by creating an app that hides its malicious functionality until after the apple approval process.

Page 19: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

CloudFlare overviewMarc Rogers, 22 April 2015

Page 20: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

CloudFlare’s mission

Build a better Internet.

Page 21: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

CloudFlare quick facts• More than 2 million customers

• Adding 5,000+ new domains per day

• 5% of global web requests

• 5 PB of data per day

• 8 billion attacks per day

• Self-learning network that gets faster, safer and smarter with every request

• 33 pops globally today

• new pops added every few months

• 100 employees

• Offices in San Francisco, Washington D.C., London

• World Economic Forum Technology Pioneer

• Winner of Wall Street Journal’s “Most Innovative Internet Company” two years running

Page 22: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

Essential edge functions

• Content delivery network (CDN) / Caching

• Front end optimization (FEO)

• WAN optimization

• Firewall / WAF

• Load balancing

• DDoS Mitigation

Page 23: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

DDoS attacks are on the riseAttacks cause service disruptions and unhappy customers

Source: 9th annual Worldwide Infrastructure Security Report

Page 24: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

Mitigating attacksCloudFlare has mitigated the nastiest and largest DDoS attacks

• 300 Gbps DNS amplification attack on Spamhaus

• 300 Gbps DNS amplification attack on Popvote.hk

• 400 Gbps NTP amplification attack on an anonymous CloudFlare customer

Page 25: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

CloudFlare’s network

Page 26: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

DDoS protection solutions by provider

On-Premise Solution

Scrubbing Solution CloudFlare

Mitigates volumetric attacks X a a

Always Online a X a

No HW/SW to install X a a

No added latency X X aSimple & easyimplementation X X a

No training required X X a

Page 27: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

Security features overview• DDoS protection: Layer 3, 4, and 7 attack mitigation

• IP reputation database: Network effect of 2MM + websites, dynamic reputation scoring, real-time feedback

• Web Application Firewall (WAF): Runs OWASP ModSecurity Core Rule Set: • Custom WAF rules• Less than 1 millisecond latency

• SSL: Enable SSL with a single click, no configuration necessary • Custom SSL certificate• Wildcard certificates• Keyless SSL (beta testing)

Page 28: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

IP reputation database

• Automatic learning from 2M+ websites and 1 billion+ unique IPs per month

• Suspicious activity anywhere on the network increases an IP’s Threat Score

• Configurable sensitivity for captchas

• Low false positive rate: 1 in every 50 million captcha pages successfully completed

Automatic learning: surge in traffic (green), identified as attack traffic (red) to be blocked

Page 29: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

Global DDoS mitigation

Page 30: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

The SSL challenge

• Elasticity and infinite scalability of the cloud make it a “no brainer” for edge services

• However, first generation edge services (e.g., CDNs) have struggled winning adoption from financial services

• Last hurdle is risk of revealing encryption keys

• CDNs traditionally designed for media companies

• Disney losing SSL key is bad

• Goldman Sachs losing SSL key has to be reported to the Federal Reserve

• Inherently has limited CDN market to approximately 10,000 customers

Page 31: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

The solution: Keyless SSL

Page 32: Marc Rogers, 20 June 2015...By injecting dynamic libraries into Apple iOS IPA’s it is possible to “mess” with the application during run-time. This exposes the “soft underbelly”

The solution: Keyless SSL

• Eliminates the number one objection from enterprises adopting CDN-like technologies

• Allows infinite scalability and elasticity of edge services without risking data integrity

• Last hurdle before mass migration of edge service to the cloud

• Broadly patented