7
7
require 'msf/core'
8
8
9
9
class Metasploit3 < Msf ::Auxiliary
10
- Rank = ManualRanking
11
10
12
11
include Msf ::Auxiliary ::Scanner
13
12
include Msf ::Auxiliary ::Report
@@ -43,11 +42,7 @@ def initialize
43
42
OptInt . new ( 'TIMEOUT' , [ true , 'Timeout for the Chargen probe' , 5 ] ) ,
44
43
] )
45
44
46
- register_advanced_options ( [
47
- OptBool . new ( 'DEBUG' , [ false , 'Show chargen server answer' , false ] ) ,
48
- ] , self . class )
49
-
50
- deregister_options ( 'PASSWORD' , 'RHOST' , 'USERNAME' )
45
+ deregister_options ( 'RHOST' )
51
46
end
52
47
53
48
def to
@@ -64,11 +59,9 @@ def run_host(rhost)
64
59
65
60
while ( ( res = udp_sock . recvfrom ( 65535 , 0.1 ) ) && ( res [ 1 ] ) )
66
61
67
- if ( datastore [ 'DEBUG' ] )
68
- print_status ( "DEBUG: #{ res . to_s } " )
69
- end
62
+ vprint_status ( "#{ rhost } :#{ rport } - Response: #{ res [ 0 ] . to_s } " )
70
63
71
- res = res . to_s . strip
64
+ res = res [ 0 ] . to_s . strip
72
65
if ( res . match ( /ABCDEFGHIJKLMNOPQRSTUVWXYZ/i ) || res . match ( /0123456789/ ) )
73
66
print_good ( "#{ rhost } :#{ rport } answers with #{ res . length } bytes (headers + UDP payload)" )
74
67
report_service ( :host => rhost , :port => rport , :name => "chargen" , :info => res . length )
@@ -79,9 +72,9 @@ def run_host(rhost)
79
72
end
80
73
rescue ::Rex ::ConnectionError
81
74
rescue Timeout ::Error
82
- print_error ( "#{ rhost } :#{ rport } server timed out after #{ to } seconds. Skipping." )
75
+ vprint_error ( "#{ rhost } :#{ rport } server timed out after #{ to } seconds. Skipping." )
83
76
rescue ::Exception => e
84
- print_error ( "#{ e } #{ e . backtrace } " )
77
+ vprint_error ( "#{ e } #{ e . backtrace } " )
85
78
end
86
79
end
87
80
end
0 commit comments