Skip to content

Commit 8f197d4

Browse files
committed
Move to build_probe
1 parent 05dd3fa commit 8f197d4

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

lib/msf/core/auxiliary/udp_scanner.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ module Auxiliary::UDPScanner
1313
# A hash of results of a given batch run, keyed by host
1414
attr_accessor :results
1515

16-
# A probe to be sent to each host
17-
attr_accessor :probe
18-
1916
#
2017
# Initializes an instance of an auxiliary module that scans UDP
2118
#
@@ -174,9 +171,13 @@ def rport
174171
# The including module may override some of these methods
175172
#
176173

174+
# Builds and returns the probe to be sent
175+
def build_probe
176+
end
177+
177178
# Called for each IP in the batch. This will send all necessary probes.
178179
def scan_host(ip)
179-
scanner_send(@probe, ip, rport)
180+
scanner_send(build_probe, ip, rport)
180181
end
181182

182183
# Called for each response packet

modules/auxiliary/scanner/udp_scanner_template.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ def setup
4848
super
4949
# TODO: do any sort of preliminary sanity checking, like perhaps validating some options
5050
# in the datastore, etc.
51+
end
5152

52-
# TODO: build the appropriate probe here
53-
@probe = 'abracadabra!'
53+
# TODO: construct the appropriate probe here.
54+
def build_probe
55+
@probe ||= 'abracadabra!'
5456
end
5557

5658
# TODO: this is called before the scan block for each batch of hosts. Do any

0 commit comments

Comments
 (0)