Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers:...

58
Agenda 1

Transcript of Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers:...

Page 1: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

Agenda1

Page 2: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

Agenda

1. Technical Reversing of Vawtrak V2

2. Network insights into Vawtrak v2

3. Q&A

2

Page 3: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root[~]# whoami

Raashid BhatLabs Analyst

@Blueliv http://linkedin.com/Company/blueliv [email protected]

[email protected]

• Malware Reversing

Victor AcinLabs analyst

• Penetration testing

• Malware reversing

[email protected]

https://es.linkedin.com/in/victor-acin

Page 4: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

Technical Reversing

Vawtrak V2

Page 5: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

• Vawtrak and Introduction banking trojans

• Campaing history

• Vawtrak technical internals

l Default Packer

l Technical Architecture

l C2 Communication and encryption

l Vawtrak Modules

l Web injects

l DGA

Page 6: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak and Introduction banking trojans

• What are Banking trojans?

l Man in the middle

l Configurable

l Modular

l decentralised

• Vawtrak earlier known as neverquest

• Top 5 banking trojans

Page 7: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Campaign history

• Earlier known as neverquest

• Neverquest v1 observed around November 2013

• Neverquest v2 observed September 2015

Page 8: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

Vawtrak technical internals

Page 9: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak technical internals : Default Packer

• LZMAT compression (aplib earlier versions)

• 32bit and 64bit executables

• Xor Encoded using LCG

• Implements a small PE loader

• Uses heavens gate for switching between 32bit and 64bit

• Encoded strings

Page 10: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak technical internals : Technical Architecture

Page 11: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak technical internals : Technical Architecture

• Static Configuration(shellcode based)

l Command and control servers

l Botnet Configuration eg ProjectID , UpdateVersion , TorAddress, etc

l URL resources

l Sign Keys to verify module integrity

l Botnet ID represents each bot in vawtrak network

l Botnet ID generated from C drive VolumeID and adaptor MACID

l

Page 12: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak technical internals : Technical Architecture

• Static Configuration Extraction

l

Page 13: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak technical internals : Technical Architecture

• Base injection in explorer.exe/iexplore.exe followed by injection in child

processes

l

Page 14: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak technical internals : Technical Architecture

• Namespaces generation

• Filepaths , registry storage and other UID 's

• Generation using LCG initial seed

l

Page 15: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak technical internals : Technical Architecture

• Crash loging feature and Debug loging features

• Any executable crashes are send to c2 using minidump API

• Namespace #3 is generated for a debug file map

• All steps during runtime are logged

l

Page 16: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak technical internals : Technical Architecture

• Ring-3 rootkit for persistance in between processes

• CreateProcessesInternalW()

• Hook retrives PID and injects Vawtrak code in that particular process

l

Page 17: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak technical internals : Technical Architecture

• IPC communication mechanism

• Communication and data transfer between master process and child

processes

• Global Memory mapped file object

• int __stdcall IPCHandler(unsigned __int16 ProcID, int opcode, const void

*buff, DWORD bufflen)

Page 18: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak technical internals : Technical Architecture

• Opcodes are represented using an index number

• Currently 41 opcodes implemented( excluding plugins )

• Opcode 25 represents RetriveFolderPath(namespaceID)

l

Page 19: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

C2 Communication and encryption

Page 20: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall C2 Communication and encryption

• Http/https based (initial packet)

l

Page 21: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall C2 Communication and encryption

• Random 32byte session id generated which is used as an RC4 key

• This key is stored in phpsessionid cookie

l

Page 22: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall C2 Communication and encryption

• Response is lzmat compressed and LCG encoded

• Webinjects are furthermore encoded using sbox subtitution

• Response consists multiple sections and opcodes

l

Page 23: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak Modules

• Modular trojan

• Plugins provide an opcode/ API interface

• Currently implements 7 plugins

• Plugins

l Web inject plugins (MITM )

l Pony trojan based stealer

l Back Connect Module to Tunnel traffic though victims module

l Keylogger

l Certificate ,history Stealer and A fileManger

l

Page 24: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Web injects

• A configuration for web inject plugin to perform MIMT

• Consists of multiple section

l

l

Image source : Sophos

Page 25: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Web injects

• Web inject Example

l

l

Page 26: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

Domain Generation Algorithm

Page 27: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Domain Generation Algorithm

• Updated supplied on 28 july 2016

• Domains generated using an initial DWORD supplied to DGA

• Implements SSL pinning to verify domains

l

Page 28: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

Network insights into

Vawtrak v2

Page 29: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Summary29

Page 30: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Summary – bot infection information30

OS of the infected botsCountries of the infected bots

Page 31: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Summary – botnet snapshot31

Page 32: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Modus operandi32

Page 33: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Modus operandi33

Page 34: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

Moskalvzapoe

Page 35: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Modus operandi 35

Mailing distribution

Page 36: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Moskalvzapoe 36

Page 37: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

37root [~]# wall Moskalvzapoe

