Dinan Gunawardena Microsoft Research Cambridge MONITORING USING A WINDOWS BOX & HANDLING A DELUGE OF NETWORK DATA



Similar documents
Windows Filtering Platform, engine for local security

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

Introduction. Interoperability & Tools Group. Existing Network Packet Capture Tools. Challenges for existing tools. Microsoft Message Analyzer

Wireshark in a Multi-Core Environment Using Hardware Acceleration Presenter: Pete Sanders, Napatech Inc. Sharkfest 2009 Stanford University

Covert Channel Analysis and Detection using Reverse Proxy Servers

Host Event Based Network Monitoring

Course Description and Outline. IT Essential II: Network Operating Systems V2.0

MOC 6435A Designing a Windows Server 2008 Network Infrastructure

CQG/LAN Technical Specifications. January 3, 2011 Version

Stateful Inspection Technology

General Pipeline System Setup Information

InfiniBand Software and Protocols Enable Seamless Off-the-shelf Applications Deployment

CompTIA Network+ (Exam N10-005)

TamoSoft Throughput Test

Cloud Optimize Your IT

Infrastructure for active and passive measurements at 10Gbps and beyond

Windows8 Internals, Sixth Edition, Part 1

Network Defense Tools

Network Security. Network Packet Analysis

Introduction to MPIO, MCS, Trunking, and LACP

Chapter 9. IP Secure

Configuring Your Computer and Network Adapters for Best Performance

IP SAN Best Practices

Video Surveillance Storage and Verint Nextiva NetApp Video Surveillance Storage Solution

The Elements of GigE Vision

Operating Systems Design 16. Networking: Sockets

Gigabit Ethernet Packet Capture. User s Guide

MCSE Core exams (Networking) One Client OS Exam. Core Exams (6 Exams Required)

Table of Contents. Cisco Using the Cisco IOS Firewall to Allow Java Applets From Known Sites while Denying Others

Network Monitoring Comparison

EView/400i Management Pack for Systems Center Operations Manager (SCOM)

Ethernet. Ethernet. Network Devices

Windows Server 2012 Hyper-V Extensible Switch and Cisco Nexus 1000V Series Switches

Troubleshooting for Yamaha router

and reporting Slavko Gajin

CSE 4482 Computer Security Management: Assessment and Forensics. Protection Mechanisms: Firewalls

VIA CONNECT PRO Deployment Guide

Cisco Integrated Services Routers Performance Overview

Scalable Extraction, Aggregation, and Response to Network Intelligence

Quantifying the Performance Degradation of IPv6 for TCP in Windows and Linux Networking

THE. solution. STORe it. SHARE it.

OneCommand NIC Teaming and VLAN Manager

Virtualised MikroTik

IPv6 Challenges for Embedded Systems István Gyürki

VIA COLLAGE Deployment Guide

Administrator Guide. CA Multi-Port Monitor. Version 10.2

Integration with CA Transaction Impact Monitor

Flow Analysis Versus Packet Analysis. What Should You Choose?

AKIPS Network Monitor Installation, Configuration & Upgrade Guide Version 15. AKIPS Pty Ltd

Planning Domain Controller Capacity

Cloud Optimize Your IT

SILVER PEAK ACCELERATION WITH EMC VSPEX PRIVATE CLOUD WITH RECOVERPOINT FOR VMWARE VSPHERE

Question: 3 When using Application Intelligence, Server Time may be defined as.

AKIPS Network Monitor Installation, Configuration & Upgrade Guide Version 16. AKIPS Pty Ltd

z/os V1R11 Communications Server system management and monitoring

Lab Configuring Access Policies and DMZ Settings

PARALLELS SERVER BARE METAL 5.0 README

Troubleshooting LANs with Wirespeed Packet Capture and Expert Analysis

Using EonStor FC-host Storage Systems in VMware Infrastructure 3 and vsphere 4

Detecting rogue systems

Content Switching Module for the Catalyst 6500 and Cisco 7600 Internet Router

IPv6 Fundamentals, Design, and Deployment

SSVP SIP School VoIP Professional Certification

theguard! Service Management Center (Valid for Version 6.3 and higher)

IP SAN Fundamentals: An Introduction to IP SANs and iscsi

TABLE OF CONTENTS NETWORK SECURITY 2...1

UltraBac Documentation. UBDR Gold. Administrator Guide UBDR Gold v8.0

