DAVIX Visualization Bootcamp 25C3 Visualize Your Network! Jan P. - - PDF document

davix visualization bootcamp 25c3
SMART_READER_LITE
LIVE PREVIEW

DAVIX Visualization Bootcamp 25C3 Visualize Your Network! Jan P. - - PDF document

DAVIX Visualization Bootcamp 25C3 Visualize Your Network! Jan P. Monsch Marius Ciepluch About Your Hosts Jan P. Monsch Marius Ciepluch l l DAVIX Project Initiator & DAVIX User & l l Lead Engineer Workshop Assistant Senior


slide-1
SLIDE 1

Visualize Your Network! Jan P. Monsch Marius Ciepluch

DAVIX Visualization Bootcamp 25C3

About Your Hosts

l

Jan P. Monsch

l

DAVIX Project Initiator & Lead Engineer

l

Senior Security Analyst

l

Student in Security and Forensic Computing @ Dublin City University

l

Marius Ciepluch

l

DAVIX User & Workshop Assistant

l

Student in Computer Science @ University Lübeck

slide-2
SLIDE 2

Workshop Preparation

l

Get DAVIX

l

Visit http://82.197.185.121/davix/release/

l

Download

l

davix-1.0.1-defcon16.iso.gz

l

davix-manual-1.0.1.pdf

l

25c3-workshop.lzm

l

Recommended setup

l

VMware Player or VMware Fusion

l

Bridged or NAT networking

l

Configure host to access 25C3 network

l

See chapter 6.1.1 & 6.1.2 in manual for assistance

Agenda

l Introduction DAVIX l Visualization l Walk-Through DAVIX l Hands-on Lab l Visualization Contest

slide-3
SLIDE 3

Introduction DAVIX

Initial Situation

l Security visualization is quite new l Currently two books available [1, 2]

slide-4
SLIDE 4

Initial Situation

l Many free visualization tools

l

But installation is often cumbersome

l

Compiler version and library issues

l

Code difficult to build or broken

l

Diverse runtime environments: Java, Perl, Ruby, Python, Windows Applications

l Huge hurdle for people to get start with

security visualization

Mission Statement

l DAVIX shall

l

provide the audience with a workable and integrated tools set,

l

enable them to immediately start with security visualization and

l

motivate them to contribute to the security visualization community.

slide-5
SLIDE 5

Inside the DAVIX Live CD

l

Live Linux CD system based on SLAX 6 [3]

l

Software packages are modularized

l

Easy customizable

l

Runs from CD/DVD, USB stick or hard drive

l

Collection of free tools for processing & visualization

l

Tools work out of the box

l

No compilation or installation of tools required

l

Comes with documentation [4]

l

Quick start description for the most important tools

l

Links to manuals and tutorials

DAVIX 1.0.1 Tools

l

Capture

l

Network Tools

l

Argus

l

Snort

l

Wireshark

l

Logging

l

syslog-ng

l

Fetching Data

l

wget

l

ftp

l

scp

l

Processing

l

Shell Tools

l

awk, grep, sed

l

Visualization Preprocessing

l

AfterGlow

l

LGL

l

Extraction

l

Chaosreader

l

Data Enrichment

l

geoiplookup

l

whois, gwhois

l

Visualization

l

Network Traffic

l

EtherApe

l

InetVis

l

tnv

l

Generic

l

AfterGlow

l

Graphviz

l

LGL Viewer

l

Mondrian

l

R Project

l

Treemap

slide-6
SLIDE 6

Highlights Upcoming 1.0.5α

l

Capture

l

Network Tools

l

Bro IDS

l

Processing

l

Integration

l

Splunk

l

NSM Console

l

PCAP manipulation/ extraction

l

ngrep

l

tcpxtract

l

tcpslice

l

tcpflow

l

Visualization

l

Network Traffic

l

FlowTag

l

INAV

l

NetGrok

l

Zenmap

l

Generic

l

NAZAR

l

Octave

Visualization

slide-7
SLIDE 7

Visualization

l Raffael Marty

