botnets and machine learning - dca-wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/botnets_and... ·...

61
./botnet

Upload: others

Post on 18-Aug-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

./botnet

Page 2: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Summary • Introduction • Scrutiny • Detection Techniques • Evasion Techniques • Botnet Analysis Example • Defense techniques • Challenges • Trends • My Proposals • Motivation

Page 3: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Introduction

• Botnets has become the worst threat for Internet

• Malwares are bad applications that compromise machines – They are the pillar of the botnets actions

• Detect and stop botnets is a big challenge for security researchers

Page 4: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

~/Scrutiny

Page 5: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Scrutiny

• Definition – Botnets is a group of compromised host machines known

as “bots”

– They are controlled remotely by one or more unauthorized user known as “botmasters”.

» Bot malware is a state of the art malware class

» They have the ability to communicate with an attacker trough a specially deployed Command and Control communication channel (C&C).

Page 6: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Scrutiny

• Potential damage – It has created a perfect environment for the dissemination, infection and

formation of botnets • Large number of machines connected to the Internet through full-time broadband links

• Substantial system vulnerabilities

– Difficult to estimate the size and the number of botnets that exist currently

– Some of malicious activities botnets implement are:

DDoS Illegal content distribution

Malware and Adware distribution Attacks on industrial control system

Click fraud Collecting of confidential information

Page 7: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Botnets Scrutiny – 2/7

Page 8: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Scrutiny • Botnet components

– Bots • Vulnerable machines compromised with malicious software

disseminated by a botmaster through a propagation mechanism

• They are known as “zombies” or “slaves” • Can be used as attacking platforms:

– Other vulnerable hosts – Carry out DoS/DDoS – Other malicious activities

Page 9: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Scrutiny

• C&C

– This is the difference between botnet malwares and others malwares attacks

– Enable remote coordination of a large number of bots

– Allow flexibility to change and update malicious botnet code

– It is also the most important indicator of botnet

Page 10: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Scrutiny

Page 11: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Scrutiny

• Architectural Designs (according to C&C)

Detection and disarticulation easy difficult

Page 12: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Scrutiny

• Botnet Life-cycle

1 - Infection

2 - Communication

3 - Attack

Page 13: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Detection Techniques

~/Detection_Techniques

Page 14: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Detection Techniques – Honeynets/honeypot

• Used to collect information from bots • Allow to get bot binaries and infiltrate botnets • Help to understand botnet characteristics

– Intrusion Detection Systems (IDS) • Signature-based

– Apply signatures of previous detected botnets to detection systems

• Anomaly-based – Host-based – Network-based

Page 15: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Honeynet-based

Intrusion Detection Systems

Signature-based

Anomaly-based

Host-based

Network-based

Active Monitoring

Passive Monitoring

IRC DNS SMTP P2P Multiporpose

Detection Techniques

Page 16: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Detection Techniques • Host-based

– Analyze the machine behavior • Looking at

– System registry – File system – Network connections

• Log files analysis

– Advantage

• They are much more effective against donwload attacks and onset infections in general

– Disadvantage

• Performing individual machine analysis and monitoring them is a complex costly and non-scalable task

Page 17: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Detection Techniques

• Network-based – This is the most used method currently

– Some techniques are specifically created for some protocols

• IRC or/and HTTP or/and P2P

– Others try to be more generic, involving multiple protocols and architectures

• All protocols

– Two methods • Active and passive monitoring

Page 18: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Detection Techniques • Active monitoring

– Try inject packets to get the behavior of response – Invasive method

– Advantage:

• The response time to detect malicious agents

– Disadvantage:

• Increase network traffic with additional packets sent to suspecious machines

• The packets injection facilitates detection tracking tools • May be subject to legal issues

Page 19: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Statistic approaches Traffic mining Visualization Graph theory Clustering Correlation Stochastic methods Entropy Decision trees

Neural networks Discrete Fourier transform CUSUM Machine learning Discrete time series Group analysis Combination of techniques

Detection Techniques

• Passive monitoring – Observe data traffic in the network and look for suspecious

communications (from bots and C&C servers)

– Employs a myriad of different techniques and methods:

Page 20: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Detection Techniques

A log from botnet Citadel

Page 21: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Evasion Techniques

~/Evasion_Techniques