Installation Guide for. 10/100 to Triple-speed Port Aggregator. Model TPA-CU Doc. PUBTPACUU Rev. 1, 12/08. In-Line

Boosting Data Transfer with TCP Offload Engine Technology

Backup and Recovery. Backup and Recovery. Introduction. DeltaV Product Data Sheet. Best-in-class offering. Easy-to-use Backup and Recovery solution

"Charting the Course...

Part 1 - What s New in Hyper-V 2012 R2. Clive.Watson@Microsoft.com Datacenter Specialist

QRadar Security Intelligence Platform Appliances

Cisco IOS Flexible NetFlow Technology

QuickSpecs. HP PCM Plus v4 Network Management Software Series (Retired) Key features

Lab VI Capturing and monitoring the network traffic

Packet Capture. Document Scope. SonicOS Enhanced Packet Capture

Application Note: AN00121 Using XMOS TCP/IP Library for UDP-based Networking

Preliminary Course Syllabus

המרכז ללימודי חוץ המכללה האקדמית ספיר. ד.נ חוף אשקלון טל' פקס בשיתוף עם מכללת הנגב ע"ש ספיר

TEST METHODOLOGY. Hypervisors For x86 Virtualization. v1.0

MCSA Security + Certification Program

Introduction to IP v6

A Protocol Based Packet Sniffer

MCSA Objectives. Exam : TS:Exchange Server 2007, Configuring

Enhanced Diagnostics Improve Performance, Configurability, and Usability

SSVVP SIP School VVoIP Professional Certification

Analysis to develop an ISCSI Layer inside Microsoft Windows NT/2K/XP

Microsoft Windows Server System White Paper

Citrix MetaFrame Presentation Server 3.0 and Microsoft Windows Server 2003 Value Add Feature Guide

IP Networking. Overview. Networks Impact Daily Life. IP Networking - Part 1. How Networks Impact Daily Life. How Networks Impact Daily Life

Software Defined Networking (SDN) - Open Flow

Who s Endian?

Network Access Security. Lesson 10

Microsoft Message Analyzer Packet Analysis at a Higher Level. Neil B Martin Test Manager WSSC- Interop and Tools Microsoft Corporation

AC Wireless Tri-Band Gigabit Router. Highlights

FWSM introduction Intro 5/1

PANDORA FMS NETWORK DEVICES MONITORING

Case Study: Instrumenting a Network for NetFlow Security Visualization Tools

Networking and High Availability

Transcription:

Dinan Gunawardena Microsoft Research Cambridge MONITORING USING A WINDOWS BOX & HANDLING A DELUGE OF NETWORK DATA

Overview Windows Network Stack Overview Network Monitoring Scope Windows Monitoring Tools Additional Windows Monitoring Infrastucture Managing a large network Capture 2

Monitoring using a Windows box 3

If you remember only one slide Task Figure out what is going on locally with your network interface Experiment with / write a Ethernet based protocol Do network I/O in a Windows driver Capture all the traffic on a subnet / Enterprise network Write network code for Windows Suggested Windows Approach Run NetMon or Ethereal (both freely available on the web) Start with Windows Filterering Platform (WFP) code samples at http://msdn.microsoft.com or RawEther sample (PCUSA.com) Try using Windows Sockets Kernel (WSK) http://msdn.microsoft.com Learn about router monitor ports and consider writing your own WFP / NetMon SDK / WinPCAP capture program (start with the existing sample code) Download the Windows Driver Kit (WDK) from Microsoft.com 4

NetMon Demo 5

