Skip to content

Commit 999006e

Browse files
committed
fixed some things, as suggested by jvazquez-r7
1 parent 3111aee commit 999006e

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

modules/auxiliary/scanner/chargen/chargen_probe.rb

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
require 'msf/core'
88

99
class Metasploit3 < Msf::Auxiliary
10-
Rank = ManualRanking
1110

1211
include Msf::Auxiliary::Scanner
1312
include Msf::Auxiliary::Report
@@ -43,11 +42,7 @@ def initialize
4342
OptInt.new('TIMEOUT', [true, 'Timeout for the Chargen probe', 5]),
4443
])
4544

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')
5146
end
5247

5348
def to
@@ -64,11 +59,9 @@ def run_host(rhost)
6459

6560
while ((res = udp_sock.recvfrom(65535,0.1)) && (res[1]))
6661

67-
if (datastore['DEBUG'])
68-
print_status("DEBUG: #{res.to_s}")
69-
end
62+
vprint_status("#{rhost}:#{rport} - Response: #{res[0].to_s}")
7063

71-
res = res.to_s.strip
64+
res = res[0].to_s.strip
7265
if (res.match(/ABCDEFGHIJKLMNOPQRSTUVWXYZ/i) || res.match(/0123456789/))
7366
print_good("#{rhost}:#{rport} answers with #{res.length} bytes (headers + UDP payload)")
7467
report_service(:host => rhost, :port => rport, :name => "chargen", :info => res.length)
@@ -79,9 +72,9 @@ def run_host(rhost)
7972
end
8073
rescue ::Rex::ConnectionError
8174
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.")
8376
rescue ::Exception => e
84-
print_error("#{e} #{e.backtrace}")
77+
vprint_error("#{e} #{e.backtrace}")
8578
end
8679
end
8780
end

0 commit comments

Comments
 (0)