D&D of malware with exotic C&C



Similar documents
Network Security Monitoring

Uroburos Highly complex espionage software with Russian roots

Suricata 2.0, Netfilter and the PRC

Cleaning Encrypted Traffic

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

Passive Logging. Intrusion Detection System (IDS): Software that automates this process

Hacking Database for Owning your Data

Automating Linux Malware Analysis Using Limon Sandbox Monnappa K A monnappa22@gmail.com

Know Your Enemy Lite: Proxy Threats - Socks v666

Network Security, ISA 656, Angelos Stavrou. Snort Lab

Introduction on Low level Network tools

A perspective to incident response or another set of recommendations for malware authors

Latest advance in Suricata I D P S

Using a Malicious Proxy to Pilfer Data & Wreak Havoc. Edward J. Zaborowski ed@thezees.net

INTERNET SECURITY: THE ROLE OF FIREWALL SYSTEM

VISA SECURITY ALERT December 2015 KUHOOK POINT OF SALE MALWARE. Summary. Distribution and Installation

Basics of SSL Certification

ShinoBOT ShinoC2. Can you prevent APT like me? Author: Shota Shinogi. - the pentest tool to measure the defense against APT/RAT -

CS5008: Internet Computing

The Power of SNORT SNORT Update

SSL VPN Technology White Paper

StreamServe Persuasion SP4 Service Broker

Lab Exercise SSL/TLS. Objective. Step 1: Open a Trace. Step 2: Inspect the Trace

Network Security. Mobin Javed. October 5, 2011

Web Analytics Understand your web visitors without web logs or page tags and keep all your data inside your firewall.

CIA Lab Assignment: Web Servers

Maximizing Performance with SPDY & SSL. Billy Hoffman

This presentation explains how to monitor memory consumption of DataStage processes during run time.

JAVASCRIPT AND COOKIES

APPLICATION PROGRAMMING INTERFACE

Operation Liberpy : Keyloggers and information theft in Latin America

Snort Installation - Ubuntu FEUP. SSI - ProDEI Paulo Neto and Rui Chilro. December 7, 2010

1. Introduction. 2. Web Application. 3. Components. 4. Common Vulnerabilities. 5. Improving security in Web applications

ARP and DNS. ARP entries are cached by network devices to save time, these cached entries make up a table

Networks and Security Lab. Network Forensics

Detecting Anonymous Proxy Usage

The Bro Network Intrusion Detection System

SSL Inspection Step-by-Step Guide. June 6, 2016

How Attackers are Targeting Your Mobile Devices. Wade Williamson

HTTPS Inspection with Cisco CWS

Web Application Security Considerations

Configuring Snort as a Firewall on Windows 7 Environment

DiskPulse DISK CHANGE MONITOR

Description: Objective: Attending students will learn:

Data Mining in Incident Response Challenges and Opportunities

1 Download & Installation Usernames and... Passwords

SSL BEST PRACTICES OVERVIEW

Research on the Essential Network Equipment Risk Assessment Methodology based on Vulnerability Scanning Technology Xiaoqin Song 1

Network Monitoring for Cyber Security

A Tale of the Weaknesses of Current Client-Side XSS Filtering

CardSwipe Integration

Defending Behind The Device Mobile Application Risks

The full setup includes the server itself, the server control panel, Firebird Database Server, and three sample applications with source code.

Fighting Advanced Persistent Threats (APT) with Open Source Tools

IDS and Penetration Testing Lab III Snort Lab

SHINOBOT/SHINOC2 MANUAL

Cybercrime: evoluzione del malware e degli attacchi. Cesare Radaelli Regional Sales Manager, Italy cradaelli@paloaltonetworks.com

BeamYourScreen Security

This report is a detailed analysis of the dropper and the payload of the HIMAN malware.

Exercise 7 Network Forensics

Qlik REST Connector Installation and User Guide

Concierge SIEM Reporting Overview

場 次 :C-3 公 司 名 稱 :RSA, The Security Division of EMC 主 題 : 如 何 應 用 網 路 封 包 分 析 對 付 資 安 威 脅 主 講 人 :Jerry.Huang@rsa.com Sr. Technology Consultant GCR

