The art of sinkholing. Tomasz Bukowski CERT Polska / NASK



Similar documents
Adventures in Cybercrime. Piotr Kijewski CERT Polska/NASK

Report. Takeover of Virut domains

Agenda. Taxonomy of Botnet Threats. Background. Summary. Background. Taxonomy. Trend Micro Inc. Presented by Tushar Ranka

TCP Performance Management for Dummies

Snapt Balancer Manual

Malicious Network Traffic Analysis

Resilient Botnet Command and Control with Tor

WHEN THE HUNTER BECOMES THE HUNTED HUNTING DOWN BOTNETS USING NETWORK TRAFFIC ANALYSIS

Botnets: The Advanced Malware Threat in Kenya's Cyberspace

DNS Resolving using nslookup

VIRUS TRACKER CHALLENGES OF RUNNING A LARGE SCALE SINKHOLE OPERATION

Avalanche Remote Control User Guide. Version 4.1.3

HIDING THE NETWORK BEHIND THE NETWORK. BOTNET PROXY BUSINESS MODEL Alexandru Maximciuc, Cristina Vatamanu & Razvan Benchea Bitdefender, Romania

Multifaceted Approach to Understanding the Botnet Phenomenon

Operation Liberpy : Keyloggers and information theft in Latin America

Network Security Monitoring and Behavior Analysis Pavel Čeleda, Petr Velan, Tomáš Jirsík

Report on Cyber Security Alerts Processed by CERT-RO in 2014

The new frontier of the DATA acquisition using 1 and 10 Gb/s Ethernet links. Filippo Costa on behalf of the ALICE DAQ group

10. Exercise: Automation in Incident Handling

Firewalls. Pehr Söderman KTH-CSC