l

“A picture is worth a thousand log records.” [2]

l Ben Shneiderman

l

“The purpose of viz is insight, not pictures.” [5]

Information Seeking Mantra [6]

Overview Zoom and Filter Details

  • n Demand
slide-8
SLIDE 8

Information Viz Process [2]

Interface Issue

l

Each visualization tool has its own file format interfaces

l

Data must be converted to match the import interfaces

l

These adapters are mostly self-written snippets of code

?

PCAP CSV Viz Tool 2 Viz Tool 3 TM3 Viz Tool 4 Viz Tool 1

? ?

slide-9
SLIDE 9

Walk-Through

User Interface

l Menu organized around Info Viz Process l Tools often cover more than one category

l

Afterglow Process, Visualize

l Additional tools/services

l

Apache, MySQL, NTP Capture Process Visualize

slide-10
SLIDE 10

PDF User Manual

l Content

l

Quick start guide

l

Network setup information

l

Tool usage examples

l

Links to online resource

l

Customizing DAVIX

User Manual in the Menu

l

The manual is browsable by chapter …

l

… or individual tool chapters

slide-11
SLIDE 11

Hands-on Lab

Overview

l

Lab built around Info Viz Process

l

DAVIX Tools

l

Processing

l

Wireshark / tshark [7]

l

p0f [8]

l

awk [9], sed, uniq

l

Snort [10]

l

Visualization

l

AfterGlow [11]

l

Graphviz [12]

l

Treemap [13]

Overview Filter Details

  • n Demand

Visualize Problem Definition

slide-12
SLIDE 12

Problem Definition

l Type of Traffic? l Network Topology?

l

Gateway?

l

Team Server?

l

Other Team Systems?

l Activities?

l

Communication Pattern?

l

Attacks?

Type of Traffic

slide-13
SLIDE 13

Overview - Background

l

CTF DEFCON 12

l

PCAP File

l

6 teams

l

1 server per team with vulnerable services

l

Many team member systems

l

Symmetrical setup for all teams.

Overview - Wireshark

l Basic statistics

l

54 MB PCAP file

l

Date 31.07.2004

l

41 min of traffic

l

100’000 packets

slide-14
SLIDE 14

Overview - Wireshark

l

Packets Protocols

l

Mostly IP

l

Mostly TCP

l

Some UDP

l

Traffic Volume

l

Mostly TCP

Overview - Wireshark

l TCP

l

Mostly HTTP

l

Some DCE RPC Windows

slide-15
SLIDE 15

Overview - Wireshark

l Traffic Shape

l

Constant at begin

l

Massive increase at the end.

tcp.port==80

Network Topology

slide-16
SLIDE 16

Visualize: AfterGlow / Graphviz

Possible Gateways Not a Gateway

Zoom & Filter - tshark

l CSV of source/destination IP to

source/destination MAC addresses

l

0.0.0.0,00:00:86:5b:e9:6a 0.0.0.0,00:04:5a:a2:d4:08 192.168.1.2,00:c0:95:e0:0e:af 192.168.3.2,00:c0:95:e0:0e:af 192.168.4.1,00:c0:95:e0:0e:af 192.168.4.152,00:09:6b:53:8a:81 192.168.4.153,00:c0:95:e0:0e:af ...

001_network_topology_gateway.sh

slide-17
SLIDE 17

Zoom & Filter - tshark

l

Extract IP addresses and their MAC addresses

l

tshark -r davix_workshop_captures.pcap

  • e ip.src -e eth.src -Tfields
  • E separator=, -R ip > ip_mac.csv

l

tshark -r davix_workshop_captures.pcap

  • e ip.dst -e eth.dst -Tfields
  • E separator=, -R ip >> ip_mac.csv

l

cat ip_mac.csv | sort | uniq > ip_mac_distinct.csv

001_network_topology_gateway.sh

Visualize: AfterGlow / Graphviz

l Visualize CSV file using AfterGlow

l

cat ip_mac_distinct.csv | afterglow.pl -t | neato -Tpng -o ip_mac_distinct.png

