IpMorph : Unification of OS fingerprinting defeating or, how to defeat common OSFP tools.

Similar documents
IpMorph : «vers la mystification de la prise d'empreinte de pile»

SinFP3. More Than a Complete Framework for Operating System Fingerprinting v1.0. Patrice

CIT 480: Securing Computer Systems

Building an IPS solution for inline usage during Red Teaming

inside: THE MAGAZINE OF USENIX & SAGE April 2002 Volume 27 Number 2 SECURITY A Remote Active OS Fingerprinting Tool Using ICMP BY OFIR ARKIN

Module 19 : Threats in Network What makes a Network Vulnerable?

Internet Layers. Physical Layer. Application. Application. Transport. Transport. Network. Network. Network. Network. Link. Link. Link.

TCP TCP/IP: TCP. TCP segment. TCP segment. TCP encapsulation. TCP encapsulation 1/25/2012. Network Security Lecture 6

ELEC5616 COMPUTER & NETWORK SECURITY

Faulds: A Non-Parametric Iterative Classifier for Internet-Wide OS Fingerprinting

Packet Header Formats

INF5290 Ethical Hacking. Lecture 3: Network reconnaissance, port scanning. Universitetet i Oslo Laszlo Erdödi

Michael Rash DEFCON 12 07/31/2004

K2289: Using advanced tcpdump filters

Covert channels in TCP/IP: attack and defence

Network Security: Scan

CSCI-GA Operating Systems. Networking. Hubertus Franke

EE 610 Part 2: Encapsulation and network utilities

Layer 4: UDP, TCP, and others. based on Chapter 9 of CompTIA Network+ Exam Guide, 4th ed., Mike Meyers

CSE/EE 461 Lecture 13 Connections and Fragmentation. TCP Connection Management

CS 356: Computer Network Architectures. Lecture 10: IP Fragmentation, ARP, and ICMP. Xiaowei Yang

ECE4110 Internetwork Programming. Introduction and Overview

CSC 574 Computer and Network Security. TCP/IP Security

Muhammad Farooq-i-Azam CHASE-2006 Lahore

A quick theorical introduction to network scanning. 23rd November 2005

Scanning. Course Learning Outcomes for Unit III. Reading Assignment. Unit Lesson UNIT III STUDY GUIDE

Dan Boneh, John Mitchell, Dawn Song. Denial of Service

D4.4 Device fingerprinting

8/19/2010. Computer Forensics Network forensics. Data sources. Monitoring

FOCUS on Intrusion Detection: Intrusion Detection Level Analysis of Nmap and Queso Page 1 of 6

History Page. Barracuda NextGen Firewall F

A practical approach for defeating Nmap OS-Fingerprinting

ARP, IP, TCP, UDP. CS 166: Introduction to Computer Systems Security 4/7/18 ARP, IP, TCP, UDP 1

Using Neural Networks for remote OS Identification

UDP and TCP. Introduction. So far we have studied some data link layer protocols such as PPP which are responsible for getting data

Transport Over IP. CSCI 690 Michael Hutt New York Institute of Technology

Interconnecting Networks with TCP/IP

Improving TCP/IP Security Through Randomization Without Sacrificing Interoperability. Michael J. Silbersack. November 26th, 2005

Transport: How Applications Communicate

I TCP 1/2. Internet TA: Connection-oriented (virtual circuit) Connectionless (datagram) (flow control) (congestion control) TCP Connection-oriented

New Tool And Technique For Remote Operating System Fingerprinting Full Paper

Lecture 6. Internet Security: How the Internet works and some basic vulnerabilities. Thursday 19/11/2015

Layered Networking and Port Scanning

Introduction to TCP/IP networking

AN TOÀN LỚP 4: TCP/IP ATTACKS NGUYEN HONG SON PTITHCM

6. The Transport Layer and protocols

A Robust Classifier for Passive TCP/IP Fingerprinting

Introduction to Internet. Ass. Prof. J.Y. Tigli University of Nice Sophia Antipolis

Robust Firewalls with OpenBSD and PF

Table of Contents. 1 Intrusion Detection Statistics 1-1 Overview 1-1 Displaying Intrusion Detection Statistics 1-1

