Skip to content

Commit a341756

Browse files
committed
Support spoofing source IPs for NTP readvar, include status messages
1 parent fa44141 commit a341756

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

modules/auxiliary/scanner/ntp/ntp_readvar.rb

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,28 @@ def initialize(info = {})
3030
)
3131
end
3232

33-
# Called for each response packet
3433
def scanner_process(data, shost, _sport)
3534
@results[shost] ||= []
3635
@results[shost] << Rex::Proto::NTP::NTPControl.new(data)
3736
end
3837

39-
# Called before the scan block
40-
def scanner_prescan(_batch)
38+
def scan_host(ip)
39+
if spoofed?
40+
datastore['ScannerRecvWindow'] = 0
41+
scanner_spoof_send(@probe, ip, datastore['RPORT'], datastore['SRCIP'], datastore['NUM_REQUESTS'])
42+
else
43+
scanner_send(@probe, ip, datastore['RPORT'])
44+
end
45+
end
46+
47+
def scanner_prescan(batch)
4148
@results = {}
49+
print_status("Sending NTP v2 READVAR probes to #{batch[0]}->#{batch[-1]} (#{batch.length} hosts)")
4250
@probe = Rex::Proto::NTP::NTPControl.new
4351
@probe.version = datastore['VERSION']
4452
@probe.operation = 2
4553
end
4654

47-
# Called after the scan block
4855
def scanner_postscan(_batch)
4956
@results.keys.each do |k|
5057
# TODO: check to see if any of the responses are actually NTP before reporting

0 commit comments

Comments
 (0)