l View resulting image

l

gqview

001_network_topology_gateway.sh

slide-18
SLIDE 18

Visualize: AfterGlow / Graphviz

Possible Gateways Not a Gateway 001_network_topology_gateway.sh

Overview – p0f

l Results

l

192.168.4.1,FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) 192.168.4.1,FreeBSD 4.8-5.1 (or MacOS X 10.2-10.3) 192.168.4.1,Linux 2.4-2.6 192.168.4.1,OpenBSD 3.0-3.9 192.168.4.1,Windows 2000 SP4, XP SP1+ 192.168.4.1,Windows XP SP1+, 2000 SP3 192.168.4.152,Linux 2.4-2.6 192.168.4.153,Linux 2.4-2.6 192.168.4.154,Linux 2.4-2.6 192.168.4.157,Linux 2.4-2.6 192.168.4.159,Linux 2.4-2.6 192.168.4.160,Linux 2.4-2.6 192.168.4.45,Linux 2.4-2.6

Other teams come through NAT

002_network_topology_operating_system.sh

slide-19
SLIDE 19

Overview – p0f

l Identify Involved Operating Systems

l

p0f -f /etc/p0f/p0f.fp -s davix_workshop_captures.pcap -N | sed "s/ (up.*$//" | sed "s/:[0-9]* - /,/" | sort | uniq

002_network_topology_operating_system.sh

Visualize – Visio ;-)

l Topology Opponents

00:0B:5F:69:B2:01 CISCO 192.168.4.1 NAT IP 192.168.1.2 192.168.5.2 192.168.3.2 192.168.7.2 192.168.6.2 00:E0:98:08:F7:E2 192.168.4.153 Linux 00:C0:95:E0:0E:AF

slide-20
SLIDE 20

Visualize – Visio ;-)

l Our Team

192.168.4.2 WIN 192.168.4.159 Linux 192.168.4.33 Linux 192.168.4.154 Linux 192.168.4.45 Linux 192.168.4.35 ?Unix? 192.168.4.160 Linux 192.168.4.36 192.168.4.157 Linux 192.168.4.152 Linux 192.168.4.3 WIN 00:0B:5F:69:B2:01 CISCO 00:E0:98:08:F7:E2

Activities

Linked Graphs

slide-21
SLIDE 21

Visualize: AfterGlow / Graphviz

l Green

l

Our team

l Red

l

Other teams

l Yellow

l

NAT IP

l Blue

l

Neutral

003_activity_connections.sh

Zoom & Filter - tshark

l Extract source & destination IP addresses

l

tshark -r davix_workshop_captures.pcap

  • e ip.src -e ip.dst -Tfields -E separator=,
  • R ip > ipsrc_ipdst.csv

003_activity_connections.sh

slide-22
SLIDE 22

Visualize: AfterGlow / Graphviz

l Visualize CSV file using AfterGlow

l

cat ipsrc_ipdst.csv | afterglow.pl -c color1.properties -t | neato -Tpng -o ipsrc_ipdst.png

l View resulting image

l

gqview

003_activity_connections.sh

Visualize: AfterGlow / Graphviz

l AfterGlow color1.properties

l

color.source="khaki1" if ($fields[0]=~/^192\.168\.4\.1$/); color.source="palegreen" if ($fields[0]=~/^192\.168\.4\..*/); color.source="lightblue" if ($fields[0]=~/^0\.0\.0\.0$/); color.source="lightblue" if ($fields[0]=~/^255\.255\.255\.255$/); color.source="lightblue" if ($fields[0]=~/^198\.123\.30\.132$/); color.source="lightsalmon"

l

color.target="khaki1" if ($fields[1]=~/^192\.168\.4\.1$/); color.target="palegreen" if ($fields[1]=~/^192\.168\.4\..*/); color.target="lightblue" if ($fields[1]=~/^0\.0\.0\.0$/); color.target="lightblue" if ($fields[1]=~/^255\.255\.255\.255$/); color.target="lightblue" if ($fields[1]=~/^198\.123\.30\.132$/); color.target="lightsalmon"

