SlideShare uma empresa Scribd logo
1 de 14
Baixar para ler offline
Identifying hosts with natfilterd
                         A TCP timestamp analysis based solution


                                       Georg Wicherski

                                     UMIC LuFG IT-Security,
                                     RWTH Aachen University


                                         2011-02-14




Wicherski (RWTH Aachen University)          natfilterd             2011-02-14   1/9
Motivation

        SNAT      1   makes individual host identification hard
               All hosts behind the same SNAT gateway appear to have the same IP
               address

        In Capture-the-Flag contests2 , SNAT is used to mix other teams’
        hosts and the gameserver to prevent trivial traffic filtering of
        opponent teams’ attacks
               We need to identify individual attacking hosts and drop their traffic

        Some people use botnet sinkholing3 to estimate the size of a threat
               Hosts behind SNAT are counted as a single infection if no application
               layer ID is available

    1
      Source Network Address Translation
    2
      http://www.cipher-ctf.org/CaptureTheFlag.php
    3
      e.g. http://www.cs.ucsb.edu/~kemm/courses/cs177/torpig.pdf
Wicherski (RWTH Aachen University)        natfilterd                     2011-02-14   2/9
TCP Timestamps

       The TCP protocol allows for options in the header (RFC 793)
       TCP timestamps are such an extension option to optimize
       performance (RFC 1323)




Wicherski (RWTH Aachen University)   natfilterd                  2011-02-14   3/9
TCP Timestamps

       The TCP protocol allows for options in the header (RFC 793)
       TCP timestamps are such an extension option to optimize
       performance (RFC 1323)

       Support is indicated by supplying a timestamp option header with
       zero timestamp
               If both hosts support it, timestamps are exchanged




Wicherski (RWTH Aachen University)       natfilterd                 2011-02-14   3/9
Timestamp Generation


RFC 1323 – 3.3 The RTTM Mechanism
       The timestamp value to be sent in TSval is to be obtained from
       a (virtual) clock that we call the ”timestamp clock”. Its values
       must be at least approximately proportional to real time, in order
       to measure actual RTT.




Wicherski (RWTH Aachen University)   natfilterd                   2011-02-14   4/9
Timestamp Generation


RFC 1323 – 3.3 The RTTM Mechanism
       The timestamp value to be sent in TSval is to be obtained from
       a (virtual) clock that we call the ”timestamp clock”. Its values
       must be at least approximately proportional to real time, in order
       to measure actual RTT.




                  TSval = (wallclock − boottime ) ∗     tickscale
                                     host specific     kernel specific




Wicherski (RWTH Aachen University)   natfilterd                        2011-02-14   4/9
Fingerprinting Hosts

First documented in Phrack #63 0x03-2: “TCP Timestamp To count
Hosts behind NAT”
       Track TCP connections: each packet belongs to the same host
       Approximate linear regression equation y = c0 + x ∗ c1 from set of
       points (wallclock, TSval)
               If distance to next host equation below threshold, update old equation
               Otherwise add new host to database
       Once a host is in the database, try to match new packets against it in
       realtime




Wicherski (RWTH Aachen University)       natfilterd                      2011-02-14   5/9
Fingerprinting Hosts

First documented in Phrack #63 0x03-2: “TCP Timestamp To count
Hosts behind NAT”
       Track TCP connections: each packet belongs to the same host
       Approximate linear regression equation y = c0 + x ∗ c1 from set of
       points (wallclock, TSval)
               If distance to next host equation below threshold, update old equation
               Otherwise add new host to database
       Once a host is in the database, try to match new packets against it in
       realtime

       Without optimizations:
               O(n2 ) for adding n hosts with significant c for distance calculation
               O(n) for matching one packet against n host with significant c



Wicherski (RWTH Aachen University)        natfilterd                      2011-02-14   5/9
Introducing “Rate Classes”



                  TSval = (wallclock − boottime ) ∗         tickscale
                                         host specific    kernel specific

       Windows: Apparently uses kernel equivalent of GetTickCount()
                                                1
       Linux: Uses jiffies, incremented every HZ seconds
               Common values for HZ are 100, 250, 1000
       OpenBSD, FreeBSD, NetBSD: Did not test

       Finite and sufficiently small set of r different values for tickscale
               Round value to 0.01ms granularity / resolution