Reverse Shells Enable Attackers To Operate From Your Network. Richard Hammer August 2006

How Secure are your Channels? By Morag Hughson

Post-Access Cyber Defense

SOUTHERN POLYTECHNIC STATE UNIVERSITY. Snort and Wireshark. IT-6873 Lab Manual Exercises. Lucas Varner and Trevor Lewis Fall 2013

English. Asema.com Portlets Programmers' Manual

Chapter 17. Transport-Level Security

Proxy Blocking: Preventing Tunnels Around Your Web Filter. Information Paper August 2009

Release Notes for Epilog for Windows Release Notes for Epilog for Windows v1.7/v1.8

MIKOGO SECURITY DOCUMENT

Decryption. Palo Alto Networks. PAN-OS Administrator s Guide Version 6.0. Copyright Palo Alto Networks

Internet Mail Client Control Library SSL Supplement

RSA Security Anatomy of an Attack Lessons learned

UNMASKCONTENT: THE CASE STUDY

Configuring Snort as a Firewall on Windows 7 Environment

How To Detect An Advanced Persistent Threat Through Big Data And Network Analysis

Comprehensive Malware Detection with SecurityCenter Continuous View and Nessus. February 3, 2015 (Revision 4)

LEVERAGING PROACTIVE DEFENSE TO DEFEAT MODERN ADVERSARIES. Jared Greenhill RSA Incident Response. September 17 th, 2015

Indexing Full Packet Capture Data With Flow

ios Testing Tools David Lindner Director of Mobile and IoT Security

Network Traffic Analysis

BlackBerry Enterprise Service 10. Secure Work Space for ios and Android Version: Security Note

How To Connect Log Files To A Log File On A Network With A Network Device (Network) On A Computer Or Network (Network Or Network) On Your Network (For A Network)

Vuurmuur - iptables manager

G DATA SECURITYLABS CASE STUDY OPERATION TOOHASH HOW TARGETED ATTACKS WORK

SSL Tunnels. Introduction

EFFECTIVE IMPLEMENTATION OF DYNAMIC CLASSIFICATION FOR NETWORK FORENSIC AND TRAFFIC ANALYSIS

Alert (TA14-212A) Backoff Point-of-Sale Malware

CSE598i - Web 2.0 Security OWASP Top 10: The Ten Most Critical Web Application Security Vulnerabilities

TELE 301 Network Management. Lecture 17: File Transfer & Web Caching

Network Monitoring using MMT:

Content Scanning for secure transactions using Radware s SecureFlow and AppXcel together with Aladdin s esafe Gateway

OLD VULNERABILITIES IN NEW PROTOCOLS? HEADACHES ABOUT IPV6 FRAGMENTS

Collecting Windows Security Audit Log data with NXLog and Sysmon. Collecting Windows Security Audit Log data with NXLog and Sysmon

McAfee Web Gateway Administration Intel Security Education Services Administration Course Training

Transcription:

D&D of malware with exotic C&C D&D = Description & Detection C&C = Command & Control Automotive Consumer Energy & Chemicals Paul Rascagneres - @r00tbsd Eric Leblond - @Regiteric Life Sciences & Healthcare

Introduction About us - Paul Rascagnères: malware analyst at G DATA SecurityLabs - Eric Leblond: co-founder of Stamus Networks, Suricata developer 2

Introduction Why this talk? - to explain advanced communication channel used by modern malware; - to explain how to correctly detect and contain attacks (to be blind in your network is the worst situation); - to show strength of Suricata; - to show why incident response team should work with network team; - and 3

Introduction Why this talk? - because: 4

Introduction Suricata Intrusion Detection System - Protocol recognition and dedicated keywords - File extraction Network Security Monitoring - Protocol request journalisation - EVE format: JSON output for all events and alerts 5

Introduction The described cases All malware appearing in this presentation are not fictitious. Any ressemblance to real malware, living or dead, is not purely coincidental. We only describes case in the wild, sorry no BadBIOS during the next 30 minutes 6

