Skip to content

Commit 65c1a82

Browse files
committed
Address most Rubocop complaints
1 parent 0715c67 commit 65c1a82

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

modules/auxiliary/scanner/ntp/ntp_readvar.rb

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
require 'msf/core'
77

88
class Metasploit3 < Msf::Auxiliary
9-
109
include Msf::Auxiliary::Report
1110
include Msf::Exploit::Remote::Udp
1211
include Msf::Auxiliary::UDPScanner
@@ -16,45 +15,45 @@ class Metasploit3 < Msf::Auxiliary
1615
def initialize(info = {})
1716
super(update_info(info,
1817
'Name' => 'NTP Clock Variables Disclosure',
19-
'Description' => %q{
20-
This module reads the system internal NTP variables. These variables contain
18+
'Description' => %q(
19+
This module reads the system internal NTP variables. These variables contain
2120
potentially sensitive information, such as the NTP software version, operating
2221
system version, peers, and more.
23-
},
22+
),
2423
'Author' => [ 'Ewerson Guimaraes(Crash) <crash[at]dclabs.com.br>' ],
2524
'License' => MSF_LICENSE,
2625
'References' =>
2726
[
28-
[ 'URL','http://www.rapid7.com/vulndb/lookup/ntp-clock-variables-disclosure' ],
27+
[ 'URL', 'http://www.rapid7.com/vulndb/lookup/ntp-clock-variables-disclosure' ]
2928
]
3029
)
3130
)
3231
end
3332

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

4039
# Called before the scan block
41-
def scanner_prescan(batch)
40+
def scanner_prescan(_batch)
4241
@results = {}
4342
@probe = Rex::Proto::NTP::NTPControl.new
4443
@probe.version = datastore['VERSION']
4544
@probe.operation = 2
4645
end
4746

4847
# Called after the scan block
49-
def scanner_postscan(batch)
48+
def scanner_postscan(_batch)
5049
@results.keys.each do |k|
5150
# TODO: check to see if any of the responses are actually NTP before reporting
5251
report_service(
53-
:host => k,
54-
:proto => 'udp',
55-
:port => rport,
56-
:name => 'ntp',
57-
:info => @results[k].map { |r| r.payload }.join.inspect
52+
host: k,
53+
proto: 'udp',
54+
port: rport,
55+
name: 'ntp',
56+
info: @results[k].map { |r| r.payload }.join.inspect
5857
)
5958

6059
peer = "#{k}:#{rport}"
@@ -63,17 +62,16 @@ def scanner_postscan(batch)
6362
what = 'NTP Mode 6 READVAR DRDoS'
6463
if vulnerable
6564
print_good("#{peer} - Vulnerable to #{what}: #{proof}")
66-
report_vuln({
67-
:host => k,
68-
:port => rport,
69-
:proto => 'udp',
70-
:name => what,
71-
:refs => self.references
72-
})
65+
report_vuln(
66+
host: k,
67+
port: rport,
68+
proto: 'udp',
69+
name: what,
70+
refs: references
71+
)
7372
else
7473
vprint_status("#{peer} - Not vulnerable to #{what}: #{proof}")
7574
end
7675
end
7776
end
78-
7977
end

0 commit comments

Comments
 (0)