Dongsoo S. Kim Electrical and Computer Engineering Indiana U. Purdue U. Indianapolis

ICS 451: Today's plan

Introduction to Networking. Operating Systems In Depth XXVII 1 Copyright 2017 Thomas W. Doeppner. All rights reserved.

Interconnecting Networks with TCP/IP. 2000, Cisco Systems, Inc. 8-1

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

Hands-On Ethical Hacking and Network Defense Chapter 5 Port Scanning

Hands-On Ethical Hacking and Network Defense Chapter 5 Port Scanning

Dan Lo Department of Computer Science and Software Engineering Southern Polytechnic State University

TCP/IP Protocol Suite

IP - The Internet Protocol. Based on the slides of Dr. Jorg Liebeherr, University of Virginia

Communication Systems DHCP

Just enough TCP/IP. Protocol Overview. Connection Types in TCP/IP. Control Mechanisms. Borrowed from my ITS475/575 class the ITL

Connections. Topics. Focus. Presentation Session. Application. Data Link. Transport. Physical. Network

TCP/IP Networking. Part 4: Network and Transport Layer Protocols

! ' ,-. +) +))+, /+*, 2 01/)*,, 01/)*, + 01/+*, ) 054 +) +++++))+, ) 05,-. /,*+), 01/-*+) + 01/.*+)

Transport Protocols. Raj Jain. Washington University in St. Louis

User Datagram Protocol

Network Security. Kitisak Jirawannakool Electronics Government Agency (public organisation)

The Transport Layer: TCP & Reliable Data Transfer

What this talk is about?

network security s642 computer security adam everspaugh

Information Network 1 TCP 1/2

TSIN02 - Internetworking

TSIN02 - Internetworking

NAVAL POSTGRADUATE SCHOOL THESIS

Configuring attack detection and prevention 1

Network Layer (4): ICMP

Chapter 7. The Transport Layer

Network Layer: Internet Protocol

TSIN02 - Internetworking

Index. ACK flag, 31 action, 29 activating PF, 5

TCP/IP Attack Lab. 1 Lab Overview. 2 Lab Environment. 2.1 Environment Setup. SEED Labs TCP/IP Attack Lab 1

(ICMP), RFC

Some of the slides borrowed from the book Computer Security: A Hands on Approach by Wenliang Du. TCP Attacks. Chester Rebeiro IIT Madras

Transparent TCP Timestamps draft-scheffenegger-tcpm-timestampnegotiation-03

Internet Control Message Protocol (ICMP), RFC 792. Prof. Lin Weiguo Copyleft 2009~2017, School of Computing, CUC

Introduction to routing in the Internet

Internet Protocol. Outline Introduction to Internet Protocol Header and address formats ICMP Tools CS 640 1

Sequence Number. Acknowledgment Number. Checksum. Urgent Pointer plus Sequence Number indicates end of some URGENT data in the packet

TSIN02 - Internetworking

Camouflaging Servers to Avoid Exploits Morgon Kanter and Stephen Taylor Thayer School of Engineering at Dartmouth College tr11-001

On Assessing the Impact of Ports Scanning on the Target Infrastructure

SinFP, Unication Of Active And Passive Operating System Fingerprinting

Applied Networks & Security

Hands-On Ethical Hacking and Network Defense

Unicornscan Documentation Getting Started

Design and Performance of the OpenBSD Stateful Packet Filter (pf)

CSE/EE 461 The Network Layer. Application Presentation Session Transport Network Data Link Physical

Networking Technologies and Applications

Active fingerprinting

Transcription:

IpMorph : Unification of OS fingerprinting defeating or, how to defeat common OSFP tools. Guillaume PRIGENT Florian VICHOT DIATEAM - Brest 1

Context Reason for creating IpMorph : Hynesim Project: We needed a way to disguise low-interaction guests (OpenVZ) as different, non-unix OSes. We already had some software components from previous projects It seemed fun (at the time) Guiding principles : Complete software, not just proof-of-concept Unification of spoofing mechanisms No network disruptions 2

