Size: 342
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 9: | Line 16: |
date -d@$((0x`printf c%47s|nc -uw1 10.254.253.201 123|xxd -s40 -l4 -p`-64#23GDW0)) | date -d@$((0x`printf c%47s|nc -uw1 pool.ntp.org 123|xxd -s40 -l4 -p`-64#23GDW0)) |
Line 11: | Line 18: |
=== BSD === | 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: |
Line 13: | Line 21: |
date -r$((0x`printf c%47s|nc -uw1 ntp.metas.ch 123|xxd -s40 -l4 -p`-64#23GDW0)) | date -d@$((0x`(printf "\x93"; printf '\0%.0s' {1..47}) |nc -uw1 192.168.9.1 123|xxd -s40 -l4 -p`-64#23GDW0)) |
Line 15: | Line 23: |
For servers that don't accept ntpv2, but do ntpv4, try to replace `x93` with `xe3` ==== BSD ==== {{{#!bash date -r$((0x`printf c%47s|nc -uw1 pool.ntp.org 123|xxd -s40 -l4 -p`-64#23GDW0)) }}} |
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))