Wicherski (RWTH Aachen University)       natfilterd                       2011-02-14   6/9
Optimizations by “Rate Classes”


                                                      x2 − x1
                                     dist =
                                              sin (tan−1 (tickscale))




Wicherski (RWTH Aachen University)                natfilterd            2011-02-14   7/9
Optimizations by “Rate Classes”


                                                      x2 − x1
                                     dist =
                                              sin (tan−1 (tickscale))

Algorithm for finding host for connection                                  O(log2 n)
    min ← ∞
    rateclass ← rateclasses.hashlookup(round(tickscale))
    neighbours ← rateclass.btree(xnormalized )                       {O(log2 n)}
    for all neighbour ∈ neighbours do
      if dist(neighbour .x, xnormalized , rateclass.rate) < min then
         min ← neighbour , dist
      end if
    end for
    return min


Wicherski (RWTH Aachen University)                natfilterd            2011-02-14   7/9
Optimizations by “Rate Classes” (contd.)


Algorithm for matching single packets                                O(log2 n)
    min ← ∞
    for all rateclass ∈ rateclasses do
      neighbours ← rateclass.btree(xnormalized )                     {O(log2 n)}
      for all neighbour ∈ neighbours do
         if dist(neighbour .x, xnormalized , rateclass.rate) < min then
            min ← neighbour , dist
         end if
      end for
    end for
    return min




Wicherski (RWTH Aachen University)   natfilterd                    2011-02-14   8/9
natfilterd DEMO




Wicherski (RWTH Aachen University)   natfilterd   2011-02-14   9/9
natfilterd DEMO


                                     Questions?




Wicherski (RWTH Aachen University)      natfilterd   2011-02-14   9/9

Mais conteúdo relacionado

Mais procurados

Zeromq anatomy & jeromq
Zeromq anatomy & jeromqZeromq anatomy & jeromq
Zeromq anatomy & jeromqDongmin Yu
 
Overview of ZeroMQ
Overview of ZeroMQOverview of ZeroMQ
Overview of ZeroMQpieterh
 
Network Simulator Tutorial
Network Simulator TutorialNetwork Simulator Tutorial
Network Simulator Tutorialcscarcas
 
Exploitation of counter overflows in the Linux kernel
Exploitation of counter overflows in the Linux kernelExploitation of counter overflows in the Linux kernel
Exploitation of counter overflows in the Linux kernelVitaly Nikolenko
 
Protocol implementation on NS2
Protocol implementation on NS2Protocol implementation on NS2
Protocol implementation on NS2amreshrai02
 
NS-2 Tutorial
NS-2 TutorialNS-2 Tutorial
NS-2 Tutorialcode453
 
Stream ciphers presentation
Stream ciphers presentationStream ciphers presentation
Stream ciphers presentationdegarden
 
Botnet detection using cluster ensemble with cart
Botnet detection using cluster ensemble with cartBotnet detection using cluster ensemble with cart
Botnet detection using cluster ensemble with cartTrinh Phuc
 
Introduction to NS2 - Cont..
Introduction to NS2 - Cont..Introduction to NS2 - Cont..
Introduction to NS2 - Cont..cscarcas
 
5 stream ciphers
5 stream ciphers5 stream ciphers
5 stream ciphersHarish Sahu
 
Seattle Scalability Meetup 6-26-13
Seattle Scalability Meetup 6-26-13Seattle Scalability Meetup 6-26-13
Seattle Scalability Meetup 6-26-13specialk29
 
Network emulator
Network emulatorNetwork emulator
Network emulatorjeromy fu
 
