“we know what you did this summer” - rasthofer · “we know what you did this summer”...

39
3.12.2015 | AVAR 2015 | 1 “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt / CASED) Eric Bodden (TU Darmstadt / Fraunhofer SIT) Carlos Castillo (Intel Security) Alex Hinchliffe (Intel Security)

Upload: others

Post on 15-Mar-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 1

“We know what you did this summer”

Android Banking Trojans Exposing Its

Sins in The Cloud

Siegfried Rasthofer (TU Darmstadt / CASED)

Eric Bodden (TU Darmstadt / Fraunhofer SIT)

Carlos Castillo (Intel Security)

Alex Hinchliffe (Intel Security)

Page 2: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 2

Siegfried Rasthofer

• 3rd year PhD-Student at TU Darmstadt

• Research interest in Static-/dynamic code analyses

• Found 2 AOSP exploits, various App security vulnerabilities

Prof. Dr. Eric Bodden

• Professor at TU Darmstadt

• Research interest in Static-/dynamic code analyses

• Heading the Secure Software Engineering Group at Fraunhofer

SIT and Technische Universität Darmstadt

Carlos Castillo

• Mobile Security Researcher at Intel Security.

• Hacking Exposed 7 co-author (Hacking Android).

• ESET Latin America’s Best Antivirus Research winner 2009.

Alex Hinchliffe

• Mobile Security Research Manager at Intel Security

• Co-developer of cloud based Anti-Malware technology, Artemis

• Project partner of MobSec, S2Lab, Royal Holloway University, London

Page 3: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 3

Backend-as-a-Service

56 Mio. data records

“publicly“ available

(BlackHat EU 2015)

Page 4: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 4

Backend-as-a-Service

Page 5: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 5

Agenda

• Backend-as-a-Service

• Developers exposing BaaS resources

• Android Malware using Facebook Parse

• Android/OpFake and Android/Marry

• Exposed Android Malware Facebook Parse accounts

• Financial Fraud by Android/Marry

• Responsible disclosure

• Conclusions

Page 6: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 6

Backend-as-a-Service (1)

BaaS

SDK

Cloud

APP

Page 7: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 7

Backend-as-a-Service (2)

BaaS

Android iOS

...

JavaScript

Page 8: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 8

Backend-as-a-Service (3)

Push Notifications Data Storage

User Administration Social Network

Page 9: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 9

Amazon Tutorial

DB connection

AmazonS3Client s3Client = new AmazonS3Client(

new BasicAWSCredentials(“ACCESS_KEY_ID“, “SECRET_KEY“) );

BaaS

SDK

“When you access AWS programmatically, you

use an access key to verify your identity and the

identity of your applications. An access key

consists of an access key ID and a secret access

key.

Anyone who has your access key has the same

level of access to your AWS resources that you

do.“

Source: http://docs.aws.amazon.com/

Page 10: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 10

App Authentication Model

App“Hi, I am app

<Application ID>”Identification

“My <Secret Key>

is in the app” ???Authentication

Server

Identification Authentication=

??

Page 11: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 11

HAVOC: Automatic Exploit Generator

Page 12: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 12

Malware using Facebook‘s Parse

294,817 malware apps scanned

9 Android malware samples

5 Parse accounts

3 tables

Page 13: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 13

OpFake – App Execution

Icon Hidden

Page 14: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 14

OpFake – MainService Started

Phone

Rings

Boot

Completed

OR

Page 15: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 15

OpFake – Main Service Functionality

Subscribe to Push Notifications

• D-<device_id>

• “Everyone”

• Country

• “welcome”

Leak device data to a remote C&C

server

• IMEI

• Country

• Phone Number

• Network Operator

• Balance

Save installation data in Parse

• Device data

• device is rooted?

• device is active?

Schedule a System Alarm

• Execute code every 60 seconds

Page 16: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 16

OpFake – “Traditional” C&C cycle

Infected DeviceCommand and Control

Server

RequestChange C&C

Intercept

Open URL

Send SMS

Send task for execution

Report

Page 17: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 17

OpFake – Parse C&C cycle

Infected Device

Parse BaaS

Query NewTasksnew_server

intercept

sms

ussd

url

install

Send task for execution

Save task in TaskManager

Task deleted

in NewTasks

Page 18: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 18

OpFake – SMS Received

Save data in Parse SmsReceiver table

• origin

• content

• IMEI

• type

• is_card

Send message data to Parse

Push channel “T”

• IMEI

• origin

• content

• type (incoming)

Page 19: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 19

OpFake – Intercept flag

Intercept is ON

• Check if it is a response from a previous command

• Find the executed task in TaskManagerParse table

• Update the record with the response

Intercept is OFF

• Leak SMS message to remote server

• If origin is a specific network operator, extract balance

Page 20: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 20

NewTasks Schema

NewTask Record

imei task objectId createdAt updatedAt

sms

origin destination content date

intercept

values (on/off) date

new_server

