Size: 738
Comment:
|
← Revision 4 as of 2021-09-23 13:23:35 ⇥
Size: 892
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 6: | Line 6: |
=== Using Nmap === If Nmap is available: {{{#!bash sudo nmap -sU -Pn -p 123 pool.ntp.org --script=ntp-info }}} Otherwise: === Using Netcat === |
|
Line 7: | Line 14: |
=== GNU Linux === | ==== GNU Linux ==== |
Line 17: | Line 24: |
=== BSD === | ==== BSD ==== |
Testing an ntp server without ntpd
Using Nmap
If Nmap is available:
sudo nmap -sU -Pn -p 123 pool.ntp.org --script=ntp-info
Otherwise:
Using Netcat
Source: http://seriot.ch/ntp.php
GNU Linux
date -d@$((0x`printf c%47s|nc -uw1 pool.ntp.org 123|xxd -s40 -l4 -p`-64#23GDW0))
This doesn't work for autistic NTP servers like the one in Foritigate routers, because they dont understand that a space is the same as a NULL byte.. The longer, but more solid version:
date -d@$((0x`(printf "\x93"; printf '\0%.0s' {1..47}) |nc -uw1 192.168.9.1 123|xxd -s40 -l4 -p`-64#23GDW0))
For servers that don't accept ntpv2, but do ntpv4, try to replace x93 with xe3
BSD
date -r$((0x`printf c%47s|nc -uw1 pool.ntp.org 123|xxd -s40 -l4 -p`-64#23GDW0))