Case 1 HTTP communication Ex: Havex Quick description: havex is a Remote Administration Tool (RAT) uses on targeted attacks. The group mainly targets petrol companies. Network protocol: this malware uses common HTTP query with a specific pattern 7

Case 1 HTTP communication 8

Case 1: Detection HTTP communication The naive approach : - Detect 'havex' string in the flow - Use content keyword for that alert tcp any any -> any any (msg:"havex HTTP"; content:"<!--havex"; sid:1; rev:1;) Problem - All TCP flows are inspected - We want http coming from server 9

Case 1 : Detection HTTP communication Select the flow : This is HTTP communication Use Suricata http keywords : Dynamic detection of protocol independent of port - Flow with content to detect comes from server alert http any any -> any any (msg:"havex HTTP"; flow:established,from_server; pcre:"/<\!--havex.*havex-->/"; sid:1; rev:1;) - Content has to be find in http body: use Pcre modifier alert http any any -> any any (msg:"havex HTTP"; flow:established,from_server; pcre:"/<\!--havex.*havex-- >/Q"; sid:1; rev:1;) 10

Case 1#BringBackOurPerf HTTP communication Problem - Fire a regexp for all HTTP content - In the body Solution - Do a pre match on partial content Simple string matching no pcre complexity - Choose it as fast pattern Tell suricata rule multi pattern matching that the string is on differenciator alert http any any -> any any (msg:"havex HTTP"; flow:established,from_server ; content:"<!--havex"; http_server_body; fast_pattern; pcre:"/<\!--havex.*havex-->/q"; sid:1; rev:1;) 11

Case 2 HTTPS + GZIP communication Ex: IcoScript Quick description: IcoScript is a Remote Administration Tool (RAT) used on targeted attacks. Network protocol: It uses it own scripting language to manipulate the user s browser (thanks to COM and CoCreateInstance()). The malware uses popular webmail as C&C (for example Yahoo). 12

Case 2 HTTPS + GZIP communication Ex: IcoScript The orders are present in the content of an email stored on Yahoo webmail. The command is located between <<<<<< and >>>>>>. To detect this pattern, we need to solve two difficulties: - Yahoo uses SSL to encrypt the network flow; - The web content is compressed thanks to GZIP algorithm. 13

Case 2 Detection HTTPS + GZIP communication Suricata http handling - Based on libhtp by Ivan Ristic - Libhtp handles gzip transparently - Any match on a gziped HTTP object is done on ungzipped content alert http any any -> any any (msg:"havex HTTP"; flow:established,from_server ; content:"<<<<<"; http_server_body; fast_pattern; pcre:"/<<<<<.*>>>>>/q"; sid:2; rev:1;) 14

Case 3 Named pipe communication Ex: Uroburos, r*g*n, Quick description: Uroburos is a rootkit. The purpose is to provide a remote acces on the infected malware and to steal data. This malware was used during targeted attacks against government. Network protocol: this rootkit used several network protocol. This case is only limited to the usage of named pipe between infected machines. 15

Case 3 Named pipe communication Ex: Uroburos, r*g*n, 16

Case 3 Named pipe communication Ex: Uroburos, r*g*n, The rootkit uses the following named pipe: - \\machine_name\\pipe\isapi_http - \\machine_name\\pipe\isapi_dg - \\machine_name\\pipe\isapi_dg2 17

Case 3 Named pipe communication Ex: Uroburos, r*g*n, Specific context: - Inter desktop communication - Not on internet path - How to capture - Specific parameter on switch - Pcap capture on a host and replay 18

Case 3 Named pipe communication Network specificity The C&C is characterized by local trafic - IDS place must match Usual way is on the internet path Here IDS must intercept local trafic Local trafic can mean huge trafic - In forensic/analysis : Pcap or custom IDS 19

