Top Banner
Reversing banking trojan: an in-depth look into Gataka Jean-Ian Boutin ESET
39

Boutin reversing banking trojan. an in-depth look into gataka

Feb 19, 2017

Download

Documents

DefconRussia
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Boutin   reversing banking trojan. an in-depth look into gataka

Reversing banking trojan: an in-depth look

into Gataka

Jean-Ian Boutin

ESET

Page 2: Boutin   reversing banking trojan. an in-depth look into gataka

Outline

• Background

• Architecture

• Overview of plugins

• Network Protocol

• Webinject

• Campaigns

Page 3: Boutin   reversing banking trojan. an in-depth look into gataka

Background

Page 4: Boutin   reversing banking trojan. an in-depth look into gataka

Origins

• Aliases: Tatanga, Hermes

• First publicly discussed in 2011 by S21Sec

• Targets mostly European users

Page 5: Boutin   reversing banking trojan. an in-depth look into gataka

What is it?

• Banking trojan

• Designed to steal all kind of sensitive information through Man-

In-The-Browser scheme

• Regionalized

• Not very wide spread

• Developped in C++

• Modular architecture similar to SpyEye

• Very verbose, a lot of debug information are sent to Command and

Control Server.

• Frequent update with new plugins and plugin versions.

• Several advanced features

Page 6: Boutin   reversing banking trojan. an in-depth look into gataka

Geographic distribution of detection

Page 7: Boutin   reversing banking trojan. an in-depth look into gataka

Business model

• This is not a do-it-yourself kit like

SpyEye

• It seems that this kit is private or sold

only to selected groups

• Infection vector

• BlackHole

• Malicious attachment

Page 8: Boutin   reversing banking trojan. an in-depth look into gataka

Basics

Page 9: Boutin   reversing banking trojan. an in-depth look into gataka

DEMO1

Page 10: Boutin   reversing banking trojan. an in-depth look into gataka

Installation

• Infection vector • BlackHole • Malicious attachment

• Installation • Injection in all processes

• Communications done through IE

Page 11: Boutin   reversing banking trojan. an in-depth look into gataka

Persistence

Page 12: Boutin   reversing banking trojan. an in-depth look into gataka

Architecture

Page 13: Boutin   reversing banking trojan. an in-depth look into gataka

Modular Architecture

• HermesCore • Communicate with C&C • Ability to launch downloaded

executable

Page 14: Boutin   reversing banking trojan. an in-depth look into gataka

DEMO2

Page 15: Boutin   reversing banking trojan. an in-depth look into gataka

Interceptor

Page 16: Boutin   reversing banking trojan. an in-depth look into gataka

Interceptor

• Supported browsers • Firefox • Internet Explorer • Opera • Maxthon

• Frequent update to support latest browser versions

Page 17: Boutin   reversing banking trojan. an in-depth look into gataka

Communication can now be monitored

• NextGenFixer • Install filters on particular

URLs • Webinject

• Inject html/javascript • Record videos/screenshots

• HttpTrafficLogger • Log selected communications

to/from specific websites • CoreDb

• Stores information received from C&C

Page 18: Boutin   reversing banking trojan. an in-depth look into gataka

DEMO3

Page 19: Boutin   reversing banking trojan. an in-depth look into gataka

IEXPLORE – certificate patching

Page 20: Boutin   reversing banking trojan. an in-depth look into gataka

Network Protocol

Page 21: Boutin   reversing banking trojan. an in-depth look into gataka

Topology

Compromised hosts C&C Proxy servers

Page 22: Boutin   reversing banking trojan. an in-depth look into gataka

Packet Decomposition

TCP/IP Header

Gataka Header

Encrypted Data

Gataka Header

Encrypted Data

Packet 1

Packet n

Page 23: Boutin   reversing banking trojan. an in-depth look into gataka

C++ Reversing

• Some basic suff

• This pointer usually passed in ecx

• In object, vtable is at first offset

Page 24: Boutin   reversing banking trojan. an in-depth look into gataka

DEMO4

Page 25: Boutin   reversing banking trojan. an in-depth look into gataka

Gataka header

0-7 8-15 16-23 24-31

Magic Number

NW Protocol Byte mask

Use xor key dword1

dword2

Data size

Uncompressed Data Size

XOR key

dword6

dword7

checksum

dword9

Bot Id (64 bytes)

• When packets are

received from C&C,

dword9 is optional

and Bot Id is absent

Page 26: Boutin   reversing banking trojan. an in-depth look into gataka

Send packet - log

Page 27: Boutin   reversing banking trojan. an in-depth look into gataka

Plugins Storage

Page 28: Boutin   reversing banking trojan. an in-depth look into gataka

Webinject

Page 29: Boutin   reversing banking trojan. an in-depth look into gataka

CoreDb

Page 30: Boutin   reversing banking trojan. an in-depth look into gataka

Webinject

Page 31: Boutin   reversing banking trojan. an in-depth look into gataka

Self-contained webinject

Webinject contained in DB

Webinject downloaded from external server

Injected content

Page 32: Boutin   reversing banking trojan. an in-depth look into gataka

Webinject – Gataka platform communications

Page 33: Boutin   reversing banking trojan. an in-depth look into gataka

DEMO5

Page 34: Boutin   reversing banking trojan. an in-depth look into gataka

Campaigns

Page 35: Boutin   reversing banking trojan. an in-depth look into gataka

Germany – statistics from one campaign

72,92%

25,10%

1,51% 0,25% 0,17%

0,05%

Germany

Unresolved/Unknown

United States

Israel

Sweden

Canada

Total Hits: 248,468

• These statistics were obtained

from a C&C

• Almost 75% of

compromised hosts in

Germany

Page 36: Boutin   reversing banking trojan. an in-depth look into gataka

Germany – Two factor authentication bypass

Image sources: wikipedia.org and postbank.de

Page 37: Boutin   reversing banking trojan. an in-depth look into gataka

Netherlands

Page 38: Boutin   reversing banking trojan. an in-depth look into gataka

Conclusion

Page 39: Boutin   reversing banking trojan. an in-depth look into gataka

Thank You! Questions ?