Skip to content

Commit 1001061

Browse files
author
HD Moore
committed
Initialize @capture_count
1 parent 1b1716b commit 1001061

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/msf/core/exploit/capture.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ def capture_extract_ies(raw)
166166
#
167167
def each_packet
168168
return unless capture
169+
@capture_count ||= 0
169170
capture.each do |pkt|
170171
yield(pkt)
171172
@capture_count += 1
@@ -248,7 +249,7 @@ def capture_sendto(payload="", dhost=nil, bcast=false, dev=nil)
248249

249250
# The return value either be a PacketFu::Packet object, or nil
250251
def inject_reply(proto=:udp, pcap=self.capture)
251-
# Defaults to ~2 seconds
252+
# Defaults to ~2 seconds
252253
to = (datastore['TIMEOUT'] * 4) / 1000.0
253254
raise RuntimeError, "Could not access the capture process (remember to open_pcap first!)" if not pcap
254255
begin
@@ -339,7 +340,7 @@ def arp(target_ip=nil)
339340
p = arp_packet(target_ip, source_ip)
340341

341342
# Try up to 3 times to get an ARP response
342-
1.upto(3) do
343+
1.upto(3) do
343344
inject_eth(:eth_type => 0x0806,
344345
:payload => p,
345346
:pcap => self.arp_capture,

0 commit comments

Comments
 (0)