003_activity_connections.sh

slide-23
SLIDE 23

Visualize: AfterGlow / Graphviz

l Green

l

Our team

l Red

l

Other teams

l Yellow

l

NAT IP

l Blue

l

Neutral

003_activity_connections.sh

Visualize: AfterGlow / Graphviz

l Zoom Image l 192.168.4.0/24

attacking other teams

l But who is the

most active IP?

003_activity_connections.sh

slide-24
SLIDE 24

Visualize: AfterGlow / Graphviz

l Size of nodes

dependent on volume of activity

004_activity_connections_volume.sh

Visualize: AfterGlow / Graphviz

l AfterGlow color2.properties

l

color.source="khaki1" if ($fields[0]=~/^192\.168\.4\.1$/); color.source="palegreen" if ($fields[0]=~/^192\.168\.4\..*/); color.source="lightblue" if ($fields[0]=~/^0\.0\.0\.0$/); color.source="lightblue" if ($fields[0]=~/^255\.255\.255\.255$/); color.source="lightblue" if ($fields[0]=~/^198\.123\.30\.132$/); color.source="lightsalmon" size.source=$sourceCount{$sourceName}; maxnodesize=1;

l

color.target="khaki1" if ($fields[1]=~/^192\.168\.4\.1$/); color.target="palegreen" if ($fields[1]=~/^192\.168\.4\..*/); color.target="lightblue" if ($fields[1]=~/^0\.0\.0\.0$/); color.target="lightblue" if ($fields[1]=~/^255\.255\.255\.255$/); color.target="lightblue" if ($fields[1]=~/^198\.123\.30\.132$/); color.target="lightsalmon" size.target=$targetCount{$targetName};

004_activity_connections_volume.sh

slide-25
SLIDE 25

Visualize: AfterGlow / Graphviz

l Visualize CSV file using AfterGlow

l

cat ipsrc_ipdst.csv | afterglow.pl -c color2.properties -t | neato -Tpng -o ipsrc_ipdst_2.png

l View resulting image

l

gqview

004_activity_connections_volume.sh

Visualize: AfterGlow / Graphviz

l Most active

talker is

l

192.168.4.160

004_activity_connections_volume.sh

slide-26
SLIDE 26

Activities

Communication Patterns

Visualize: Treemap

005_activity_connections_treemap.sh

slide-27
SLIDE 27

Visualize: Treemap

l

TM3 formatted file

l

IP Src IP Dest Count STRING STRING INTEGER 0.0.0.0 255.255.255.255 4 192.168.1.2 192.168.4.160 2833 192.168.3.2 192.168.4.153 2052 192.168.3.2 192.168.4.160 2 192.168.4.1 192.168.4.152 246 192.168.4.1 192.168.4.153 115 192.168.4.1 192.168.4.154 45 192.168.4.1 192.168.4.157 15 192.168.4.1 192.168.4.159 480 192.168.4.1 192.168.4.160 174 192.168.4.1 192.168.4.2 7022 192.168.4.1 192.168.4.3 39 192.168.4.152 192.168.4.1 273

005_activity_connections_treemap.sh

Zoom & Filter: tshark

l Extract source/destination IP & packet count

l

tshark -r davix_workshop_captures.pcap

  • e ip.src -e ip.dst -Tfields

–E separator=/t -R "ip" | sort | uniq -c | awk '{print $2 "," $3 "," $1}' > ipsrc_ipdst_pktcount.csv

005_activity_connections_treemap.sh

slide-28
SLIDE 28

Visualize: Treemap

l Convert CSV to TM3 format

l

cat ipsrc_ipdst_pktcount.csv | awk -F, 'BEGIN { print "IP Src\tIP Dest\tCount"; print "STRING\tSTRING\tINTEGER" } { print $1 "\t" $2 "\t" $3 }' > ipsrc_ipdst_pktcount.tm3

005_activity_connections_treemap.sh

Visualize: Treemap

l

Open TM3 file in Treemap