Windows XP Network Stack Overview Winsock TCP/IP stack NDIS Network Device Interface Specification TDI Transport Data Interface IPv6 and IPv4 System.Net Sockets Applications (managed C#,VB.NET etc) MyDotNetApp.EXE System.NET TDI Sockets Applications (unmanaged) MyApp.EXE TCP/IPv6.SYS (IP v6) NDIS Intermediate Mode (IM) Driver Windows Sockets (Winsock2.DLL) NDIS Miniport NIC TCP/IP.SYS (IP v4) User Mode Kernel Mode NDIS NDIS Intermediate Mode (IM) Driver 6

Windows Vista Network Stack Overview Sockets Applications (managed C#,VB.NET etc) MyDotNetApp.EXE Sockets Applications (unmanaged) MyApp.EXE System.NET Windows Filter Platform Application MyNetMonitor.EXE WFP Winsock Kernel (WSK) (MyNetService.SYS) Winsock TCP/IP stack NDIS Network Device Interface Specification IPv6 and IPv4 WFP Windows Filtering Platform WSK WinSock Kernel System.Net Windows Sockets (Winsock2.DLL) Windows Socket Switch TCP/IP.SYS (IP v6 and IP v4) NDIS Intermediate Mode (IM) Driver NDIS Miniport NIC NDIS User Mode Kernel Mode 7

Transport Data Interface 1 (TDI) User Mode Winsock Service Provider HTTP.SYS TDI Driver WSK Driver Kernel Mode TCP/IP (IP v6 and IP v4) Transport Data interface (TDI) Transport Drivers e.g. TCP/IP and Kernel-mode users of transport drivers e.g. Windows Sock2 Kernel Mode Provider

Transport Data Interface 2 (TDI) TDI Providers : NDIS (Network Device Interface Specification) protocol drivers (aka "Transport Drivers") provide base implementation of network protocols e.g. TCP/IP. Lower edge TDI providers interface with packet-oriented NDIS miniport drivers that communicate over the physical network Upper edge TDI providers interact with their clients using the TDI interface. TDI Clients These are kernel-mode drivers that use the networking services of a TDI provider A TDI client of Tcp can initiate or accept TCP connections and send or receive stream data within the kernel

WinSock Kernel (WSK)1 User Mode Winsock Service Provider HTTP.SYS TDI Driver WSK Driver Kernel Mode TCP/IP (IP v6 and IP v4) Simple to use, Winsock2-like interface in kernel mode Supercedes TDI

WinSock Kernel (WSK) 2 Improve scalability and efficiency by improving on the performance and memory limitations of previous Network Programming Interfaces (NPI). For example, WSK has improved socket creation performance and a smaller memory footprint per socket than past NPIs. Easy to port existing TDI clients to WSK. Components such as http.sys (kernel mode HTTP handler) within Windows Vista have ported from TDI to WSK with ease Supports IPv4 and IPv6 Handles transport discovery, load/unload and other intricacies

Windows Filtering Platform (WFP) Architecture Firewall Application AV Application WFP APIs Base Filtering Engine (BFE) user TDI/WSK ALE kernel Stream Layer Transport Layer Network Layer Forward Layer IPsec Filtering Engine 3 rd party anti-virus 3 rd party parental control 3 rd party IDS Callout modules 12

WFP Layers Layers Protocol specific Stream/Data Layer ALE (Application Layer Enforcement) Layers Transport Layer IP Packet Layer Forward Layer ICMP Discard Data Representations RPC, IKE Datagram and streams Control events TCP/UDP Network layer traffic and local fragments Forwarded traffic ICMP error packets Discarded/dropped packets 13

Benefits of WFP WFP can filter and secures (works with IPSEC) network traffic WFP supports both IPv4 as well as IPv6 traffic Integrated with hardware Offload capabilities in Windows Vista 14

Extending WFP with Callouts A callout extends the capabilities of WFP Callouts can be registered at all layers Each callout has a unique GUID Callouts are used for Deep Inspection Packet Modification Stream Modification Data Logging Boot time security For More Info: WFP development white paper http://www.microsoft.com/whdc/device/network/wfp.mspx

Filtering Model

Code Example 1 #include <fwpmu.h> /// Creating a session and opening a handle to the engine FwpmEngineOpen0( ); FwpmTransactionBegin0(); /// Begin Transaction FwpmSubLayerAdd0( ); /// Add a Sublayer /// Add a Filter FWPM_FILTER0 blockfilter; FWPM_FILTER_CONDITION0 tcpcondition; blockfilter.layerkey = FWPM_LAYER_ALE_AUTH_RECV_ACCEPT_V4; blockfilter.action.type = FWP_ACTION_BLOCK; blockfilter.filtercondition = &tcpcondition; tcpcondition.fieldkey = FWPM_CONDITION_IP_PROTOCOL; tcpcondition.matchtype = FWP_MATCH_EQUAL; tcpcondition.conditionvalue.uint8 = 0x06; /// TCP FwpmFilterAdd0(, &blockfilter, );

Code Example 2 Custom Callouts /// Callout function: classify called whenever there is data to be processed by callout VOID NTAPI classifyfn( IN const FWPS_INCOMING_VALUES0 *infixedvalues, IN const FWPS_INCOMING_METADATA_VALUES0 *inmetavalues, IN OUT VOID *layerdata, IN const FWPS_FILTER0 *filter, IN UINT64 flowcontext, OUT FWPS_CLASSIFY_OUT0 *classifyout); /// calloutkey holds the GUID that uniquely identifies the callout typedef struct FWPS_CALLOUT0_ { GUID calloutkey; UINT32 flags; FWPS_CALLOUT_CLASSIFY_FN0 classifyfn; FWPS_CALLOUT_NOTIFY_FN0 notifyfn; FWPS_CALLOUT_FLOW_DELETE_NOTIFY_FN0 flowdeletefn; } FWPS_CALLOUT0; // Add a new Callout FwpmCalloutAdd0(, (FWPM_CALLOUT0*) callout, ); // Register a Callout with the filtering engine FwpsCalloutRegister0(, (FWPS_CALLOUT0 *) callout, );

Network Monitoring Scope Level of Capture IP/Ethernet Captures all the data of higher layers At End System IP SEC mitigation, load balancing etc. Non-aggregate Don t want to limit what you can do with the data Unfiltered traffic Some security issues Not covered Capture at Network Infrastructure (e.g. NetFlow) Non-software solutions 19

Windows Monitoring Tools NetMon2 custom filters Ethereal (/ Tethereal) WinPCap source available, buffering / perf issues www.sysinternals.com tools: TDI Mon, TCPView Custom Tools- rolling your own User Mode (trade-off: simple programming environment for performance) Raw Sockets: TCP limitations (an aside) NDIS UIO - In Windows Dev Kit (WDK) pull up NDIS packets to User Mode used by Wireless Zero Config user mode service source available in WDK RawEther (PCUSA.com) Send/Receive NDIS packets from User Mode source available Kernel Drivers Network Device Interface Specification (NDIS) common interface to NIC drivers Intermediate Mode (IM) e.g. Firewalls - Passthru driver sample MiniPort e.g. NIC drivers, SCSI miniport (lowest level wrapper for a class of drivers) Vista: Better to use WinSock Kernel (WSK) / Windows Filter Platform (WFP) 20

Event Tracing for Windows (ETW) Many, many system components wrapped TCP/IP connection establishment etc. OS Context Switches Disk IO events IIS (web server) events... And many more Use PerfMon if you just want to understand local performance e.g. How long is the disk write queue Event Tracer Timestamp Information ETW time of the event process ID under which the event occurs thread ID under which the event occurs user-mode CPU time kernel-mode CPU time 21

Additional Windows Monitoring Infrastucture NETIO debug New Vista TCP/IP stack internal debugging Link Status Events OIDs (Object IDentiers) WFP subsumes much of this Native WiFi IEEE 802.11 upper MAC functionality, lower MAC and PHY management + Windows STA / AP service 22

Handling a deluge of network data 23

Managing a large network Capture (6TB of data in 14 days, 300 Hosts, 3 Capture PCs, 3 Cisco SPAN ports, 50+ backup tapes) Hardware requirements Software Requirements Meta Data Privacy Issues Security Manpower Issues Post Processing 24

Hardware requirements CPU / Chassis RAM don t want it swapping! CPU capturing should not be too CPU intensive KVMs multiple capturing PCs, single console... Network Interface Storage Speed 1000Mbps NIC even if network is 100Mbps Offload support CPU cost Load balancing / redundancy helps deal with bursts, failures Interrupt Moderation... But issues with timestamps in packets Reliability RAID 5 Capacity Performance multi disk arrays, esata, Firewire Perf not at cost of Reliability Backup offsite / disaster proof / reliable Router/Network infrastructure SPAN / Monitor ports Fibre taps Router performance impact 25

Software Requirements Reliability Soak test Dry runs Test sample output Performance Test under load bursts, sustained loads Turn-off Anti-Virus, search indexing service etc. Time Sync NTP etc Important for merging data sets 26

Meta Data DNS / WINS Zone transfer records DHCP data Router config / Network config Maintenance scheduling Back-up this meta-data It is as, if not more important than the captured data 27

Privacy Issues Personally Identifiable Information (PII) and Legal concerns Implications: may only be able to capture packet headers IP Packet payload discard How much can you discard Capture snap length may limit usefulness of data Anonymising IP 5-tuple Depending on how paranoid you have to be 28

Security Issues Access control to captures Acceptable Usage Policy (AUP) Physical security of storage Dealing with encryption Publishing concerns 29

Manpower Issues Managing capture is 24x7 job Automation Backup monitoring personnel Outages happen 30

Post Processing Make copies before post processing / discarding data Process... 1. Raw -> backup 2. Validity check 3. Correct broken files 4. De-duplicate data 5. Process for packet data + generate NetFlow-like records Lastly Make meticulous notes Time of events Nature of logging network info / configuration Put processing scripts/tools (& results!) under revision control 31

Questions? 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Code Example 1 Copyright (c) Microsoft Corporation. All rights reserved. #include <fwpmu.h> /// Creating a session and opening a handle to the engine HANDLE enginehandle = 0; FWPM_SESSION0 session; ZeroMemory(&session,sizeof(session)); session.displaydata.name = L"Snipit Session"; session.displaydata.description = L"Session created by Snipit.exe"; status = FwpmEngineOpen0(0, RPC_C_AUTHN_DEFAULT, 0, &session, &enginehandle); /// Begin Transaction FwpmTransactionBegin0(engineHandle);

Code Example 2 /// Add a Sublayer FWPM_SUBLAYER0 sublayer; ZeroMemory(&sublayer,sizeof(sublayer)); UuidCreate(&sublayer.subLayerKey); sublayer.displaydata.name = L"Snipit Sublayer"; sublayer.displaydata.description = L"Sublayer added by Snipit.exe"; sublayer.weight = 1; status = FwpmSubLayerAdd0(engineHandle, &sublayer, 0);

Code Example 3 /// Add a Filter FWPM_FILTER0 blockfilter; ZeroMemory(&blockFilter,sizeof(blockFilter)); FWPM_FILTER_CONDITION0 tcpcondition; ZeroMemory(&tcpCondition,sizeof(tcpCondition)); UuidCreate(&blockFilter.filterKey); blockfilter.displaydata.name = L"Snipit TCP block filter"; blockfilter.displaydata.description = L"Filter added by Snipit.exe"; blockfilter.layerkey = FWPM_LAYER_ALE_AUTH_RECV_ACCEPT_V4; blockfilter.action.type = FWP_ACTION_BLOCK; blockfilter.sublayerkey = sublayer.sublayerkey; blockfilter.numfilterconditions = 1; blockfilter.filtercondition = &tcpcondition; tcpcondition.fieldkey = FWPM_CONDITION_IP_PROTOCOL; tcpcondition.matchtype = FWP_MATCH_EQUAL; tcpcondition.conditionvalue.type = FWP_UINT8; tcpcondition.conditionvalue.uint8 = 0x06; /// TCP status = FwpmFilterAdd0(engineHandle, &blockfilter, 0, &blockfilter.filterid);

Code Example 4 Custom Callouts /// Callout function: classify called whenever there is data to be processed by callout VOID NTAPI classifyfn( IN const FWPS_INCOMING_VALUES0 *infixedvalues, IN const FWPS_INCOMING_METADATA_VALUES0 *inmetavalues, IN OUT VOID *layerdata, IN const FWPS_FILTER0 *filter, IN UINT64 flowcontext, OUT FWPS_CLASSIFY_OUT0 *classifyout); /// calloutkey holds the GUID that uniquely identifies the callout typedef struct FWPS_CALLOUT0_ { GUID calloutkey; UINT32 flags; FWPS_CALLOUT_CLASSIFY_FN0 classifyfn; FWPS_CALLOUT_NOTIFY_FN0 notifyfn; FWPS_CALLOUT_FLOW_DELETE_NOTIFY_FN0 flowdeletefn; } FWPS_CALLOUT0; // Add a new Callout DWORD WINAPI FwpmCalloutAdd0(HANDLE enginehandle, const FWPM_CALLOUT0* callout, PSECURITY_DESCRIPTOR sd, UINT32* id); // Register a Callout with the filtering engine NTSTATUS NTAPI FwpsCalloutRegister0(IN OUT void *deviceobject, IN const FWPS_CALLOUT0 *callout, OUT OPTIONAL UINT32 *calloutid);

Windows Network Stack Overview Sockets Applications (managed C#,VB.NET etc) MyDotNetApp.EXE System.NET Winsock TCP/IP stack NDIS Network Device Interface Specification IPv6 and IPv4 WFP Windows Filtering Platform WSK WinSock Kernel System.Net Http.sys + WinHttp / WinINet QoS IPSec Sockets Applications (unmanaged) MyApp.EXE Windows Sockets (Winsock2.DLL) Windows Socket Switch TCP/IP.SYS (IP v6 and IP v4) NDIS NDIS Intermediate Mode (IM) Driver NDIS Miniport NIC User Mode Kernel Mode 37