Skip to content

Commit c028506

Browse files
committed
Add new module to test TNS poison
msf auxiliary(tnspoison_checker) > show options Module options (auxiliary/scanner/oracle/tnspoison_checker1): Name Current Setting Required Description ---- --------------- -------- ----------- RHOSTS 172.16.2.100, 172.16.2.24, 172.16.2.101 yes The target address range or CIDR identifier RPORT 1521 yes The target port THREADS 1 yes The number of concurrent threads msf auxiliary(tnspoison_checker) > exploit [+] 172.16.2.100:1521 is vulnerable [*] Scanned 1 of 3 hosts (033% complete) [-] 172.16.2.24:1521 is not vulnerable [*] Scanned 2 of 3 hosts (066% complete) [-] 172.16.2.101:1521 unable to connect to the server [*] Scanned 3 of 3 hosts (100% complete) [*] Auxiliary module execution completed
1 parent 621b952 commit c028506

File tree

1 file changed

+16
-23
lines changed

1 file changed

+16
-23
lines changed

modules/auxiliary/scanner/oracle/tnspoison_checker.rb

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@ class Metasploit3 < Msf::Auxiliary
1313

1414
def initialize(info = {})
1515
super(update_info(info,
16-
'Name' => 'Oracle TNS Poison vulnerability',
16+
'Name' => 'Oracle TNS Listener Checker',
1717
'Description' => %q{
18-
This module simply checks the server for vulnerabilities like TNS Poison.
18+
This module checks the server for vulnerabilities like TNS Poison.
19+
Module sends to server a packet with command to register new TNS Listener and check response.
1920
},
20-
'Author' => ['ir0njaw (Kelesis Nikita)'],
21-
'Company' => ['Digital Security - http://dsec.ru'],
22-
'License' => MSF_LICENSE,
23-
'DisclosureDate' => 'Oct 12 2014'))
21+
'Author' => ['ir0njaw (Nikita Kelesis) <[email protected]>'], # of Digital Security [http://dsec.ru]
22+
'References' =>
23+
[
24+
[ 'URL', 'http://seclists.org/fulldisclosure/2012/Apr/204' ],
25+
],
26+
'License' => MSF_LICENSE))
2427

2528
register_options(
2629
[
@@ -33,23 +36,13 @@ def initialize(info = {})
3336
def run_host(ip)
3437
begin
3538
connect
36-
37-
pkt = tns_packet("(CONNECT_DATA=(COMMAND=service_register_NSGR))")
38-
sock.put(pkt)
39-
a= sock.read(100)
40-
41-
flag = a.include? "(ERROR_STACK=(ERROR="
42-
if (flag==true) then print_error ip+" is not vulnerable"
43-
else print_good ip+" is vulnerable"
44-
end
45-
46-
rescue ::Rex::ConnectionError, ::Errno::EPIPE
47-
print_error("#{ip} unable to connect to the server")
48-
49-
50-
rescue ::Rex::ConnectionError
51-
rescue ::Errno::EPIPE
52-
39+
send_packet = tns_packet("(CONNECT_DATA=(COMMAND=service_register_NSGR))")
40+
sock.put(send_packet)
41+
packet = sock.read(100)
42+
find_packet = packet.include? "(ERROR_STACK=(ERROR="
43+
find_packet == true ? print_error("#{ip}:#{rport} is not vulnerable ") : print_good("#{ip}:#{rport} is vulnerable")
44+
rescue ::Rex::ConnectionError, ::Errno::EPIPE
45+
print_error("#{ip}:#{rport} unable to connect to the server")
5346
end
5447
end
5548
end

0 commit comments

Comments
 (0)