Workshop on Network Traffic Capturing and Analysis IITG, DIT, CERT-In, C-DAC. Host based Analysis. {Himanshu Pareek,

How To Deploy Sangoma Sbc Vm At Amazon Cloud Service (Awes) On A Vpc (Virtual Private Cloud) On An Ec2 Instance (Virtual Cloud)

Industrial Network Security and Connectivity. Tunneling Process Data Securely Through Firewalls. A Solution To OPC - DCOM Connectivity

DNS (Domain Name System) is the system & protocol that translates domain names to IP addresses.

Zeus Traffic Manager VA Performance on vsphere 4

Load Balancing Bloxx Web Filter. Deployment Guide

ACE Management Server Deployment Guide VMware ACE 2.0

2X SecureRemoteDesktop. Version 1.1

ENEE 757 CMSC 818V. Prof. Tudor Dumitraș Assistant Professor, ECE University of Maryland, College Park

Security workshop Protection against botnets. Belnet Aris Adamantiadis Brussels 18 th April 2013

Exam Questions SY0-401

Critical Security Controls

Firewall. IPTables and its use in a realistic scenario. José Bateira ei10133 Pedro Cunha ei05064 Pedro Grilo ei09137 FEUP MIEIC SSIN

Password Reset PRO INSTALLATION GUIDE

RSA Security Analytics

CS3250 Distributed Systems

Topics in Network Security

Track 2 Workshop PacNOG 7 American Samoa. Firewalling and NAT

Revealing Botnets Using Network Traffic Statistics

How to Make the Client IP Address Available to the Back-end Server

CounterACT 7.0 Single CounterACT Appliance

Linux Firewall. Linux workshop #2.

Computer Networks - CS132/EECS148 - Spring

Arbor s Solution for ISP

Tools for penetration tests 1. Carlo U. Nicola, HT FHNW With extracts from documents of : Google; Wireshark; nmap; Nessus.

A Brief Overview of VoIP Security. By John McCarron. Voice of Internet Protocol is the next generation telecommunications method.

Overview - Using ADAMS With a Firewall

Project 4: IP over DNS Due: 11:59 PM, Dec 14, 2015

Concierge SIEM Reporting Overview

ENABLING RPC OVER HTTPS CONNECTIONS TO M-FILES SERVER

Network Fundamentals Carnegie Mellon University

Recon and Mapping Tools and Exploitation Tools in SamuraiWTF Report section Nick Robbins

UNMASKCONTENT: THE CASE STUDY

2010 Carnegie Mellon University. Malware and Malicious Traffic

Grandstream Networks, Inc. UCM6100 Security Manual

Decoding DNS data. Using DNS traffic analysis to identify cyber security threats, server misconfigurations and software bugs

DOSarrest Security Services (DSS) Version 4.0

Inside the Storm: Protocols and Encryption of the Storm Botnet

ComTrader Technical Requirements. version 1.6

Network Traffic Analysis

D-Link Central WiFiManager Configuration Guide

DOMAIN AND GLOSSARY The phrases and terms you may encounter, when registering a domain name

DNS Footprint of Malware

Evading Infrastructure Security Mohamed Bedewi Penetration Testing Consultant

DEPLOYMENT GUIDE Version 1.1. DNS Traffic Management using the BIG-IP Local Traffic Manager

SonicWALL WAN Acceleration FAQ Document

Integrated Approach to Network Security. Lee Klarich Senior Vice President, Product Management March 2013

OpenFlow with Intel Voravit Tanyingyong, Markus Hidell, Peter Sjödin

Zscaler Internet Security Frequently Asked Questions

Spirent Abacus. SIP over TLS Test 编 号 版 本 修 改 时 间 说 明

How to configure HTTPS proxying in Zorp 5

Integrating the F5 BigIP with Blackboard

Detecting data loss from cloud sync applications

WebStore Guide. The Uniform Solution

Many network and firewall administrators consider the network firewall at the network edge as their primary defense against all network woes.

How To Set Up Foglight Nms For A Proof Of Concept

Detecting Botnets with NetFlow

How to Add Domains and DNS Records

Firewalls with IPTables. Jason Healy, Director of Networks and Systems

How To Get The Most Out Of Your From Your Mail Server (For A Small Business)

Building Your Firewall Rulebase Lance Spitzner Last Modified: January 26, 2000

SANS: The 2010 European Digital Forensics and Incident Response Summit. Retrieving Information... Then what? 8 September Righard J.

Server Installation Manual 4.4.1

Real-Time Analysis of CDN in an Academic Institute: A Simulation Study

ZEN LOAD BALANCER EE v3.02 DATASHEET The Load Balancing made easy

Deploying the Barracuda Load Balancer with Office Communications Server 2007 R2. Office Communications Server Overview.

ReadyNAS Remote White Paper. NETGEAR May 2010

Exchange 2013 mailbox setup guide

Smoothwall Web Filter Deployment Guide

Password Reset PRO. Quick Setup Guide for Single Server or Two-Tier Installation

How To Set Up An Ip Firewall On Linux With Iptables (For Ubuntu) And Iptable (For Windows)

Check Point FireWall-1 HTTP Security Server performance tuning

User Identification (User-ID) Tips and Best Practices

Fasthosts Internet Parallels Plesk 10 Manual

Course Content Summary ITN 261 Network Attacks, Computer Crime and Hacking (4 Credits)

Desktop Central Managing Windows Computers in WAN

Transcription:

The art of sinkholing Tomasz Bukowski CERT Polska / NASK

About WHOIS Name:Tomasz Bukowski (tomasz.bukowski@cert.pl) Works in CERT Polska/NASK 5 years in IRT Fight malware && monitor botnets Linux user and sysadadmin Programmer Member of Dragon Sector CTF team

Introduction

So, you want fight botnets? Botnet lifecycle: 1. write/buy malware 2. write/buy exploit pack 3. buy/hack VPS/hosting for (1) and (2) 4. buy domain for (3) 5. spred malware using exploit pack 6. $ profit $

So, you want fight botnets? Life of security researcher: 1. monitor spam/social media/internets 2. see malware spreding using exploit pack 3. gather samples 4. monitoring / analysis / incubation 5. locate CnC domains 6. locate rest of infrastructure 7. << action required! >>

Fighting botnets... Malware domain takedown: + cut off botmaster from his flock of sheep - devices still infected, no one get noticed Malware domain takeover: + cut off botmaster from his flock of sheep + malware will keep talking to CnC + can gather and share infrmation on infections! make cyberspace better place

Sinkholing

Sinkholing? Sinkholing let me google it for you... Sinkholing is a technique that researchers use to redirect the identification of the malicious command-and-control (C&C) server to their own analysis server. This way, the malicious traffic that comes from each client goes straight to the research box, ready to be analyzed. source: the internet

Sinkholing Scope : global Take over CnC domain Point to researcher box (directly or by nameserver) Doable Need to provide evidence Good will from domain operator (TLD) Take over CnC IP : Hard to do - need persuade IP owner (ISP/Hosting) Take over CnC infrastructure (server) Physicaly takeover Often can be done only by law enforcements

a lot of legislation problems Sinkholing Scope : global Take over CnC domain Point to researcher box (directly or by nameserver) Doable Need to provide evidence Good will from domain operator (TLD) Take over CnC IP : Hard to do - need persuade IP owner (ISP/Hosting) Take over CnC infrastructure (server) Physicaly takeover Often can be done only by law enforcements

source: the internet Sinkholing Local sinkholing (LAN) - redirect CnC traffic: By DNS : local DNS redirection By destination IP: traffic redirection Provide usefull information on infected workstations Especially when you run multi-layered big internal company network

Sinkholing DNS perspective sinkholed 1 IN A?? IN A 1.2.3.4 domena-1.tld IN A IN CNAME sinkhole.cert.pl

Sinkholing DNS perspective sinkholed 1 IN A?? IN A 1.2.3.4 domena-1.tld IN A IN CNAME sinkholed sinkhole.cert.pl 2 IN A?? IN A 1.2.3.4 domena-1.tld IN NS sinkhole.cert.pl

Sinkholing DNS perspective sinkholed 1 IN A?? IN A 1.2.3.4 domena-1.tld IN A IN CNAME sinkholed sinkhole.cert.pl 2 IN A?? IN A 1.2.3.4 domena-1.tld IN NS sinkhole.cert.pl sinkholed 3 IN A?? IN A 1.2.3.4 domena-1.tld IN NS domena-2.tld IN NS IN A sinkhole.cert.pl accidently sinkholed

Sinkholing the goal Allow malware to connect to your box Keep malware connected to your sinkhole as long as possible Prevent malware from using alternative/bacup communication channels

CnC

CnC Types TCP CnC UDP

CnC Types TCP CnC UDP other... DNS

CnC Types TCP CnC p2p UDP other... DNS TXT record IP calculation tunelling?

CnC Types +SSL? CnC TCP fancy encryption FTW p2p UDP other... DNS

CnC Types +SSL? HTTP 90+ %? CnC TCP fancy encryption FTW IRC p2p UDP other... DNS

CnC Types +SSL? HTTP CnC TCP fancy encryption FTW IRC other... p2p UDP other... DNS

CnC Types CnC TCP +SSL? fancy encryption FTW p2p HTTP IRC other... POST/GET params encrpted response content encrypted Extra content (i.e. jpg file ) Hidden in legit content other... UDP DNS

CnC Types CnC TCP +SSL? fancy encryption FTW p2p HTTP IRC other... POST/GET params encrpted response content encrypted Extra content (i.e. jpg file ) Hidden in legit content Facebook other... Twitter UDP DNS <!--? -->

CERT.PL story (1)

Timeline end of 2012 dorkbot Yet another malware using.pl domain as CnC Yet did not have TLD sinkhole procedure (in progres) Registrar decided to help (after abuse report) Am... but we do not have sinkhole!?

CnC example: Dorkbot TCP SSL IRC IRC server

Timeline end of 2012 dorkbot -> Take this old unused server and do somethink (4 GB RAM, 2x 3.0 Ghz CPU, 160 GB HDD, decend 1U!) -> We need TLS IRC ->Take charybdis irc server, remove 80 % functions

Timeline end of 2012 dorkbot begin of 2013 virut Realy long-living malware still sitting on.pl domains TLD sinkhole procedure in progres Promising results from sinkholing dorkbot Decistion : we need to do this!

Timeline end of 2012 dorkbot begin of 2013 virut We already got hadrware (+) We need (a lot) more software

CnC example: Virut (expectations) TCP IRC (crippled) IRC server TCP ENCRYPT IRC (crippled) IRC server random key Not working?

CnC example: Virut - reality (reality) traffic TCP PORT 80 (GET POST)_ HTTP NICK_ brute the key PLAIN ENCRYPT random key IRC (crippled) else?

Timeline end of 2012 dorkbot begin of 2013 virut Write python script peek first 5 bytes (decision: irc/http/crypted) keep TCP connection as long as possible

Timeline end of 2012 dorkbot begin of 2013 virut 200 K connections in established state!?

Timeline Encountered problems: TCP timeouts close timeout = 10s close-wait timeout = 60s established timeout = 5 days fin-wait timeout = 120s last-ack timeout = 30s syn-received timeout = 60s syn-sent timeout = 120s time-wait timeout = 120s srsly! it is just waiting for RST

Timeline Encountered problems: software (you know them when you hit the limit ) Somewhere in code you need to select() over opened file descriptors. It uses limited size bit-fields! Hint: on Linux use poll!

Timeline Encountered problems: default OS limits (you know them when you hit the limit ) max opened file descriptors (each tcp connection=new FD) can be easily fixed : ulimit n 999999 max entries in contract table requires kernel param tweak, fixable

Timeline Conclusion (1) Establishing TCP connection and leaving it with default settins is bad idea! Use SO_KEEPALIVE socet option (obvious?)

Timeline Conclusion (2) SELECT() POLL()

Timeline end of 2012 dorkbot begin of 2013 virut 30K simultanious connections

Timeline end of 2012 dorkbot begin of 2013 virut spring 2013 few ZueS domains Write python script that will understand HTTP and decode incoming zeus data...

CnC example: ZeuS TCP SSL HTTP POST /gate.php RC4 visualencrypt binstorage pack records key RC4 visualencrypt binstorage extract records CNC

Timeline end of 2012 dorkbot begin of 2013 virut spring 2013 few ZueS domains summer 2013 domainsilver takedown A LOT of various malware domains Write python scripts......?

Timeline Encountered problems: we already got numerous different python scripts running different CnC

Timeline Conclusion (3) Need decent sinkhole software (obvious?)

CERT.PL sink-soft

Requirements Build consistent framework for sinkholing Make event logging/sharing easy Identify common content processing functions Handle undret of TCP connections from Be as elastic as possible Implement any fancy encryption/encoding anywhere Allow to sinkhole new malware with lowest possible effort

Design Build your sinkhole out of blocks (modules) TCP SSL HTTP POST /gate.php RC4 visualencrypt binstorage pack records key RC4 visualencrypt binstorage extract records CNC

CnC Types CnC TCP +SSL? fancy encryption FTW HTTP IRC POST/GET params encrypted response content encrypted rot13 visualencrypt gzip b64 XOR... RC4 AES

Design Provide TCP conevtivity layer Use MQ ZeroMQ (fast && simple) PUB-SUB messaging pattern Deployed as standalone package with lowest possible requirements (msgpack && zmq-python) Easy configuration (chose ip,port and modules chain) unpack & config & run

Design

Sink-soft Sinkholing > 200 active malware domains

Sink-soft demo :)

Fin. Tomasz Bukowski tomasz.bukowski@cert.pl