l

In Legend tab

l

Set Label to count

l

Set Size to count

l

Set Color to IP Dest

l

In Hierarchy tab

l

Add IP Src to Hierarchy

l

Add IP Dest to Hierarchy

005_activity_connections_treemap.sh

slide-29
SLIDE 29

Visualize: Treemap

005_activity_connections_treemap.sh

Contest

Attacks

slide-30
SLIDE 30

Zoom & Filter - Snort

l Extract Snort alerts

l

snort -c /etc/snort/snort.bleeding.conf

  • r davix_workshop_captures.pcap

l

Convert Snort alerts to CSV file

l

cat /var/log/snort/alert | snortalert2csv.pl "sip dip name" | sort | uniq

006_activity_attacks.sh

Zoom & Filter - Snort

l

Snort CSV file

l

192.168.4.1,192.168.4.2,(http_inspect) BARE BYTE UNICODE ENCODING 192.168.4.1,192.168.4.2,BLEEDING-EDGE PHPNuke general SQL injection attempt 192.168.4.1,192.168.4.2,BLEEDING-EDGE WEB-MISC Poison Null Byte 192.168.4.1,192.168.4.3,(http_inspect) OVERSIZE CHUNK ENCODING 192.168.4.1,192.168.4.3,BLEEDING-EDGE SCAN NMAP -sA (1) 192.168.4.152,192.168.7.2,(http_inspect) OVERSIZE CHUNK ENCODING 192.168.4.152,192.168.7.2,(http_inspect) WEBROOT DIRECTORY TRAVERSAL 192.168.4.152,192.168.7.2,BLEEDING-EDGE PHPNuke general SQL injection attempt 192.168.4.152,192.168.7.2,BLEEDING-EDGE SCAN NMAP -sA (1) 192.168.4.152,192.168.7.2,BLEEDING-EDGE WEB-MISC Poison Null Byte

006_activity_attacks.sh

slide-31
SLIDE 31

Visualize: Contest

l Modify existing workshop script

004_activity_connections_volume.sh and AfterGlow configuration color2.properties such that

l

the shape of the nodes represent attacking nodes.

l

the type of attack is visible in the linked graph.

006_activity_attacks.sh

Visualize: Contest

l Terms and Conditions

l

The best submission, which has solved exercise 1 AND 2, wins a copy of Raffael Marty's "Applied Security Visualization" book

l

Result submissions must

l

include a shell script that generates the graph

l

be handed in until January 6, 2009 23:59 UTC

l

be sent to jan dot monsch ät iplosion dot com

l

Legal recourse is excluded

006_activity_attacks.sh

slide-32
SLIDE 32

Q & A

www.secviz.org davix.secviz.org

References I

l

[1] Conti G. Security Data Visualization. No Starch Press, 2007.

l

[2] Marty R. Applied Security Visualization. Pearson Education, 2008.

l

[3] Matějíček T. SLAX 6. http://www.slax.org

l

[4] Monsch J. P., Marty R. DAVIX Manual 1.0.1. 2008. http://82.197.185.121/davix/release/davix-manual- 1.0.1.pdf

l

[5] Shneiderman B. Keynote VizSec. Boston: 2008

l

[6] Shneiderman B. The Eyes Have It: A Task by Data Type Taxonomy for Information Visualization. IEEE Visual Languages. pp. 336 – 343. 1996.

slide-33
SLIDE 33

References II

l

[7] Wireshark / tshark Manual http://www.wireshark.org/docs/wsug_html/

l

[8] p0f http://lcamtuf.coredump.cx/p0f.shtml

l

[9] awk Tutorial http://www.grymoire.com/Unix/Awk.html

l

[10] Snort Manual http://www.snort.org/docs/snort_htmanuals/htmanual_282/

l

[11] AfterGlow Manual http://afterglow.sourceforge.net/manual.html

l

[12] Graphviz Documentation http://www.graphviz.org/Documentation.php

l

[13] Treemap Manual http://www.cs.umd.edu/hcil/treemap/doc4.1/toc.html