
restrict 192.168.0.0 mask 255.255.255.0 notrust nomodify notrap



[root@localhost root]# ntpdate -u 192.168.0.100
18 Mar 23:33:56 ntpdate[25070]: no server suitable for synchronization found
[root@localhost root]# ntpdate -u 192.168.0.100
18 Mar 23:34:02 ntpdate[25071]: no server suitable for synchronization found
[root@localhost root]# ntpdate -u 192.168.0.100
18 Mar 23:34:07 ntpdate[25072]: no server suitable for synchronization found
[root@Hackbox root]# ntpdate -u 127.0.0.1
18 Mar 23:32:39 ntpdate[2410]: adjust time server 127.0.0.1 offset 0.000001 sec
[root@Hackbox root]# ntpdate -u 192.168.0.100
18 Mar 23:32:51 ntpdate[2411]: adjust time server 192.168.0.100 offset 0.000002 sec
[root@Hackbox root]# ntpdate -u 192.168.0.100
18 Mar 23:33:49 ntpdate[2412]: adjust time server 192.168.0.100 offset 0.000001 sec
[root@Hackbox root]# ntpdate -u 192.168.0.100
18 Mar 23:33:56 ntpdate[2413]: adjust time server 192.168.0.100 offset 0.000002 sec
# Prohibit general access to this service.
# restrict default ignore
# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
# -- CLIENT NETWORK -------
# Permit systems on this network to synchronize with this
# time service. Do not permit those systems to modify the
# configuration of this service. Also, do not use those
# systems as peers for synchronization.
restrict 192.168.0.0 mask 255.255.255.0 notrust nomodify notrap
# --- OUR TIMESERVERS -----
# or remove the default restrict line
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict 192.43.244.18 mask 255.255.255.255 nomodify notrap noquery
restrict clock.redhat.com mask 255.255.255.255 nomodify notrap noquery
restrict clock2.redhat.com mask 255.255.255.255 nomodify notrap noquery
restrict time.cachenetworks.com mask 255.255.255.255 nomodify notrap noquery
restrict louie.udel.edu mask 255.255.255.255 nomodify notrap noquery
restrict ntp.ourconcord.net mask 255.255.255.255 nomodify notrap noquery
restrict clock.nyc.he.net mask 255.255.255.255 nomodify notrap noquery
server 192.43.244.18
server clock.redhat.com
server clock2.redhat.com
server time.cachenetworks.com
server louie.udel.edu
server ntp.ourconcord.net
server clock.nyc.he.net
# --- NTP MULTICASTCLIENT ---
#multicastclient # listen on default 224.0.1.1
# restrict 224.0.1.1 mask 255.255.255.255 notrust nomodify notrap
# restrict 192.168.1.0 mask 255.255.255.0 notrust nomodify notrap
# --- GENERAL CONFIGURATION ---
#
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available. The
# default stratum is usually 3, but in this case we elect to use stratum
# 0. Since the server line does not have the prefer keyword, this driver
# is never used for synchronization, unless no other other
# synchronization source is available. In case the local host is
# controlled by some external source, such as an external oscillator or
# another protocol, the prefer keyword would cause the local host to
# disregard all other synchronization sources, unless the kernel
# modifications are in use and declare an unsynchronized condition.
#
server 66.187.233.4
fudge 127.127.1.0 stratum 10
#
# Drift file. Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()'ing
# it to the file.
#
driftfile /etc/ntp/drift
broadcastdelay 0.008
#
# Authentication delay. If you use, or plan to use someday, the
# authentication facility you should make the programs in the auth_stuff
# directory and figure out what this number should be on your machine.
#
authenticate yes
#
# Keys file. If you want to diddle your server at run time, make a
# keys file (mode 600 for sure) and define the key number to be
# used for making requests.
#
# PLEASE DO NOT USE THE DEFAULT VALUES HERE. Pick your own, or remote
# systems might be able to reset your clock at will. Note also that
# ntpd is started with a -A flag, disabling authentication, that
# will have to be removed as well.
#
keys /etc/ntp/keys
[root@Hackbox root]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*time.nist.gov .ACTS. 1 u 21 128 77 69.165 -7.639 0.622
clock.redhat.co 0.0.0.0 16 u - 64 0 0.000 0.000 4000.00
-clock.redhat.co .CDMA. 1 u 24 128 377 94.115 -13.909 0.621
-clock2.redhat.c .CDMA. 1 u 36 64 377 94.445 -5.937 1.052
-ns1.anycast.cac Tick.UH.EDU 2 u 33 128 377 91.214 -11.160 0.580
+louie.udel.edu ntp1.nss.udel.e 2 u 27 128 377 116.046 -8.276 0.466
+ourconcord.net NAVOBS1.MIT.EDU 2 u 34 128 377 127.577 -6.881 4.061
-avi-lis.gw.ligh .CDMA. 1 u 25 128 377 116.661 -0.672 0.949