OS fingerprinting typology Detection techniques Gathering Active Stack fingerprinting Passive Network sniffing thc-rut Xprobe2 Nmap SinFP Ring2 p0f SinFP Ettercap Banners Binaries ICMP Replies ISN Profile Headers Timeouts 3

OSFP Timeline 4

OSFP Timeline 4

Fingerprinting principles Active stack fingerprinting Nmap, SinFP, NETWORK A Advantages Quick, precise Drawbacks «Noisy», recognisable 5

Fingerprinting principles Active stack fingerprinting Nmap, SinFP, NETWORK A = A Advantages Quick, precise Drawbacks «Noisy», recognisable 5

Fingerprinting principles Passive stack fingerprinting NETWORK p0f, SinFP, B A Advantages stealthy Drawbacks slow, vague 6

Fingerprinting principles Passive stack fingerprinting NETWORK p0f, SinFP, B B = A = A Advantages stealthy Drawbacks slow, vague 6

IpMorph use-cases SYN SYN+ACK A B Passive OSFP + Virtual Machines SYN SYN+ACK Active OSFP + Virtual Machines A B 7

IpMorph use-cases SYN SYN+ACK A = B = A B Passive OSFP + Virtual Machines SYN SYN+ACK Active OSFP + Virtual Machines A B 7

IpMorph use-cases SYN SYN+ACK A = B = A B Passive OSFP + Virtual Machines SYN SYN+ACK Active OSFP + Virtual Machines A = B = A B 7

Spoofing state of the art Filtering Stealth patch : Unmaintained as of 2002, GNU/Linux kernel 2.2-2.4 Blackhole : FreeBSD, kernel options IPlog : Unmaintained as of 2001, *BSD Packet filter : OpenBSD Host /IP stack tweaking Ip Personality Fingerprint Fucker Fingerprint scrubber OSfuscate Host /IP stack replacement (proxy behaviour) Honeyd Packet purgatory / Morph 8

Software bricks Coded in C++ Userland application Tools: IpMorph (Core) IpMorph Controller IpMorph Personality Manager IpView (IpMorph GUI) Portability : GNU/Linux *BSD, Mac OS GPLv3 License 9

General architecture Exposed IP stack Context queue Protected IP stack Filter & Processor context tracker & data Scheduler Filter & Processor Filter context tracker & data Filter ICMP ICMP Filter ICMP context tracker & data ICMP Filter ICMP IP Frag. & Reass. IP Filter IP context tracker & data Frag. & Reass. IP Filter IP ETH (R)ARP Eth. Read Eth. Write (R)ARP translation processor Eth. Write (R)ARP Eth. Read ETH Interface layer Interface layer eth tap fd eth tap fd 10

General architecture Exposed IP stack Context queue Protected IP stack Filter & Processor context tracker & data Scheduler Filter & Processor Filter context tracker & data Filter ICMP ICMP Filter ICMP context tracker & data ICMP Filter ICMP IP Frag. & Reass. IP Filter IP context tracker & data Frag. & Reass. IP Filter IP ETH (R)ARP Eth. Read Eth. Write (R)ARP translation processor Eth. Write (R)ARP Eth. Read ETH Interface layer Interface layer eth tap fd eth tap fd 10

General architecture Exposed IP stack Context queue Protected IP stack Filter & Processor context tracker & data Scheduler Filter & Processor Filter context tracker & data Filter ICMP ICMP Filter ICMP context tracker & data ICMP Filter ICMP IP Frag. & Reass. IP Filter IP context tracker & data Frag. & Reass. IP Filter IP ETH (R)ARP Eth. Read Eth. Write (R)ARP translation processor Eth. Write (R)ARP Eth. Read ETH Interface layer Interface layer eth tap fd eth tap fd 10

General architecture Exposed IP stack Context queue Protected IP stack Filter & Processor context tracker & data Scheduler Filter & Processor Filter context tracker & data Filter ICMP ICMP Filter ICMP context tracker & data ICMP Filter ICMP IP Frag. & Reass. IP Filter IP context tracker & data Frag. & Reass. IP Filter IP ETH (R)ARP Eth. Read Eth. Write (R)ARP translation processor Eth. Write (R)ARP Eth. Read ETH Interface layer Interface layer eth tap fd eth tap fd 10

