NetworkTiming
Protocol Security
Supervisor: Michael Schukat
Interns: Andrew McGarry and Declan Brennan
Summer 2014 NUIG Research Practicum
Overview
• Background Information
• Project Goals
• NetworkTiming Protocol
• Stage 1
• Concept
• SoftwareTools
• Troubleshooting
• Stage 2 Research
• Authenticated NTP
• Executing the Attack
• Summary
Background
 “Measurement and control applications are increasingly using distributed system
technologies such as network communication, local computing, and distributed
objects.Without a standardized protocol for synchronizing the clocks in these devices,
it is unlikely that the benefits will be realized in the multivendor system component
market” (IEEE 1588, 2008).
 IEEE 1588 describes PTP, a protocol capable of greater time precision than NTP
 GPS or cellular network unusable in many cases
 However, NTP in its base form does not authenticate server/client
 Authenticated NTP used to provide secure NTP connections.
 Quite widespread, although with advent of smart grids, could be used as attack vector against
critical services.
 Has known security flaws (Autokey cookie is only 32 bits long, so it can be brute forced)
Project Goals
Main: to explore and demonstrate a security flaw associated with Authenticated NTP
Subgoals:
Exploration:
• Learn about NetworkTiming protocol, it’s importance, how it functions
• Utilize tools commonly used in computer science research
• Introduce ourselves to computer networking and network security
Demonstration
• Stage 1: set up a computer network which features an NTP client/server relationship and the
capability to monitor network traffic
• Stage 2: conduct a Man-in-the-Middle (MitM) attack within this network with the goal of
fooling NTP client into accepting attacker as legitimate NTP server
What is NTP?
 Abbreviation for 'NetworkTime Protocol'
 NTP is used for clock synchronization across data networks
 Its purpose is to synchronize the clocks participating hosts to within a few
milliseconds of UTC
 NTP utilizes layers known as strata. Each successive stratum is further and
further away from high-precision timekeeping devices
 NTP is often used in situations where accurate time stamps are essential
 NTP was originally conceived by David Mills at the University of Delaware in
1985, and is thus one of the oldest network protocols still in use
Stage 1: Concept
 Original concept was to establish an NTP connection between two virtual
machines (VMs)
 Wanted to contain the project within a laptop
 VM’s easier to manipulate
 NTP Server application would run on one of theVMs
 Synchronize with NUIGalway NTP server through host OS
 SecondVM would receive timing info from virtual NTP server
 Host OS
 Able to monitor all network traffic usingWireshark
 Would eventually act as MitM in a MitM attack
Stage 1: SoftwareTools
 To carry out this project, we needed to build a virtual network
 We usedVMware to create virtual machines which run Fedora 19, a distribution
of Linux
 We needed to learn much about the shell and familiarize ourselves with the
command terminal
 Additionally neededWireshark to sniff network traffic and Ettercap in order to
simulate man-in-the-middle attacks
Stage 1:Troubleshooting
 Synchronizing virtual NTP server to NUIG NTP server
 140.203.204.77 exists outside the NUIG firewall, had to synchronize over cell network
 Not a viable long-term option, data usage too high
 Synchronizing virtual NTP server to Hugh’s NTP server
 140.203.16.50 is within the NUIG firewall, but no synchronization
 Check iptables rules, ntp.conf file,Windows firewall,VMWare documentation…
 ntpd –u
 Requires that ntpq send request from/to unrestricted (< 1024) port
 However, ntpd can only synchronize through a connection over port 123…
 Ultimately decided to change the design of stage 1
Stage 2: Authenticated NTP
 Server secret: server seed
 Client secret: private key
 Client shares its public key with server, server uses the public key to generate cookie:
Cookie = MSBs32 (H (Client-IP || Server-IP || 0 || Server Seed)), e.g.
 Normal synchronization:
NTP Packet = NTP-Payload || KeyId || MAC
MAC = H (Autokey || NTP-Payload)
KeyId is picked by the client.
Autokey is 128 bit long and calculated as follow:
Autokey = H (Sender-IP || Receiver-IP || KeyID || Cookie)
Stage 2: Executing the Attack
 Ettercap proved to be a handy tool, as it provided us with a suite for
performing man-in-the-middle attacks
 Ettercap works by ARP poisoning selected targets. (ie changing the MAC
address and forging request and reply packets across a LAN)
 This allows Ettercap to act as the middle man, and enables it to perform
various styles of attack
 Our intention was to use a DNS hijack in order to fool switches which would
allow us to intercept NTP traffic sent across our virtual network.
Summary
 We found ourselves doing a lot of trial and error, and were unable to complete
Stage 2 in the given time
 We nonetheless managed to set up the virtual network, synchronize a virtual
NTP server with an NUIG NTP server, and explored a weakness in
Authenticated NTP
 We've learned how to intercept and monitor network traffic
 We have laid down the foundation for a new person to continue this project
from where we left it off