• AutoOpen: Runs when the Word document is opened

• Auto_Open: Runs when the Excel workbook is opened

• Workbook_Open: Runs when the Excel workbook is

opened

• Open: Opens a file

• Shell: Runs an executable file or system command

• CreateObject: Creates an OLE object

• Chr: May be used to obfuscate specific strings

• Environ: Reads the system environment variables

Page 38: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

38root [~]# wall Moskalvzapoe

Offset Description

0x14D5 PNG image, 640 x 280, 8-bit/color RGBA, non-interlaced

0x14FE Zlib compressed data, best compression

0x5053 Microsoft executable, portable (PE)

0x3687 EZip archive, uncompressed size: 540, name: [Content_Types].xml

0x369A EZip archive, uncompressed size: 310, name: _rels/.rels

0x36A97 Zip archive, uncompressed size: 138, name: theme/theme/themeManager.xml

0x36B54 Zip archive, uncompressed size: 6846, name: theme/theme/theme1.xml

0x37278 Zip archive, uncompressed size: 283,name: theme/theme/_rels/themeManager.xml.rels

0x374D0 End of Zip archive

0x374E6 XML document, version: "1.0"

Binwalk:

Page 39: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Moskalvzapoe39

Loaders web interface

Page 40: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Modus operandi40

C&C Communication & Data Exfiltration

Dropped Trojans

• Mailer: SendSafe to spam other users

• Mail Gathering: sample that grabs PST files and sends it to C2

• Loader & Grabber: Pony Trojan

• Trojan Banker: Vawtrak with different types of DLL modules

Page 41: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

Other distribution methods

Page 42: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Other distribution methods 42

Page 43: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

Vawtrak Group

Page 44: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak group: infrastructure44

• C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the

necessary configurations.

• Support Servers: Contains the modules and updates for Vawtrak.

• Automated Transfer Systems (ATS): Allows the attackers to obtain additional

information from the victim, as well as to automatically manage the modified bank

transfers of the infected host.

Page 45: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak group: infrastructure45

C&C (C2) servers

• BotID (bot identifier): calculated using the storage device serial number

• ProjectID: a numerical value that allows the C2 to identify the target URLs for this infection

• Example:

• ProjectID: 18

• Version: numeric values that identify the major version, minor version and the update version

• Example:

• Major version: 2

• Minor version: 13

• Update version: 12

• Host-related information: the Trojan sends information about the infected machine

• Hostname

• Configured proxy

• Language of the OS

• Vawtrak installed plug-ins (if there aren´t any, a list of the running process)

Config Resources

/api/posts

/data/feeder

/extended/info

/feeds/client.dll

/forums/index.php

/img/i.gif

/input/stream

/news/feed

/post/data

/project/i.gif

/rss/feed/stream

/stats/main

/Work/new/index.php

Page 46: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak group: infrastructure46

Support Servers

Page 47: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak group: modules47

• Webinjects: uses the injects configuration to steal information or modify the

communications, performing man-in-the-browser (MITB)

• Keylogger: extends the functionality to allow Vawtrak to log user’s keystrokes

• Pony: module deployed to steal credentials from a wide range of applications

• Backconnect: allows the attackers to control infected host remotely

• Data harvester: module used to collect cookies, browsing history and certificates. File

extraction

Page 48: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak Trojan: how it works 48

Page 49: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak Trojan: how it works49

Page 50: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak group: ATS50

Automated Transfer Systems (ATS)

• Type 1

• Format:

• http://SERVER/?c=<command>&r=<target>&b=<bot_info>&d=<dump>

• Type 2

• Most common type

• Usual Format:

• http://SERVER/DIR/<target-site-request>

• Example:• https://1024bitsecurity.com/fakes/bankline.rbs.com/CWSLogon/logon.do?<parameters>

Page 51: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak Trojan: ATS / webinjection51

Page 52: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak Trojan: ATS/ webinjection52

Page 53: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak Trojan: ATS/ webinjection53

ProjecIDs: Allowed us to identify different campaigns and thus different targets per sites

per campaign.

Page 54: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

root [~]# wall Vawtrak report54

Page 55: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

https://community.blueliv.com

[email protected]

Page 56: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.
Page 57: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

THANK YOU

www.blueliv.com

[email protected] @blueliv linkedin.com/company/bluelivwww.blueliv.com

Page 58: Agenda - Botconf 2020 · root [~]# wall Vawtrak group: infrastructure 44 •C&C (C2) servers: Manages the actions that the Trojan has to carry out as well as the necessary configurations.

© 2015 Leap In Value S.L. All rights reserved.The information provided in this document is the property of Blueliv, and any modification or use of all or part of the

content of this document without the express written consent of Blueliv is strictly prohibited. Failure to reply to a request

for consent shall in no case be understood as tacit authorization for the use thereof.

Blueliv ® is a registered trademark of Leap In Value S.L. in the United States and other countries. All other brand names,

product names or trademarks belong to their respective owners.

58