Skip to content

Commit e5e0657

Browse files
committed
Add documentation to the module with testing steps
1 parent a68b9dc commit e5e0657

File tree

1 file changed

+96
-0
lines changed

1 file changed

+96
-0
lines changed
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
## Vulnerable Application
2+
3+
## Verification Steps
4+
5+
1. Use the supplied Dockerfile to start a vulnerable instance of the application
6+
1. Build it with: `docker build -t ntpd:4.2.8p3 .`
7+
1. Run it with: `docker run --rm -it --name ntp-server -p 123:123/udp ntpd:4.2.8p3`
8+
1. Start `msfconsole` and use the module
9+
1. Set the `RHOSTS` value as necessary
10+
1. Run the module and see that the target is vulnerable
11+
12+
### Dockerfile
13+
Use this as `ntp.conf`:
14+
15+
```
16+
# Basic NTP configuration
17+
server 0.pool.ntp.org iburst
18+
server 1.pool.ntp.org iburst
19+
server 2.pool.ntp.org iburst
20+
server 3.pool.ntp.org iburst
21+
22+
driftfile /var/lib/ntp/ntp.drift
23+
24+
# Enable authentication for secure associations
25+
enable auth
26+
27+
# Define trusted keys
28+
trustedkey 1
29+
30+
# Open restrictions for all clients on the local network (example: 192.168.0.0/16)
31+
restrict default kod nomodify notrap
32+
restrict 127.0.0.1
33+
restrict ::1
34+
restrict 192.168.0.0 mask 255.255.0.0 autokey
35+
36+
# Uncomment to allow all clients (use cautiously)
37+
# restrict default kod nomodify notrap
38+
```
39+
40+
Use this as `Dockerfile`:
41+
42+
```
43+
ARG version=4.2.8p3
44+
FROM ubuntu:16.04
45+
ARG version
46+
47+
# Install dependencies
48+
RUN apt-get update && apt-get install -y \
49+
wget \
50+
build-essential \
51+
libcap-dev \
52+
libssl-dev && \
53+
apt-get clean
54+
55+
# Download and build NTPD
56+
WORKDIR /tmp
57+
RUN wget https://web.archive.org/web/20240608062853/https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-$version.tar.gz && \
58+
tar -xzf ntp-$version.tar.gz && \
59+
cd ntp-$version && \
60+
./configure --prefix=/usr/local --enable-linuxcaps && \
61+
make && \
62+
make install && \
63+
cd .. && \
64+
rm -rf ntp-$version*
65+
66+
# Add configuration file
67+
COPY ntp.conf /etc/ntp.conf
68+
69+
# Expose NTP port (123)
70+
EXPOSE 123/udp
71+
72+
# Run ntpd
73+
ENTRYPOINT ["/usr/local/bin/ntpd"]
74+
CMD ["-g", "-d", "-d"]
75+
```
76+
77+
## Options
78+
79+
## Scenarios
80+
81+
### Ubuntu 16.04 NTPd 4.2.8p3
82+
83+
```
84+
metasploit-framework (S:0 J:0) auxiliary(scanner/ntp/ntp_nak_to_the_future) > set RHOSTS 192.168.159.128, 192.168.159.10
85+
RHOSTS => 192.168.159.128, 192.168.159.10
86+
metasploit-framework (S:0 J:0) auxiliary(scanner/ntp/ntp_nak_to_the_future) > run
87+
[+] 192.168.159.128:123 - NTP - VULNERABLE: Accepted a NTP symmetric active association
88+
[*] Scanned 1 of 2 hosts (50% complete)
89+
[*] Scanned 1 of 2 hosts (50% complete)
90+
[*] Scanned 1 of 2 hosts (50% complete)
91+
[*] Scanned 1 of 2 hosts (50% complete)
92+
[*] Scanned 1 of 2 hosts (50% complete)
93+
[*] Scanned 2 of 2 hosts (100% complete)
94+
[*] Auxiliary module execution completed
95+
metasploit-framework (S:0 J:0) auxiliary(scanner/ntp/ntp_nak_to_the_future) >
96+
```

0 commit comments

Comments
 (0)