General architecture Exposed IP stack Context queue Protected IP stack Filter & Processor context tracker & data Scheduler Filter & Processor Filter context tracker & data Filter ICMP ICMP Filter ICMP context tracker & data ICMP Filter ICMP IP Frag. & Reass. IP Filter IP context tracker & data Frag. & Reass. IP Filter IP ETH (R)ARP Eth. Read Eth. Write (R)ARP translation processor Eth. Write (R)ARP Eth. Read ETH Interface layer Interface layer eth tap fd eth tap fd 10

General architecture Exposed IP stack Context queue Protected IP stack Filter & Processor context tracker & data Scheduler Filter & Processor Filter context tracker & data Filter ICMP ICMP Filter ICMP context tracker & data ICMP Filter ICMP IP Frag. & Reass. IP Filter IP context tracker & data Frag. & Reass. IP Filter IP ETH (R)ARP Eth. Read Eth. Write (R)ARP translation processor Eth. Write (R)ARP Eth. Read ETH Interface layer Interface layer eth tap fd eth tap fd 10

Nmap : Signature Format SP : ISN Predictability GCD : ISN Greatest Common Divisor ISR : ISN counter Rate TI : IP ID sequence generation algorithm II : ICMP IP ID sequence generation algorithm SS : Shared IP ID sequence Boolean TS : timestamp option algorithm O1-06: Options (ordering & values) DF: IP donʼt fragment bit T: IP initial timeto-live TG: IP initial time-to-live guess Fingerprint FreeBSD 7.0-CURRENT Class FreeBSD FreeBSD 7.X general purpose SEQ(SP=101-10D%GCD=<7%ISR=108-112%TI=RD%II=RI%TS=20 21 22) OPS(O1=M5B4NW8NNT11%O2=M578NW8NNT11%O3=M280NW8NNT11%O4=M5B4NW8NNT11%O5=M218NW8NNT11%O6=M109NNT11) WIN(W1=FFFF%W2=FFFF%W3=FFFF%W4=FFFF%W5=FFFF%W6=FFFF) ECN(R=Y%DF=Y%T=40%TG=40%W=FFFF%O=M5B4NW8%CC=N%Q=) T1(R=Y%DF=Y%T=40%TG=40%S=O%A=S+%F=AS%RD=0%Q=) T2(R=N) T3(R=Y%DF=Y%T=40%TG=40%W=FFFF%S=O%A=S+%F=AS%O=M109NW8NNT11%RD=0%Q=) T4(R=Y%DF=Y%T=40%TG=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=) T5(R=Y%DF=Y%T=40%TG=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=) T6(R=Y%DF=Y%T=40%TG=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=) T7(R=Y%DF=Y%T=40%TG=40%W=0%S=Z%A=S%F=AR%O=%RD=0%Q=) U1(DF=N%T=40%TG=40%TOS=0%IPL=38%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUL=G%RUD=G) IE(DFI=S%T=40%TG=40%TOSI=S%CD=S%SI=S%DLI=S) W1-W6 : initial win size W: initial win size S: seq. number A: ack. number F: Flags RD: RST data checksum Q: misc. quirks RIPCK: Returned probe IP checksum value RUCK: Returned probe checksum TOS: IP type of service IPL: IP total length UN: Unused port unreach. field nonzero RIPL: Returned probe IP total length value RID: Returned probe IP ID value RUL: Returned probe length 11

Nmap : Spoofing test RD SP : ISN Predictability GCD : ISN Greatest Common Divisor ISR : ISN counter Rate TI : IP ID sequence generation algorithm II : ICMP IP ID sequence generation algorithm RD: RST data checksum NETWORK SYN+RST packet on closed port Headers... Flags: RST... Data: «Port closed etc...» CRC32(«Port closed etc...») = 0x0af1a1cb Reverse_CRC32(0x0af1a1cb) = 0x201111b8 12

Nmap : Spoofing test RD SP : ISN Predictability GCD : ISN Greatest Common Divisor ISR : ISN counter Rate TI : IP ID sequence generation algorithm II : ICMP IP ID sequence generation algorithm RD: RST data checksum NETWORK SYN+RST packet on closed port Port closed Headers... Flags: RST... Data: «Port closed etc...» CRC32(«Port closed etc...») = 0x0af1a1cb Reverse_CRC32(0x0af1a1cb) = 0x201111b8 12

