42
Classification: Internal www.nviso.be Using Mobile Malware tactics for red teaming November 2019

Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

www.nviso.be

Using Mobile Malware tactics for red teaming

November 2019

Page 2: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

JEROEN BECKERS

― Mobile solution lead at NVISO― Primary author of SEC575 (NVISO)― Co-author of

― OWASP Mobile Security Testing Guide (MSTG)

― OWASP Mobile Application Security Verification Standard (MASVS)

Page 3: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Mobile devices

www.nviso.be | 3

Malware tactics for red teaming

Page 4: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Mobile Malware in a tiny nutshellMalware tactics for red teaming

Subscription scams

Ransomware Ad fraud

Premium text fraud

Page 5: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Mobile Banking TrojansMalware tactics for red teaming

Page 7: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Necessary stepsMalware tactics for red teaming

Create application

Install application

Get the data

Page 8: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Creating an application

www.nviso.be | 8

Page 9: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Different optionsCreating an application

Page 10: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

How does malware do it?Creating an application

0

10

20

30

40

50

60

70

80

90

Create Steal

Page 11: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Can we do it?Creating an application

Page 12: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

» adb pull /data/app/com.limebike-1/base.apk/data/app/com.limebike-1/base.apk: 1 file pulled. 23.6 MB/s (26939075 bytes in 1.090s)»

Obtaining a valid APKCreating an application

Get APK from deviceSTEP 1

Page 13: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

» apktool d base.apkI: Using Apktool 2.4.0 on base.apkI: Loading resource table... ...I: Baksmaling classes.dex...I: Baksmaling classes2.dex...I: Baksmaling classes3.dex...I: Copying assets and libs...I: Copying unknown files...I: Copying original files...»

Modifying the applicationCreating an application

Decompile the applicationSTEP 2

Page 14: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

SMALI codeCreating an application

Page 15: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Adding SMALI codeCreating an application

ModifySTEP 3

Page 16: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

» apktool b baseI: Using Apktool 2.4.0...I: Building apk file...I: Built apk...» jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 –keystore keystore.keystorebase/dist/base.apk mykeystore...

adding: META-INF/MYKEYSTORE.RSAsigning: resources.arsc

...jar signed.

Recompiling & signingCreating an application

Recompile & signSTEP 4

Page 17: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Testing the applicationCreating an application

Possible hurdles:

- Original application already installed

- Application contains Runtime Application

Self Protection (RASP)

Page 18: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

A toast message is nice, but …Creating an application

Page 19: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Installing the application

www.nviso.be | 19

Page 20: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Different approachesInstalling the application

Page 21: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

How does malware do it?Installing the application

Page 22: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Chamois Family

www.nviso.be | 22

Installing the application

- 5 stages of obfuscation and anti-RE

- Dynamic payload system

- Premium SMS & Ad fraud

Source: Chamois: The Most Impactful Android Botnet

of 2018 - Maddie Stone

Page 23: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

How does malware do it?Installing the application

Source: Android Security & Privacy

2018 Year In Review (Google)

Page 24: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Third party app storesInstalling the application

Page 25: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Drive-by downloadsInstalling the application

=

Page 26: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Can we do it?Installing the application

Yes, but…

Accepts malware

Allowed by EULA

Controlled environment

Loading external code

Easy installation

Page 27: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Can we do it?Installing the application

Yes, but…

Accepts malware

Allowed by EULA

Controlled environment

Loading external code

Easy installation

Page 28: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Can we do it?Installing the application

Yes, but…

Accepts malware

Allowed by EULA

Controlled environment

Loading external code

Easy installation

Page 29: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Get the data

www.nviso.be | 29

Page 30: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Application sandboxesGet the data

Page 31: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

How does malware do it?

www.nviso.be | 31

Get the data

Accessibility Overlay attacks Phishing

Page 32: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Accessibility (A11Y)

www.nviso.be | 32

Get the data

Page 33: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Accessibility (A11Y)

www.nviso.be | 33

Get the data

Page 34: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Overlay attacks

www.nviso.be | 34

Get the data

Page 35: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Drawing on top

www.nviso.be | 35

Get the data

http://cloak-and-dagger.org/

Page 36: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

BankBot

www.nviso.be | 36

Get the data

Page 37: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Can we do it?Get the data

Annoy user to give access

Pretend to be Google / Samsung / …

Full control over all visual items

Can be activated with Accessibility

Not granted by default

Probably not needed

Page 38: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Can we do it? – Credentials

www.nviso.be | 38

Get the data

Intune Gmail Full controlWIFI

Page 39: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Can we do it? – 2FA

www.nviso.be | 39

Get the data

G Suite MS Authenticator

Page 40: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Conclusion

www.nviso.be | 40

Page 41: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

Can we do it?

www.nviso.be | 41

Conclusion

Create application

Install application

Get the data

Social engineering

Blocked by MDM

Easy to copy

Some development

required

Easy social

engineering

Most applications

not protected

Page 42: Using Mobile Malware tactics for red teaming · Verification Standard (MASVS) ... | 3 Malware tactics for red teaming. Classification: Internal Mobile Malware in a tiny nutshell Malware

Classification: Internal

www.nviso.be

Thank you!

Jeroen Beckers

linkedin.com/in/beckersjeroen

[email protected]