19 Mar 06:59:03 ntpdate[11931]: step time server 192.168.0.110 offset 0.035313 sec


[root@Hackbox root]# netstat -a | grep ntp
udp 0 0 192.168.0.100:ntp *:*
udp 0 0 localhost.localdoma:ntp *:*
udp 0 0 *:ntp *:*
Mar 21 00:59:00 localhost ntpd: succeeded
Mar 21 00:59:01 localhost last message repeated 6 times
Mar 21 00:59:01 localhost ntpd[3918]: ntpd exiting on signal 15
Mar 21 00:59:01 localhost ntpd: ntpd shutdown succeeded
Mar 21 00:59:01 localhost ntpd: succeeded
Mar 21 00:59:02 localhost last message repeated 6 times
Mar 21 00:59:04 localhost ntpdate[5294]: step time server 192.43.244.18 offset -0.032744 sec
Mar 21 00:59:04 localhost ntpd: succeeded
Mar 21 00:59:04 localhost ntpd[5298]: ntpd 4.1.1c-rc1@1.836 Thu Feb 13 12:17:19 EST 2003 (1)
Mar 21 00:59:04 localhost ntpd: ntpd startup succeeded
Mar 21 00:59:04 localhost ntpd[5298]: precision = 21 usec
Mar 21 00:59:04 localhost ntpd[5298]: kernel time discipline status 0040
Mar 21 00:59:04 localhost ntpd[5298]: frequency initialized -77.965 from /etc/ntp/drift
[root@Hackbox root]# nmap -sU -P0 -vv -g 53 192.168.0.100
Starting nmap 3.48 ( http://www.insecure.org/nmap/ ) at 2004-03-21 01:06 PST
Host 192.168.0.100 appears to be up ... good.
Initiating UDP Scan against 192.168.0.100 at 01:06
The UDP Scan took 7 seconds to scan 1478 ports.
Adding open port 111/udp
Adding open port 32768/udp
Adding open port 137/udp
Adding open port 989/udp
Adding open port 138/udp
Adding open port 123/udp
Interesting ports on 192.168.0.100:
(The 1472 ports scanned but not shown below are in state: closed)
PORT STATE SERVICE
111/udp open rpcbind
123/udp open ntp
137/udp open netbios-ns
138/udp open netbios-dgm
989/udp open unknown
32768/udp open omad
Nmap run completed -- 1 IP address (1 host up) scanned in 7.246 seconds
[root@Hackbox root]# nmap -sU 192.168.0.100
Starting nmap 3.48 ( http://www.insecure.org/nmap/ ) at 2004-03-21 01:07 PST
Interesting ports on 192.168.0.100:
(The 1472 ports scanned but not shown below are in state: closed)
PORT STATE SERVICE
111/udp open rpcbind
123/udp open ntp
137/udp open netbios-ns
138/udp open netbios-dgm
989/udp open unknown
32768/udp open omad
Nmap run completed -- 1 IP address (1 host up) scanned in 5.627 seconds


[root@localhost root]# service iptables stop
Flushing all chains: [ OK ]
Removing user defined chains: [ OK ]
Resetting built-in chains to the default ACCEPT policy: [ OK ]
[root@localhost root]# ntpdate 192.168.0.100
21 Mar 10:26:46 ntpdate[7495]: step time server 192.168.0.100 offset 22.773386 sec
[root@localhost root]# ntpdate 192.168.0.100
21 Mar 10:26:52 ntpdate[7496]: adjust time server 192.168.0.100 offset 0.000094 sec
[root@localhost root]# ntpdate 192.168.0.100
21 Mar 10:28:01 ntpdate[7497]: no server suitable for synchronization found
[root@Hackbox root]# service iptables stop
Flushing all chains: [ OK ]
Removing user defined chains: [ OK ]
Resetting built-in chains to the default ACCEPT policy: [ OK ]
[root@Hackbox root]# service iptables start
Flushing all current rules and user defined chains: [ OK ]
Clearing all current rules and user defined chains: [ OK ]
Applying iptables firewall rules: [ OK ]

iptables -A INPUT -p udp -s 192.168.0.0/24 --sport 123 --dport 123 -j ACCEPT
iptables -A OUTPUT -p udp -d 192.168.0.0/24 --sport 123 --dport 123 -j ACCEPT

/sbin/iptables -A INPUT -p udp --dport 123 -j ACCEPT
/sbin/iptables -A OUTPUT -p udp --sport 123 -j ACCEPT

Users browsing this forum: No registered users and 2 guests