From f8917a59a38c6b146d791a30351fbcb849b0b890 Mon Sep 17 00:00:00 2001 From: dmiller Date: Sat, 23 Aug 2014 20:47:46 +0000 Subject: [PATCH] Compatibility changes for ntp-info http://seclists.org/nmap-dev/2014/q3/222 --- scripts/ntp-info.nse | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/ntp-info.nse b/scripts/ntp-info.nse index 9ca809051..3e72e2e06 100644 --- a/scripts/ntp-info.nse +++ b/scripts/ntp-info.nse @@ -75,8 +75,8 @@ action = function(host, port) local buftres, bufrlres local output = stdnse.output_table() - -- This is a ntp v4 mode3 (client) date/time request. - local treq = string.char(0xe3, 0x00, 0x04, 0xfa, 0x00, 0x01, 0x00, 0x00, + -- This is a ntp v2 mode3 (client) date/time request. + local treq = string.char(0xd3, 0x00, 0x04, 0xfa, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -89,10 +89,7 @@ action = function(host, port) 0x00, 0x00, 0x00, 0x00) status, buftres = comm.exchange(host, port, treq, {proto=port.protocol, timeout=TIMEOUT}) - if not status then - -- Don't try the second probe if this one didn't work. - return nil - else + if status then local _, sec, frac, tstamp _, sec, frac = bin.unpack(">II", buftres, 33)