Skip to content

Commit b15297e

Browse files
committed
Land rapid7#3490, @Meatballs1 tns listener verbose output
2 parents 90df0f1 + cf720a8 commit b15297e

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

modules/auxiliary/scanner/oracle/tnslsnr_version.rb

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,22 @@ def run_host(ip)
4141

4242
data = sock.get_once
4343

44-
if ( data and data =~ /\\*.TNSLSNR for (.*)/ )
44+
if ( data && data =~ /\\*.TNSLSNR for (.*)/ )
4545
ora_version = data.match(/\\*.TNSLSNR for (.*)/)[1]
4646
report_service(
47-
:host => ip,
48-
:port => datastore['RPORT'],
49-
:name => "oracle",
50-
:info => ora_version
47+
:host => ip,
48+
:port => datastore['RPORT'],
49+
:name => "oracle",
50+
:info => ora_version
5151
)
5252
print_good("#{ip}:#{datastore['RPORT']} Oracle - Version: " + ora_version)
53+
elsif ( data && data =~ /\(ERR=(\d+)\)/ )
54+
case $1.to_i
55+
when 1189
56+
print_error( "#{ip}:#{datastore['RPORT']} Oracle - Version: Unknown - Error code #{$1} - The listener could not authenticate the user")
57+
else
58+
print_error( "#{ip}:#{datastore['RPORT']} Oracle - Version: Unknown - Error code #{$1}")
59+
end
5360
else
5461
print_error( "#{ip}:#{datastore['RPORT']} Oracle - Version: Unknown")
5562
end

0 commit comments

Comments
 (0)