File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
modules/auxiliary/scanner/oracle Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,23 @@ def run_host(ip)
42
42
send_packet = tns_packet ( "(CONNECT_DATA=(COMMAND=service_register_NSGR))" )
43
43
sock . put ( send_packet )
44
44
packet = sock . read ( 100 )
45
- find_packet = /\( ERROR_STACK=\( ERROR=/ === packet
46
- find_packet == true ? print_error ( "#{ ip } :#{ rport } is not vulnerable " ) : print_good ( "#{ ip } :#{ rport } is vulnerable" )
45
+ if packet != nil
46
+ hex_packet = Rex ::Text . to_hex ( packet , prefix = ':' )
47
+ split_hex = hex_packet . split ( ":" )
48
+ find_packet = /\( ERROR_STACK=\( ERROR=/ === packet
49
+ #find_packet == true ? print_error("#{ip}:#{rport} is not vulnerable ") : print_good("#{ip}:#{rport} is vulnerable")
50
+ if find_packet == true #TNS Packet returned ERROR
51
+ print_error ( "#{ ip } :#{ rport } is not vulnerable" )
52
+ elsif split_hex [ 5 ] == "02" #TNS Packet Type: ACCEPT
53
+ print_good ( "#{ ip } :#{ rport } is vulnerable" )
54
+ elsif split_hex [ 5 ] == "04" #TNS Packet Type: REFUSE
55
+ print_error ( "#{ ip } :#{ rport } is not vulnerable" )
56
+ else #All other TNS packet types or non-TNS packet type response cannot guarantee vulnerability
57
+ print_error ( "#{ ip } :#{ rport } might not be vulnerable" )
58
+ end
59
+ else
60
+ print_error ( "#{ ip } :#{ rport } is not vulnerable" )
61
+ end
47
62
# TODO: Module should report_vuln if this finding is solid.
48
63
rescue ::Rex ::ConnectionError , ::Errno ::EPIPE
49
64
print_error ( "#{ ip } :#{ rport } unable to connect to the server" )
You can’t perform that action at this time.
0 commit comments