Page 22: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Evasion Techniques

• Stealthy malware:

– botnets are hard to detect because their activities can be subtle and do not disrupt the network (in contrast to DDoS attacks and aggressive worms)

• Several techniques: – Tunneling through HTTP, ICMP, VoIP, and IPv6; fast-flux service

networks (FFSN); changes in statistical patterns; using dynamic DNS entries; encrypted traffic, assigning different tasks to bots in the same network, randomizing bot communication patterns

Page 23: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Evasion Techniques

• Developing new evasion techniques leads to developing new detection techniques – It creates a conflict between attackers and defenders

• Example – Initial detection techniques

• payload inspection – this techniques is no longer effective

– To defeat, bots evolved and employed cypher algorithms

Page 24: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Evasion Techniques

• Fast-flux service networks (FFSN) – It is also known as fast-flux domain

– “Fast-flux” = “rapid change”

– DNS technique used to hide phishing and malware delivery sites behind an ever-changing network of compromised hosts acting as proxies • Low TTL

• Similar characteristics to legitimate services as Round Robin (RRDNS) and Content Delivery Network (CDN)

Page 25: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Evasion Techniques

Page 26: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

~/Botnet_Analysis_Example

Page 28: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Botnet Analysis Example

• Win32/Atrax.A is a TOR-based backdoor family

• Downloader

– Win32/TrojanDownloader.Tiny.NIR

Page 29: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Botnet Analysis Example

• The hardcode domain was registered in the middle of June, 2013 – To bypass the detection systems as itself off as PayPal Customer

Service

• Yet, all trojan components and the downloader binary were compiled in July

Page 30: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Botnet Analysis Example

• After download the decompress routine is started for three PE modules via WinAPI function RtlDecompressBuffer() – TOR client

– DLL module x86

– DLL module x64

Page 31: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Botnet Analysis Example

• Before installation the dropper makes simple checks – If it is on a virtual machine

– If exists any debugger activity

Call graph for the routines that infect

the machine

Page 32: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Botnet Analysis Example • This routine tries during the last stages of execution to search for the

initialization of additional AES-encrypted plugins in the %APPDATA% directory

• All plugins are named according to the following pattern: %APPDATA%\CC250462B0857727*

• Plugins are decrypted on the fly during the bot initialization process but the encryption key depends on the infected machine

• This approach to plugin encryption makes it difficult to extract information during the forensic process

Page 33: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Botnet Analysis Example • The TOR client is embedded into the dropper executable and stored in

the %APPDATA% directory as an AES-encrypted file

• Initialization of the TOR connection takes place after checking for an active browser process and injection of TOR client code into the browser process byNtSetContextThread()

• Win32/Atrax.A supports code injection techniques for x86 and x64 processes.

Page 34: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Botnet Analysis Example • C&C Communication

– A special HTTP request function call

If the second parameter request_via_tor setup is in the TRUE state all communications will be initialized by the TOR client TOR communications call graph:

Page 35: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Botnet Analysis Example • After execution a new thread with the Tor client software will be set up

using

– AUTHENTICATE – password for authentication

– SIGNAL NEWNYM – change proxy-nodes chain

• During the first connection

Page 36: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Botnet Analysis Example • It isn’t possible to ascertain the original C&C IP address or domain with a

TOR enabled connection but it is possible to use the address generated in the TOR network for analysis

• After played a little bit with the internal address in the TOR network

Page 37: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Botnet Analysis Example • Win32/Atrax.A supports the execution of

remote commands – dlexec – download and execute file

– dlrunmem – download file and inject it to browser

– dltorexec – download TOR executable file and execute

– dltorrunmem – download TOR executable file inject it to browser

– update – update itself

– install – download file, encrypt with AES and save to %APPDATA%

– installexec – download file, encrypt with AES and save to %APPDATA% and execute afterward

– kill – terminate all own threads

Page 38: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Botnet Analysis Example • Once known the structure of remote commands and execution algorithm it

is possible to simulate a real bot and try to communication with the C&C

• The author received two plugins

- A Form Grabber - A PASSWORD STEALER

Researchers continue to track activities for Win32/Atrax.A

Page 39: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

~/Defense_Techniques

Page 40: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Defense Techniques • They are focused on two main activities:

– Propagation • Aim to reduce the vulnerable population, limit the worm spread and