imei URL date

install

imei URL of the APK date package name

Page 21: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 21

NewTasks – Commands received but never consumed

Exposed Malware Parse.com Accounts

Page 22: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 22

NewTasks – Command created by date

Exposed Malware Parse.com Accounts

Page 23: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 23

SmsReceived Schema

SmsReceived Record

body from objectId intype is_card updatedAt type createdAt

Page 24: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 24

Number of Intercepted SMS messages in SmsReceiver Parse table

Exposed Malware Parse.com Accounts

2,000

28,067

40,054

41,105

60,030

ACCOUNT D (MARRY)

ACCOUNT C (OPFAKE)

ACCOUNT A (OPFAKE)

ACCOUNT B (OPFAKE)

ACCOUNT E (OPFAKE)

Page 25: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 25

Number of credit cards numbers in SMS messages in SmsReceiver

Exposed Malware Parse.com Accounts

5

9

10

19

126

ACCOUNT C (OPFAKE)

ACCOUNT A (OPFAKE)

ACCOUNT B (OPFAKE)

ACCOUNT E (OPFAKE)

ACCOUNT D (MARRY)

Page 26: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 26

TaskManager Schema

TaskManager Record

task hash objectId updatedAt imei type response createdAt

sms

destination

text (command)

privat_start

empty

intercept

on/off

install

URL/file.apk

sms

destination

text (response)

Page 27: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 27

TaskManager – Command Executed

Exposed Malware Parse.com Accounts

Page 28: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 28

Android/Marry

Page 29: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 29

Number of SMS requests by targeted companies in Account D (Marry)

Exposed Malware Parse.com Accounts

1

10

16

33

37

51

53

70

141

5350

5335 (SVYAZNOYBANK)

100 (MEGAFON)

79037672265 (ALFA-BANK)

159 (TELE2)

3116 (ROSTELECOMO)

7878 (BEELINE)

6996 (MTC)

7494 (QIWI)

10060 (PRIVATBANK)

900 (SBERBANK)

Page 30: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 30

Sberbank SMS Banking Commands in TaskManager

To: 900

INFO

From: 900

VISA1234 (ON)

VISA7894 (OFF)

To: 900

BALANCE 1234

From: 900

VISA1234: $100

Page 31: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 31

Sberbank SMS Banking Commands in TaskManager

To: 900

PEVEROD

1234 (origin)

7894 (destination)

50 (amount)

From: 900

Send code 1111

to confirm transfer

To: 900

1111

From: 900

Transfer processed

Page 32: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 32

Sberbank SMS Banking Commands in TaskManager

To: 900

ZAPROS

123456 (phone #)

100 (amount)

From: 900

Send code 999 to

confirm transfer

to 456789

Phone 123456Phone 456789 Phone 123456

To: 900

999

From: 900

Transfer processed

Phone 456789

Page 33: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 33

Sberbank SMS Banking Commands in TaskManager

To: 900

TEL

123456 (phone #)

50 (amount)

From: 900

Send code 555

to confirm payment

To: 900

555

From: 900

Payment processed

Page 34: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 34

Top Sberbank Commands – Task (TaskManager table) in Account D

Exposed Malware Parse.com Accounts

18

22

37

59

4956

PAY TEL

REQUEST

TRANSFER

INFO

BALANCE

Page 35: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 35

Top Sberbank fraud responses – Task (TaskManager table) - Account D

Exposed Malware Parse.com Accounts

26

30

36

75

88

123

607

TRANSFER ASKED

TRANSFER ACCEPTED

TRANSFER PROCESSED

TEL PROCESSED

TEL ASKED

INFO

BALANCE

Page 36: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 36

Unique Device IDs per table

Exposed Malware Parse.com Accounts

Page 37: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 37

Responsible Disclosure

2015-08-03: Reported finding to Facebook

2015-08-05: Facebook replied with “... This issue

does not qualify as a part of our bounty program...“

2015-08-05: Facebook asked for more details

2015-08-06: We provided more details and Facebook

blocked all Parse accounts

2015-08-28: Facebook offered room for collaboration

Facebook‘s responsible disclosure system only works

with a Facebook account

Page 38: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 38

Conclusions

• Android Banking Trojans stores and exposes its data in BaaS solutions

• By default no authentication is needed to access BaaS data

• Android Banking Trojans are actively performing financial fraud via SMS.

• In less than a month, thousands of people were victims of financial fraud

Page 39: “We know what you did this summer” - Rasthofer · “We know what you did this summer” Android Banking Trojans Exposing Its Sins in The Cloud Siegfried Rasthofer (TU Darmstadt

3.12.2015 | AVAR 2015 | 39

Siegfried Rasthofer

Secure Software Engineering Group

Email: [email protected]

Blog: http://sse-blog.ec-spride.de

Website: http://sse.ec-spride.de

Twitter: @CodeInspect

Carlos Castillo

Intel Security

Email: [email protected]

Twitter: @carlosacastillo