+ All Categories
Home > Documents > Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in...

Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in...

Date post: 15-Sep-2018
Category:
Upload: doankiet
View: 220 times
Download: 0 times
Share this document with a friend
40
Dynamic profiles for malware communication Joao Marques, Mick Cox MSc System & Network Engineering University of Amsterdam Monday 6 February, 2017
Transcript
Page 1: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Dynamic profiles for malwarecommunicationJoao Marques, Mick Cox

MSc System & Network EngineeringUniversity of Amsterdam

Monday 6 February, 2017

Page 2: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Outline

Introduction

Part I - Intrusion Detection

Part II: Botnets & Advanced Persistent Threats

Part III: Research Outline

Part IV: Intelligent Malware

Part V: Possible Countermeasures

Discussion, Conclusion & Future Work

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 2

Page 3: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Introduction

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 2

Page 4: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Some contextHosting organization

Organization:

• Company: Deloitte Amsterdam

• Department: Cyber Risk Services

• Unit: Red team

Supervisor:

• Cedric van Bockhaven (OS3 alumnus)

Notable other:

• Joey Dreijer (OS3 alumnus)

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 3

Page 5: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Research QuestionThe goal

Is it possible to construct a dynamic network profile betweena Command & Control server and the beacon, which is undetectable by

state-of-the-art detection frameworks?

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 4

Page 6: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Intrusion DetectionA brief taxonomy

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 5

Page 7: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Intrusion DetectionDefinition

Intrusion Detection & Prevention Systems in short:

• Collect data from the network or host

• Validated by a detection engine

• Reports if it suspects an intrusion

• Acts (isolates, shuts down) if it supports prevention

Figure 1: Simplified Snort 2 Architecture

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 6

Page 8: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Intrusion DetectionNetwork, DNS and Host-based

Network Based IDS (NIDS)

• Data collection from network(packets)

• Sensors in the network tovalidation engine

• Few sensors can capture alltraffic

• Open source systems includeSnort, Suricata and Bro

Host Based IDS (HIDS)

• Data collection from hostsystems (system metrics, usage)

• Agent on the host to validationengine

• Every agent needs agent tocover the network

• Open source systems includeOSSEC, Tripwire

Others proposed types include DNS based, Storage based, Wireless,Hybrid, and more.

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 7

Page 9: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Intrusion DetectionMethods

Signature based IDS

• Based on predefined rules(malicious usage)

• Mostly pattern matching

• Generally unable to detect0-days

• High true positive and falsenegative

Anomaly based IDS

• Based on training set (normalbehavior)

• Mostly machine learning

• Detects deviations from normalbehavior (anomalies)

• High false positives and truenegative

Signature or anomaly based detection exists across the location(Host/Network)

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 8

Page 10: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Intrusion DetectionValidation engine

Rule Header

• Rule Actions (Alert, log, pass, activate, dynamic . . . )

• Protocols (TCP, UDP, ICMP, . . . )

• IP address / Port and direction

• Activate and dynamic rules

Rule Options

• General (msg, classification, . . .)

• Payload (content, length, depth, distance , . . .)

• Non Payload (fragoffset, ttl, flags, . . .)

• Post-Detection (logto, react, replace, . . .)

Dynamic modules and preprocessors

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 9

Page 11: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Intrusion DetectionExample rule

An example for matching content:

alert tcp any any -> any 139 (content:"|5c

00|P|00|I|00|P|00|E|00 5c|";)

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 10

Page 12: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Botnets &Advanced Persistent Threats

A brief taxonomy

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 11

Page 13: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Botnets & Advanced Persistent Threats

Botnets in short:

• A botnet is a network of infected computers, called bots

• Bots communicate with a Command & Control server, mostly over:

• Communication is common over HTTP(S), IRC or P2P systems

• Communication system on the bot is called a beacon

Advanced Persistent Threats in short:

• Targeted attack by a determined attacker

• Government or organizational funding

• Often utilizing botnets

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 12

Page 14: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

BotnetsArchitecture

Different architectures between C&C’s to bots exist:

• Centralized: fast convergence, single point of failure

• Decentralized: resilient but slow convergence

• Hybrid: best of both

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 13

Page 15: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

BotnetsThe whole process

In summarization: most attacks do follow the following process.

1. Malware is distributed, often over multiplechannels

2. Host gets infected by exploiting avulnerability and downloading the malwareas a result

- Downloads the main executable/script- Main script downloads necessary libraries

3. Reports to C&C

4. Communicates frequent keepalive to C&C

5. Execution of commands

6. Self replicates (optional)

7. Self destructs (optional)

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 14

Page 16: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

BotnetsDetection techniques

Figure 2: Botnet detection techniques

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 15

Page 17: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

BotnetsHiding mechanisms

Some of the reported hiding mechanisms include:1

• Multi-hopping (Usage of multiple proxies / gateways)

• Network traffic encryption

• Binary obfuscation

• Code polymorphism

• Fast flux networks (Quickly change DNS)

• E-mail spoofing (for spam)

1Survey and taxonomy of botnet res. thr. life-cycle, Rodrıguez-Gomez et al. (2013)Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 16

Page 18: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Research OutlineInitial plan & the pivot

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 17

Page 19: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Initial plan

Start with exploiting signature based detection.

1. In dept research of signatures & signature based IDS

2. Find a weakness in the Snort 3 engine

3. Does it hold up against anomaly based techniques

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 18

Page 20: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Setup & Experiment

VMware EXSi server atreims.studlab.os3.nlcontains a virtual testenvironment as seen in thefigure bellow:

Figure 3: Test environment

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 19

Page 21: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Some considerationsLeading to the pivot

• Signature are by definition deterministic

• No existing signatures for new malwares, evasion by default• Due to modular design, shortcomings can be patched

• Anomalies are by definition not normal• Normal behavior is defined by a representative data training set.

• Training set context dependent & difficult to collect

• If normal exists =⇒ not normal exists, for every area.

• Mostly theoretical frameworks described in literature• Mostly machine learning . . .

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 20

Page 22: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Intelligent MalwareA proposed framework

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 21

Page 23: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Intelligent MalwareThe concept

Malware that can make an educated guess prior to startingcommunication with the C&C, to avoid using anomalous methods ofcommunication that could end up in the detection of the infection.

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 22

Page 24: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Intelligent MalwareThe objective

The objective of this degree of ”intelligence” is to:

• Hide in plain sight

• Frustrate signature making

• Frustrate anomaly detection

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 23

Page 25: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

System OverviewAssumptions

Basic assumptions:

• Network is monitored by an IDS or an IPS

• Network traffic is being filtered

• There is no HIDS in infected systems

• At least one of the types of communication is being used in theinfected host.

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 24

Page 26: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

System OverviewMalware Operation Method

A vulnerability in the victim is exploited and the payload executed. Themalware gets downloaded and executed. From this point on the malware:

• Sniffs all DNS and SSH traffic of the victim for a limited amount oftime

• Checks if any of the SSH connections initiated in the host

• Checks for specific domain lookups in the DNS traffic

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 25

Page 27: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

System OverviewMalware Operation Method

• Once the sniffing operations is done (timeout) it does an”intelligent” analysis of the acquired information

• Downloads the module it requires to run that type of communication

• Starts communicating with the C&C that is listening on all types ofcommunication

• if no suitable method of communication is found it deletes itself in asecure manner to prevent/hinder the creation of signatures

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 26

Page 28: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

System statusFunctionality Implemented

• Host Identification - Implemented

• Network Sniffing - Implemented

• Decision Making - Partially Implemented

• Modular Communication - Not Implemented

• Self Deletion - Not Implemented

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 27

Page 29: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Possible CountermeasuresAgainst a smart and dynamic malware

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 28

Page 30: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

SecurityUsability trade-off

Enforcing heavy restrictions on users

• Anomaly detection on the initial download

• Restricting even very known and popular services. like Dropbox

• The usage of network services and applications outside of the normalpatterns

• Less freedom implies stricter patterns, anomalies will be easier to

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 29

Page 31: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Host Based Intrusion DetectionDefined yet again

In essence, what are HIDS?

• Agent on the client

• Central logging server to which it reports

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 30

Page 32: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Host Based Intrusion DetectionAnomaly based System Profiling

Checks for metrics and performance indicators

• Workload

• Traffic

• Logs

• Can be configured to send to the server anything...

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 31

Page 33: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Host Based Intrusion DetectionAnomaly based User Profiling

Anomaly based user profiling can be done on the basis of:1

• Psychometrics (intelligence,decisions)

• Behavioral biometrics

• Examples: System and networkusage, keystroke analysis,commands, lexical andsyntactic features.

Frequent or continuous (re)training of the training set is required, riskingan attacker can over time manipulate the profile away from the genuineuser.

1User Profiling in Intrusion Detection, Peng et al. (2016)Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 32

Page 34: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Host Based Intrusion DetectionWould it work?

The good:

• A vast amount of information that can be used to detect out ofordinary operation

• Enables a well managed network to separate any anomalous devicefrom the network

The bad:

• Creates a lot of logs!

• Possibly a high amount of false positives

• impossible to scale

The ugly:

• An immense Administrative burden

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 33

Page 35: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Host Based Intrusion DetectionLog analysis

Actually already other systems, but for convenience listed here.Difficult to disable logging. Some options do exist:

• Security information and event management (SIEM)

• System iNtrusion Analysis and Reporting Environment (SNARE)

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 34

Page 36: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

CorrelationCombining the previous

Correlates multiple information sources: HIDS, NIST, signature andanomaly, both in log or metrics. Cross reference them to reduce falsepositives.

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 35

Page 37: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

CorrelationWould it work?

The good:

• Cross referencing anomaly based detection, removing false positives

• Working towards an omniscient system

The bad:

• Creates a lot of logs!

• Probably a lot of false positives

• Development can be very complex

The ugly:

• Big brother becomes a bit bigger

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 36

Page 38: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Discussion, Conclusion &Future Work

Dealing with heuristics

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 37

Page 39: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Discussion & ConclusionBridging the gap

Intrusion Detection: looking for a needle in the haystack, involvesheuristics

Furthermore, evasion against signature based systems is by default andanomaly is not yet that effective due to large rate of false positives.

In order to uncover some of the advanced communication methods suchas advanced covert channels and side channel attacks, misusing currentapplications and protocols to hide in plain sight, developing such tools isneeded.

With our proposed system we hope to contribute to the advancement ofsuch research.

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 38

Page 40: Dynamic pro les for malware communication - OS3 · Botnets & Advanced Persistent Threats Botnets in short: A botnet is a network of infected computers, called bots Bots communicate

Future workFor better understanding

In regards to the proposed framework

• Advanced reconnaissance features can be build into the frameworkto make its decision more reliable and therefore evasive

• More advanced modular beacons are needed for wider usage

• In reaction, the defensive side (blue team) can then make an effortin actual

(Maybe OS3 students can do their RP2 on advanced and stealthy covertchannels and side channel attacks.)

Joao Marques & Mick CoxDynamic profiles for malware communication (Research Project)MSc System & Network Engineering, University of Amsterdam 39


Recommended