Nmap : Spoofing tests TI / II SP : ISN Predictability GCD : ISN Greatest Common Divisor ISR : ISN counter Rate RD: RST data checksum TI : IP ID sequence generation algorithm II : ICMP IP ID sequence generation algorithm Typical IP packet IP Headers:... IP ID... Data Possible algorithms: Always zero Constant Constant increment... We keep 2 counters: _lastipidtcp _lastipidother 13

Nmap : Spoofing tests SP / GCD / ISR RD: RST data checksum TI : IP ID sequence generation algorithm II : ICMP IP ID sequence generation algorithm SP : ISN Predictability GCD : ISN Greatest Common Divisor ISR : ISN counter Rate Typical Header IP Headers Sequence...... number Nmaps send 6 probes, at a 550ms interval. Get all 6 ISNs : Compute differences : Compute mean, stddev and GCD : Seq 1 Seq 2 Seq 3 Seq 4 Seq 5 Seq 6 1 }} 2 3 4 5 ISR SP GCD 14

Nmap : Spoofing tests SP / GCD / ISR RD: RST data checksum TI : IP ID sequence generation algorithm II : ICMP IP ID sequence generation algorithm SP : ISN Predictability GCD : ISN Greatest Common Divisor ISR : ISN counter Rate SP What we have What we want Box-Muller points ISN candidates GCD compatible values Mean from ISR 15

Nmap : Spoofing tests SP / GCD / ISR RD: RST data checksum TI : IP ID sequence generation algorithm II : ICMP IP ID sequence generation algorithm SP : ISN Predictability GCD : ISN Greatest Common Divisor ISR : ISN counter Rate SP What we have What we want Box-Muller points ISN candidates GCD compatible values Mean from ISR 15

SinFP : How is the spoofing done? Binary : heuristic0, heuristic1, heuristic2 { Constants: TTL, ID, DF seq and ack TcpFlags : heuristic0, heuristic1, heuristic2 Offset 0-3 4-7 8-11 12-15 16-19 20-23 24-27 28-31 0 Source port Destination Port 32 Sequence number TcpWindow : heuristic0, heuristic1, heuristic2 64 Acknowledgment number 96 Data Offset Reserved Flags Window Size 128 Checksum Urgent Pointer TcpMss : heuristic0, heuristic1, heuristic2 160... Options... TcpOptions : heuristic0, heuristic1, heuristic2 16

p0f : Signature format Window Size Initial TTL IP Donʼt Fragment Bit SYN Packet Size 8192:128:1:52:M*,W8,N,N,N,S:.:Windows:Vista (beta) Options Quirks OS System Class OS Name Version 2.0.8 (2006) 6 parameters analyzed Only on SYN packets (default DB = p0f.fp) Actually can analyze other type of packets, but very few signatures available (experimental) 17

Ring2 - congestion timeouts spoofing 18

Future June 2009 SSTIC 2009 First demo «Beta release» 0.1 (available on website) End 2009 Beginning 2010 Refactoring (leaner, faster, easier to use) PersonalityManager, various tools... Version 0.2 will be available on website too Documentation... Possibly, integrate application-level scrubbers (DNS, SMB, DHCP, )? 19

Personality Manager 20

Personality Manager 20

Demo tap0 192.168.10.73 Nmap, Xprobe2, SinFP, P0f LAN eth0 192.168.10.110 Linux Ubuntu 8.04 Demoʼs scenario Configuration Active Fingerprinting Passive Fingerprinting 1 - Interface tap0 2 - VirtualBox 3- IpMorph 4 - Xprobe2 5 - Nmap 6 - SinFp as active 7 - SinFp as passive 8 - p0f 21

Demo XProbe2 22

Demo XProbe2 22

Demo Nmap 23

Demo Nmap 23

Demo SinFP active 24

Demo SinFP active 24

Demo SinFP passive 25

Demo SinFP passive 25

Demo p0f 26

Thank you for listening! Questions? 27