reduce the botnet size

– Bot communication • Stop the commands from botmaster

• Cover three main areas:

– Prevention => act to avoid hosts vulnerabilities – Treatment => act to disinfect the compromised hosts (scalability and time

problem) – Containment => detection and response

Page 41: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Defense Techniques

• Containment mechanisms

– Detection and reaction time

– Strategy used to identify and contain bots

– Solution by topology and scope

– All approaches just block the botnets actions, but they haven’t applied the disinfection

Page 42: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

~/Challenges

Page 43: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Challenges

• Researchers do not have the same facility of botmasters to access hosts in various domains around the world – Detailed information are considered secret for

administrative domains

– Network traces main contain sensitive information

• It is treated like information plutonium

Page 44: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Challenges

• Researchers can only generate botnet synthetic traces for their experiments (academic networks) – Academic networks do not reflect the reality

of heterogeneous networks

– The performance of a detecting bot method can be overestimated when applied to a particular network scenario

Researcher

Page 45: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Challenges • Synthetic traces generation (to model

botnet behavior) – Epidemiological models

• attempt to compare malware and virus spreads in populations

– Stochastic Activity Network (SAN) models • generate a set of interconnected states that the

host follows after its infection • Each state transition probability is defined in

advance • It may not be considered a universal solution

– SANs have some limitations for modelling complex and large-scale systems

Page 46: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Challenges

• How estimating how much a novel detection technique enhances overall botnet detection?

– There is not a methodology or benchmark to do a quantitative comparison

• Pervasive privacy concerns

• Difficult of data sharing

Page 47: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Challenges

• Botnets are widespread in a distributed environment

– It can involve several countries

• It is necessary agreements between countries

– Coordination and consistence against cyber-crimes

• User education about botnet threats – Software vendors should make more efforts to increase

their product’s security and the update/patch processes

Page 48: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Challenges • ISP actions

– Apply/improve ingress and egress filtering – Blocking inbound/outbound malicious users connections

• Allow to block the C&C communication • Adequately deal with the legal aspects such as privacy

• New algorithms to hijack botnets

– It also leads to legal issues but it can generate security concerns about the botnet monitoring importance to avoid potential privacy issues

Page 49: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Challenges

• In a general vision: – Development of efficient detection techniques

– Derive ways to dismantle botnet’s infrastructures

– Understand the new botnets trends

– Discussing legal international issues in a global botnet countermeasures effort

Page 50: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

• Super-botnet

– Many smaller botnets

– Commands are routed to each other

– Collectively achieve the same results as a large botnet

• High resilience

./Im_watching_you.sh

~/Trends

Page 51: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Trends

New opportunities

for botmasters

Page 52: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Trends

Internet of Things Vs

Internet of Vulnerabilities

Page 53: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

• Botnets in mobile devices – Research is just beginning in this area

– High potential to compromise services

– It is not possible to apply the ISPs security measures because mobile devices connect to unknown wireless networks

– There is a lack of certification for applications created and placed in repositories by programmers

Trends

Page 54: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

• Socialbot network (SbN)

– Botmasters have exploited social network websites to behave as their C&C infrastructures.

• Difficult to distinguish the C&C activities from normal social networking traffic

• Examples:

– Koobface, Nazbot

Trends

Page 55: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Trends

• Mini-botnets

– Small-scale

– Highly specialized

– Used for information thefts

– Few information is generated during attacks

Page 56: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Trends

• Super-botnet

– Many smaller botnets

– Commands are routed to each other

– Collectively achieve the same results as a large botnet

• High resilience

Page 57: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Trends

./Im_watching_you.sh

Page 58: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Trends

./Im_watching_you.sh

Page 59: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Trends

./Im_watching_you.sh

Page 60: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Trends

./Im_watching_you.sh

Page 61: Botnets and Machine Learning - DCA-Wikicalhau.dca.fee.unicamp.br/wiki/images/c/ca/Botnets_and... · 2015. 7. 15. · trough a specially deployed Command and Control communication

Trend

• Random model C&C – The communication starting is done by

botmasters

– Network scan-based • A problem in the scalability coordination

– Model for future botnets to be more resilient • No modus operandi is known by detectors and may

be hard to detect and interrupt

– No real bot currently uses this strategy