NTP Project Presentation

  • 1.
    NetworkTiming Protocol Security Supervisor: MichaelSchukat Interns: Andrew McGarry and Declan Brennan Summer 2014 NUIG Research Practicum
  • 2.
    Overview • Background Information •Project Goals • NetworkTiming Protocol • Stage 1 • Concept • SoftwareTools • Troubleshooting • Stage 2 Research • Authenticated NTP • Executing the Attack • Summary
  • 3.
    Background  “Measurement andcontrol applications are increasingly using distributed system technologies such as network communication, local computing, and distributed objects.Without a standardized protocol for synchronizing the clocks in these devices, it is unlikely that the benefits will be realized in the multivendor system component market” (IEEE 1588, 2008).  IEEE 1588 describes PTP, a protocol capable of greater time precision than NTP  GPS or cellular network unusable in many cases  However, NTP in its base form does not authenticate server/client  Authenticated NTP used to provide secure NTP connections.  Quite widespread, although with advent of smart grids, could be used as attack vector against critical services.  Has known security flaws (Autokey cookie is only 32 bits long, so it can be brute forced)
  • 4.
    Project Goals Main: toexplore and demonstrate a security flaw associated with Authenticated NTP Subgoals: Exploration: • Learn about NetworkTiming protocol, it’s importance, how it functions • Utilize tools commonly used in computer science research • Introduce ourselves to computer networking and network security Demonstration • Stage 1: set up a computer network which features an NTP client/server relationship and the capability to monitor network traffic • Stage 2: conduct a Man-in-the-Middle (MitM) attack within this network with the goal of fooling NTP client into accepting attacker as legitimate NTP server
  • 5.
    What is NTP? Abbreviation for 'NetworkTime Protocol'  NTP is used for clock synchronization across data networks  Its purpose is to synchronize the clocks participating hosts to within a few milliseconds of UTC  NTP utilizes layers known as strata. Each successive stratum is further and further away from high-precision timekeeping devices  NTP is often used in situations where accurate time stamps are essential  NTP was originally conceived by David Mills at the University of Delaware in 1985, and is thus one of the oldest network protocols still in use
  • 6.
    Stage 1: Concept Original concept was to establish an NTP connection between two virtual machines (VMs)  Wanted to contain the project within a laptop  VM’s easier to manipulate  NTP Server application would run on one of theVMs  Synchronize with NUIGalway NTP server through host OS  SecondVM would receive timing info from virtual NTP server  Host OS  Able to monitor all network traffic usingWireshark  Would eventually act as MitM in a MitM attack
  • 8.
    Stage 1: SoftwareTools To carry out this project, we needed to build a virtual network  We usedVMware to create virtual machines which run Fedora 19, a distribution of Linux  We needed to learn much about the shell and familiarize ourselves with the command terminal  Additionally neededWireshark to sniff network traffic and Ettercap in order to simulate man-in-the-middle attacks
  • 9.
    Stage 1:Troubleshooting  Synchronizingvirtual NTP server to NUIG NTP server  140.203.204.77 exists outside the NUIG firewall, had to synchronize over cell network  Not a viable long-term option, data usage too high  Synchronizing virtual NTP server to Hugh’s NTP server  140.203.16.50 is within the NUIG firewall, but no synchronization  Check iptables rules, ntp.conf file,Windows firewall,VMWare documentation…  ntpd –u  Requires that ntpq send request from/to unrestricted (< 1024) port  However, ntpd can only synchronize through a connection over port 123…  Ultimately decided to change the design of stage 1
  • 11.
    Stage 2: AuthenticatedNTP  Server secret: server seed  Client secret: private key  Client shares its public key with server, server uses the public key to generate cookie: Cookie = MSBs32 (H (Client-IP || Server-IP || 0 || Server Seed)), e.g.  Normal synchronization: NTP Packet = NTP-Payload || KeyId || MAC MAC = H (Autokey || NTP-Payload) KeyId is picked by the client. Autokey is 128 bit long and calculated as follow: Autokey = H (Sender-IP || Receiver-IP || KeyID || Cookie)
  • 12.
    Stage 2: Executingthe Attack  Ettercap proved to be a handy tool, as it provided us with a suite for performing man-in-the-middle attacks  Ettercap works by ARP poisoning selected targets. (ie changing the MAC address and forging request and reply packets across a LAN)  This allows Ettercap to act as the middle man, and enables it to perform various styles of attack  Our intention was to use a DNS hijack in order to fool switches which would allow us to intercept NTP traffic sent across our virtual network.
  • 13.
    Summary  We foundourselves doing a lot of trial and error, and were unable to complete Stage 2 in the given time  We nonetheless managed to set up the virtual network, synchronize a virtual NTP server with an NUIG NTP server, and explored a weakness in Authenticated NTP  We've learned how to intercept and monitor network traffic  We have laid down the foundation for a new person to continue this project from where we left it off