6
6
require 'msf/core'
7
7
8
8
class Metasploit3 < Msf ::Auxiliary
9
-
10
9
include Msf ::Auxiliary ::Report
11
10
include Msf ::Exploit ::Remote ::Udp
12
11
include Msf ::Auxiliary ::UDPScanner
@@ -16,45 +15,45 @@ class Metasploit3 < Msf::Auxiliary
16
15
def initialize ( info = { } )
17
16
super ( update_info ( info ,
18
17
'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
21
20
potentially sensitive information, such as the NTP software version, operating
22
21
system version, peers, and more.
23
- } ,
22
+ ) ,
24
23
'Author' => [ 'Ewerson Guimaraes(Crash) <crash[at]dclabs.com.br>' ] ,
25
24
'License' => MSF_LICENSE ,
26
25
'References' =>
27
26
[
28
- [ 'URL' , 'http://www.rapid7.com/vulndb/lookup/ntp-clock-variables-disclosure' ] ,
27
+ [ 'URL' , 'http://www.rapid7.com/vulndb/lookup/ntp-clock-variables-disclosure' ]
29
28
]
30
29
)
31
30
)
32
31
end
33
32
34
33
# Called for each response packet
35
- def scanner_process ( data , shost , sport )
34
+ def scanner_process ( data , shost , _sport )
36
35
@results [ shost ] ||= [ ]
37
36
@results [ shost ] << Rex ::Proto ::NTP ::NTPControl . new ( data )
38
37
end
39
38
40
39
# Called before the scan block
41
- def scanner_prescan ( batch )
40
+ def scanner_prescan ( _batch )
42
41
@results = { }
43
42
@probe = Rex ::Proto ::NTP ::NTPControl . new
44
43
@probe . version = datastore [ 'VERSION' ]
45
44
@probe . operation = 2
46
45
end
47
46
48
47
# Called after the scan block
49
- def scanner_postscan ( batch )
48
+ def scanner_postscan ( _batch )
50
49
@results . keys . each do |k |
51
50
# TODO: check to see if any of the responses are actually NTP before reporting
52
51
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
58
57
)
59
58
60
59
peer = "#{ k } :#{ rport } "
@@ -63,17 +62,16 @@ def scanner_postscan(batch)
63
62
what = 'NTP Mode 6 READVAR DRDoS'
64
63
if vulnerable
65
64
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
+ )
73
72
else
74
73
vprint_status ( "#{ peer } - Not vulnerable to #{ what } : #{ proof } " )
75
74
end
76
75
end
77
76
end
78
-
79
77
end
0 commit comments