Skip to content

Commit c921611

Browse files
committed
Move default probe and result store to UDPScanner, since most need it
1 parent ff0b52c commit c921611

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

lib/msf/core/auxiliary/udp_scanner.rb

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@ module Msf
88
#
99
###
1010
module Auxiliary::UDPScanner
11-
1211
include Auxiliary::Scanner
1312

13+
# A hash of results of a given batch run, keyed by host
14+
attr_accessor :results
15+
16+
# A probe to be sent to each host
17+
attr_accessor :probe
18+
1419
#
1520
# Initializes an instance of an auxiliary module that scans UDP
1621
#
17-
1822
def initialize(info = {})
1923
super
2024

@@ -167,11 +171,12 @@ def rport
167171
end
168172

169173
#
170-
# The including module override these methods
174+
# The including module may override some of these methods
171175
#
172176

173-
# Called for each IP in the batch
177+
# Called for each IP in the batch. This will send all necessary probes.
174178
def scan_host(ip)
179+
scanner_send(@probe, ip, datastore['RPORT'])
175180
end
176181

177182
# Called for each response packet
@@ -180,11 +185,12 @@ def scanner_process(data, shost, sport)
180185

181186
# Called before the scan block
182187
def scanner_prescan(batch)
188+
vprint_status("Sending probes to #{batch[0]}->#{batch[-1]} (#{batch.length} hosts)")
189+
@results = {}
183190
end
184191

185192
# Called after the scan block
186193
def scanner_postscan(batch)
187194
end
188-
189195
end
190196
end

0 commit comments

Comments
 (0)