Case 3 Named pipe communication First attempt : - Use dce/rpc keywords to detect - Seems to use SMB protocol Back to the roots - Content based detection, offset - Port filtering alert tcp any any -> any 445 (msg:"isapi smb"; flow:established,to_server; content:" FF SMB a2 "; offset:4; content:" 69 00 73 00 61 00 70 00 69 "; sid:5; rev:1;) 20

Case 4 User Agent communication Ex: Houdini Quick description: Houdini is a Remote Administration Tool (RAT) developed in VBS. It was used during targeted campaign. Network protocol: This malware use common HTTP query. However the communication is perform with the User Agent field. 21

Case 4 User Agent communication Ex: Houdini 22

Case 4 User Agent communication Got a characterisation on user-agent - Can use a fast pattern on basic motif - Do a pcre on user agent Using V modifier alert http any any -> any any (msg:"houdini"; flow:established,from_server ; content:"< >"; http_user_agent; fast_pattern; pcre:"/.+< >.+< >.+< >/V"; sid:2; rev:1;) 23

Case 5 DNS communication Ex: FrameworkPOS Quick description: On the G DATA SecurityLabs, we are currently working on new generation of Point Of Sale (POS) malware. The purpose of this kind of malware is to parse the memory of the infected system in order to get credit card data. Network protocol: to exfiltrate the data, the malware uses DNS query. 24

Case 5 DNS communication Ex: FrameworkPOS 25

Case 5 DNS communication Ex: FrameworkPOS Example of query: 1234-1234-1234-1234.domain.vilain (not exactly correct but enough to understand) 26

Case 5 DNS communication Ex: FrameworkPOS Methodology Protocol recognition on DNS dns_query keyword alert dns any any -> any any (msg:"query to supervilain"; dns_query; content:"supervilain.ru"; sid:5; rev:1;) 27

Case 5 DNS communication Reverse exfiltration crypto ^ 0xAA ^ 0x9B ^ 0xC3 Equal to ^ 0xF2 28

Case 5 DNS communication Reverse exfiltration crypto What is lua script? - Run a lua script when all filters match - Script decides if sig matches or not Syntax is simple alert dns any any -> any any (msg:"query to supervilain"; dns_query; content:"supervilain.ru"; lua:dnsextract.lua; sid:5; rev:1;) Code available on github: https://github.com/inliniac/suricata/pull/1169 29

Case 5 Reverse exfiltration crypto function init (args) local needs = {} needs["dns.rrname"] = tostring(true) return needs end function match(args) a = tostring(args["dns.rrname"]) if #a > 0 then i = string.find(a, "%.") a = string.sub(a, 0, i-1) i = 0 var = "" while i < #a do hexa = tonumber(string.sub(a, i, i+2), 16) decod = bit.bxor(hexa, 0xF2) res = string.format("%c", decod) var = var.. res i = i +2 end -- keep for later, big data, you know print(var) -- alert return 1 end -- end if return 0 end 30

Case 6 Steganography communication Ex: Uroburos next gen Quick description: On the last generation of the Uroburos malware, the attackers decided to use steganography to communication. The steganography consists to hide message in another file (in particularly in image in our case). 31

Case 6 Steganography communication Ex: Uroburos next gen The rootkit uses an home-made steganography algorithm. To simplify the case, we will use well know Least Significant Bit (LSB) algorithm. Once the message contained in the image is obtained, the detection will be perform on the pattern: <!--Uroburos.*Uroburos--> The pattern is only here as an example. This pattern is not really used with the Uroburos rookit. 32

Case 6 Steganography communication No direct steganography capabilites in Suricata Current possibility Extract suspect file and store them on disk Got a script to analyse file and report Inotify is your friend alert http any any -> any any (msg:"filestore PNG"; flow:established,to_client; content:"twitter.com"; http_header; filemagic:"png image data"; filestore; sid:5; rev:1;) 33

Conclusion Yes, the attackers uses advanced techniques but nothing magic! With a good analysis (yes the reverse is yet useful) and efficient IDS rules, we are able to detect and contain complex attacks The knowledge is the key of the success: - how the attackers work? - how your infrastructure works? - how your tools works? - human capabilities > magic box 34