Learning Erlang (from a Prolog dropout's perspective)
Learning Erlang (from a Prolog dropout's perspective)Learning Erlang (from a Prolog dropout's perspective)
Learning Erlang (from a Prolog dropout's perspective)elliando dias
 
Specializing the Data Path - Hooking into the Linux Network Stack
Specializing the Data Path - Hooking into the Linux Network StackSpecializing the Data Path - Hooking into the Linux Network Stack
Specializing the Data Path - Hooking into the Linux Network StackKernel TLV
 

Mais procurados (19)

Zeromq anatomy & jeromq
Zeromq anatomy & jeromqZeromq anatomy & jeromq
Zeromq anatomy & jeromq
 
Tut hemant ns2
Tut hemant ns2Tut hemant ns2
Tut hemant ns2
 
Overview of ZeroMQ
Overview of ZeroMQOverview of ZeroMQ
Overview of ZeroMQ
 
Venkat ns2
Venkat ns2Venkat ns2
Venkat ns2
 
Network Simulator Tutorial
Network Simulator TutorialNetwork Simulator Tutorial
Network Simulator Tutorial
 
Lec11 timing
Lec11 timingLec11 timing
Lec11 timing
 
Exploitation of counter overflows in the Linux kernel
Exploitation of counter overflows in the Linux kernelExploitation of counter overflows in the Linux kernel
Exploitation of counter overflows in the Linux kernel
 
Protocol implementation on NS2
Protocol implementation on NS2Protocol implementation on NS2
Protocol implementation on NS2
 
NS-2 Tutorial
NS-2 TutorialNS-2 Tutorial
NS-2 Tutorial
 
Stream ciphers presentation
Stream ciphers presentationStream ciphers presentation
Stream ciphers presentation
 
Botnet detection using cluster ensemble with cart
Botnet detection using cluster ensemble with cartBotnet detection using cluster ensemble with cart
Botnet detection using cluster ensemble with cart
 
Introduction to NS2 - Cont..
Introduction to NS2 - Cont..Introduction to NS2 - Cont..
Introduction to NS2 - Cont..
 
~Ns2~
~Ns2~~Ns2~
~Ns2~
 
FreeRTOS
FreeRTOSFreeRTOS
FreeRTOS
 
5 stream ciphers
5 stream ciphers5 stream ciphers
5 stream ciphers
 
Seattle Scalability Meetup 6-26-13
Seattle Scalability Meetup 6-26-13Seattle Scalability Meetup 6-26-13
Seattle Scalability Meetup 6-26-13
 
Network emulator
Network emulatorNetwork emulator
Network emulator
 
Learning Erlang (from a Prolog dropout's perspective)
Learning Erlang (from a Prolog dropout's perspective)Learning Erlang (from a Prolog dropout's perspective)
Learning Erlang (from a Prolog dropout's perspective)
 
Specializing the Data Path - Hooking into the Linux Network Stack
Specializing the Data Path - Hooking into the Linux Network StackSpecializing the Data Path - Hooking into the Linux Network Stack
Specializing the Data Path - Hooking into the Linux Network Stack
 

Semelhante a Identifying hosts with natfilterd

Introduction to Computer Networks
Introduction to Computer NetworksIntroduction to Computer Networks
Introduction to Computer NetworksVenkatesh Iyer
 
Intro 2 Computer Networks
Intro 2 Computer NetworksIntro 2 Computer Networks
Intro 2 Computer Networksrakeshgoswami
 
SHA-3, Keccak & Sponge function
SHA-3, Keccak & Sponge functionSHA-3, Keccak & Sponge function
SHA-3, Keccak & Sponge functionGennaro Caccavale
 
Tsn linux elce17
Tsn linux elce17Tsn linux elce17
Tsn linux elce17henrikau
 
Peer-to-Peer Streaming Based on Network Coding Decreases Packet Jitter
Peer-to-Peer Streaming Based on Network Coding Decreases Packet JitterPeer-to-Peer Streaming Based on Network Coding Decreases Packet Jitter
Peer-to-Peer Streaming Based on Network Coding Decreases Packet JitterAlpen-Adria-Universität
 
Installation of NS2 and Congestion Control
Installation of NS2 and Congestion ControlInstallation of NS2 and Congestion Control
Installation of NS2 and Congestion Controlnanmagandh
 
LF_OVS_17_OVS/OVS-DPDK connection tracking for Mobile usecases
LF_OVS_17_OVS/OVS-DPDK connection tracking for Mobile usecasesLF_OVS_17_OVS/OVS-DPDK connection tracking for Mobile usecases
LF_OVS_17_OVS/OVS-DPDK connection tracking for Mobile usecasesLF_OpenvSwitch
 
Analytical Research of TCP Variants in Terms of Maximum Throughput
Analytical Research of TCP Variants in Terms of Maximum ThroughputAnalytical Research of TCP Variants in Terms of Maximum Throughput
Analytical Research of TCP Variants in Terms of Maximum ThroughputIJLT EMAS
 
Mncs 16-08-3주-변승규-opportunistic flooding in low-duty-cycle wireless sensor ne...
Mncs 16-08-3주-변승규-opportunistic flooding in low-duty-cycle wireless sensor ne...Mncs 16-08-3주-변승규-opportunistic flooding in low-duty-cycle wireless sensor ne...
Mncs 16-08-3주-변승규-opportunistic flooding in low-duty-cycle wireless sensor ne...Seung-gyu Byeon
 
Fine grained asynchronism for pseudo-spectral codes - with application to tur...
Fine grained asynchronism for pseudo-spectral codes - with application to tur...Fine grained asynchronism for pseudo-spectral codes - with application to tur...
Fine grained asynchronism for pseudo-spectral codes - with application to tur...Ganesan Narayanasamy
 
Research Inventy : International Journal of Engineering and Science
Research Inventy : International Journal of Engineering and ScienceResearch Inventy : International Journal of Engineering and Science
Research Inventy : International Journal of Engineering and Scienceresearchinventy
 
Module 3- transport_layer .pptx
Module 3- transport_layer           .pptxModule 3- transport_layer           .pptx
Module 3- transport_layer .pptxhariprasad279825
 
Capturing NIC and Kernel TX and RX Timestamps for Packets in Go
Capturing NIC and Kernel TX and RX Timestamps for Packets in GoCapturing NIC and Kernel TX and RX Timestamps for Packets in Go
Capturing NIC and Kernel TX and RX Timestamps for Packets in GoScyllaDB
 
Lecture 7: Recurrent Neural Networks
Lecture 7: Recurrent Neural NetworksLecture 7: Recurrent Neural Networks
Lecture 7: Recurrent Neural NetworksSang Jun Lee
 
E XOR opportunistic routing for multi hop networks
E XOR opportunistic routing for multi hop networks E XOR opportunistic routing for multi hop networks
E XOR opportunistic routing for multi hop networks shimaa Kotb Saif
 
Use of NS-2 to Simulate MANET Routing Algorithms
Use of NS-2 to Simulate MANET Routing AlgorithmsUse of NS-2 to Simulate MANET Routing Algorithms
Use of NS-2 to Simulate MANET Routing AlgorithmsGiancarlo Romeo
 
Minimizing Hidden Node Problem in Vehicular Ad-hoc Network (VANET)
Minimizing Hidden Node Problem in Vehicular Ad-hoc Network (VANET)Minimizing Hidden Node Problem in Vehicular Ad-hoc Network (VANET)
Minimizing Hidden Node Problem in Vehicular Ad-hoc Network (VANET)Sanjiv Pradhan
 

Semelhante a Identifying hosts with natfilterd (20)

Introduction to Computer Networks
Introduction to Computer NetworksIntroduction to Computer Networks
Introduction to Computer Networks
 
Intro 2 Computer Networks
Intro 2 Computer NetworksIntro 2 Computer Networks
Intro 2 Computer Networks
 
SHA-3, Keccak & Sponge function
SHA-3, Keccak & Sponge functionSHA-3, Keccak & Sponge function
SHA-3, Keccak & Sponge function
 
Tsn linux elce17
Tsn linux elce17Tsn linux elce17
Tsn linux elce17
 
Peer-to-Peer Streaming Based on Network Coding Decreases Packet Jitter
Peer-to-Peer Streaming Based on Network Coding Decreases Packet JitterPeer-to-Peer Streaming Based on Network Coding Decreases Packet Jitter
Peer-to-Peer Streaming Based on Network Coding Decreases Packet Jitter
 
Installation of NS2 and Congestion Control
Installation of NS2 and Congestion ControlInstallation of NS2 and Congestion Control
Installation of NS2 and Congestion Control
 
Network Coding in Disruption Tolerant Network (DTN)
Network Coding in Disruption Tolerant Network (DTN)Network Coding in Disruption Tolerant Network (DTN)
Network Coding in Disruption Tolerant Network (DTN)
 
LF_OVS_17_OVS/OVS-DPDK connection tracking for Mobile usecases
LF_OVS_17_OVS/OVS-DPDK connection tracking for Mobile usecasesLF_OVS_17_OVS/OVS-DPDK connection tracking for Mobile usecases
LF_OVS_17_OVS/OVS-DPDK connection tracking for Mobile usecases
 
Analytical Research of TCP Variants in Terms of Maximum Throughput
Analytical Research of TCP Variants in Terms of Maximum ThroughputAnalytical Research of TCP Variants in Terms of Maximum Throughput
Analytical Research of TCP Variants in Terms of Maximum Throughput
 
Mncs 16-08-3주-변승규-opportunistic flooding in low-duty-cycle wireless sensor ne...
Mncs 16-08-3주-변승규-opportunistic flooding in low-duty-cycle wireless sensor ne...Mncs 16-08-3주-변승규-opportunistic flooding in low-duty-cycle wireless sensor ne...
Mncs 16-08-3주-변승규-opportunistic flooding in low-duty-cycle wireless sensor ne...
 
Fine grained asynchronism for pseudo-spectral codes - with application to tur...
Fine grained asynchronism for pseudo-spectral codes - with application to tur...Fine grained asynchronism for pseudo-spectral codes - with application to tur...
Fine grained asynchronism for pseudo-spectral codes - with application to tur...
 
Research Inventy : International Journal of Engineering and Science
Research Inventy : International Journal of Engineering and ScienceResearch Inventy : International Journal of Engineering and Science
Research Inventy : International Journal of Engineering and Science
 
Module 3- transport_layer .pptx
Module 3- transport_layer           .pptxModule 3- transport_layer           .pptx
Module 3- transport_layer .pptx
 
Cassandra勉強会
Cassandra勉強会Cassandra勉強会
Cassandra勉強会
 
Arvindsujeeth scaladays12
Arvindsujeeth scaladays12Arvindsujeeth scaladays12
Arvindsujeeth scaladays12
 
Capturing NIC and Kernel TX and RX Timestamps for Packets in Go
Capturing NIC and Kernel TX and RX Timestamps for Packets in GoCapturing NIC and Kernel TX and RX Timestamps for Packets in Go
Capturing NIC and Kernel TX and RX Timestamps for Packets in Go
 
Lecture 7: Recurrent Neural Networks
Lecture 7: Recurrent Neural NetworksLecture 7: Recurrent Neural Networks
Lecture 7: Recurrent Neural Networks
 
E XOR opportunistic routing for multi hop networks
E XOR opportunistic routing for multi hop networks E XOR opportunistic routing for multi hop networks
E XOR opportunistic routing for multi hop networks
 
Use of NS-2 to Simulate MANET Routing Algorithms
Use of NS-2 to Simulate MANET Routing AlgorithmsUse of NS-2 to Simulate MANET Routing Algorithms
Use of NS-2 to Simulate MANET Routing Algorithms
 
Minimizing Hidden Node Problem in Vehicular Ad-hoc Network (VANET)
Minimizing Hidden Node Problem in Vehicular Ad-hoc Network (VANET)Minimizing Hidden Node Problem in Vehicular Ad-hoc Network (VANET)
Minimizing Hidden Node Problem in Vehicular Ad-hoc Network (VANET)
 

Identifying hosts with natfilterd

  • 1. Identifying hosts with natfilterd A TCP timestamp analysis based solution Georg Wicherski UMIC LuFG IT-Security, RWTH Aachen University 2011-02-14 Wicherski (RWTH Aachen University) natfilterd 2011-02-14 1/9
  • 2. Motivation SNAT 1 makes individual host identification hard All hosts behind the same SNAT gateway appear to have the same IP address In Capture-the-Flag contests2 , SNAT is used to mix other teams’ hosts and the gameserver to prevent trivial traffic filtering of opponent teams’ attacks We need to identify individual attacking hosts and drop their traffic Some people use botnet sinkholing3 to estimate the size of a threat Hosts behind SNAT are counted as a single infection if no application layer ID is available 1 Source Network Address Translation 2 http://www.cipher-ctf.org/CaptureTheFlag.php 3 e.g. http://www.cs.ucsb.edu/~kemm/courses/cs177/torpig.pdf Wicherski (RWTH Aachen University) natfilterd 2011-02-14 2/9
  • 3. TCP Timestamps The TCP protocol allows for options in the header (RFC 793) TCP timestamps are such an extension option to optimize performance (RFC 1323) Wicherski (RWTH Aachen University) natfilterd 2011-02-14 3/9
  • 4. TCP Timestamps The TCP protocol allows for options in the header (RFC 793) TCP timestamps are such an extension option to optimize performance (RFC 1323) Support is indicated by supplying a timestamp option header with zero timestamp If both hosts support it, timestamps are exchanged Wicherski (RWTH Aachen University) natfilterd 2011-02-14 3/9
  • 5. Timestamp Generation RFC 1323 – 3.3 The RTTM Mechanism The timestamp value to be sent in TSval is to be obtained from a (virtual) clock that we call the ”timestamp clock”. Its values must be at least approximately proportional to real time, in order to measure actual RTT. Wicherski (RWTH Aachen University) natfilterd 2011-02-14 4/9
  • 6. Timestamp Generation RFC 1323 – 3.3 The RTTM Mechanism The timestamp value to be sent in TSval is to be obtained from a (virtual) clock that we call the ”timestamp clock”. Its values must be at least approximately proportional to real time, in order to measure actual RTT. TSval = (wallclock − boottime ) ∗ tickscale host specific kernel specific Wicherski (RWTH Aachen University) natfilterd 2011-02-14 4/9
  • 7. Fingerprinting Hosts First documented in Phrack #63 0x03-2: “TCP Timestamp To count Hosts behind NAT” Track TCP connections: each packet belongs to the same host Approximate linear regression equation y = c0 + x ∗ c1 from set of points (wallclock, TSval) If distance to next host equation below threshold, update old equation Otherwise add new host to database Once a host is in the database, try to match new packets against it in realtime Wicherski (RWTH Aachen University) natfilterd 2011-02-14 5/9
  • 8. Fingerprinting Hosts First documented in Phrack #63 0x03-2: “TCP Timestamp To count Hosts behind NAT” Track TCP connections: each packet belongs to the same host Approximate linear regression equation y = c0 + x ∗ c1 from set of points (wallclock, TSval) If distance to next host equation below threshold, update old equation Otherwise add new host to database Once a host is in the database, try to match new packets against it in realtime Without optimizations: O(n2 ) for adding n hosts with significant c for distance calculation O(n) for matching one packet against n host with significant c Wicherski (RWTH Aachen University) natfilterd 2011-02-14 5/9
  • 9. Introducing “Rate Classes” TSval = (wallclock − boottime ) ∗ tickscale host specific kernel specific Windows: Apparently uses kernel equivalent of GetTickCount() 1 Linux: Uses jiffies, incremented every HZ seconds Common values for HZ are 100, 250, 1000 OpenBSD, FreeBSD, NetBSD: Did not test Finite and sufficiently small set of r different values for tickscale Round value to 0.01ms granularity / resolution Wicherski (RWTH Aachen University) natfilterd 2011-02-14 6/9
  • 10. Optimizations by “Rate Classes” x2 − x1 dist = sin (tan−1 (tickscale)) Wicherski (RWTH Aachen University) natfilterd 2011-02-14 7/9
  • 11. Optimizations by “Rate Classes” x2 − x1 dist = sin (tan−1 (tickscale)) Algorithm for finding host for connection O(log2 n) min ← ∞ rateclass ← rateclasses.hashlookup(round(tickscale)) neighbours ← rateclass.btree(xnormalized ) {O(log2 n)} for all neighbour ∈ neighbours do if dist(neighbour .x, xnormalized , rateclass.rate) < min then min ← neighbour , dist end if end for return min Wicherski (RWTH Aachen University) natfilterd 2011-02-14 7/9
  • 12. Optimizations by “Rate Classes” (contd.) Algorithm for matching single packets O(log2 n) min ← ∞ for all rateclass ∈ rateclasses do neighbours ← rateclass.btree(xnormalized ) {O(log2 n)} for all neighbour ∈ neighbours do if dist(neighbour .x, xnormalized , rateclass.rate) < min then min ← neighbour , dist end if end for end for return min Wicherski (RWTH Aachen University) natfilterd 2011-02-14 8/9
  • 13. natfilterd DEMO Wicherski (RWTH Aachen University) natfilterd 2011-02-14 9/9
  • 14. natfilterd DEMO Questions? Wicherski (RWTH Aachen University) natfilterd 2011-02-14 9/9