Oracle TNS Listener - Port 1521,1522-1529
Last updated
Was this helpful?
Last updated
Was this helpful?
Become VeryLazyTech ! π
Follow us on:
β Twitter .
πΎ Github .
π Medium .
Visit our for e-books and courses. π
Support us and . β
Oracle databases are widely used across industries for storing sensitive enterprise data. However, their exposure to the networkβββespecially via the Transparent Network Substrate (TNS) listenerβββcan introduce serious security risks. Oracle TNS operates over default port 1521, but in complex environments, you may encounter instances on 1522β1529 or even beyond. This article provides in-depth techniques for enumerating, exploiting, and securing Oracle TNS listeners, with real-world examples and practical commands.
What is TNS?
TNS (Transparent Network Substrate) is Oracleβs proprietary protocol that enables communication between Oracle clients and databases across a network. It allows connections, sessions, and commands like CONNECT
, DATA
, RESOLVE
, etc., to flow through Oracle listeners.
Default Ports
1521βββPrimary default listener port
1522β1529βββOften used for additional listeners, RAC (Real Application Clusters), or other configured services
In real-world Oracle deployments, multiple listener processes may be used for load balancing, high availability, or segregation of duties across applications.
2.1. CVE-2012β1675βββTNS Poison Attack
Description: A critical vulnerability allowing attackers to hijack database sessions by registering rogue services with the listener.
Impact: MITM attacks, data exfiltration, and full control over database traffic.
Mitigation: Use VALID_NODE_CHECKING_REGISTRATION = YES
and restrict registration IPs.
Many Oracle listeners are deployed with no password or authentication, allowing unauthenticated attackers to:
View service names
Stop, start, or reload the listener
Perform Denial-of-Service (DoS) attacks
An attacker can request a STATUS
command to retrieve:
Hostnames
Service names
Instance names
Database version
3.1. Nmap Scanning
Start by identifying open ports and checking for Oracle services.
Use the Oracle-specific NSE script:
Output reveals the listener version, hostname, and Oracle SID.
Oracle client installations come with tnsping
:
Alternatively, simulate TNSping with Python or Netcat by sending crafted TNS packets.
Send raw TNS packets:
You can script this using Python socket
module to brute-force or enumerate SIDs.
4.1. Exploiting TNS Poison Attack (CVE-2012β1675)
Metasploit Module:
Warning: This module may crash the listener or disrupt sessions. Use only in lab or authorized environments.
If listener commands like STATUS
, STOP
, or RELOAD
are unauthenticated:
You can perform a Denial-of-Service:
Learn & practice
Become VeryLazyTech ! π
β Twitter .
πΎ Github .
π Medium .
πΊ YouTube .
π© Telegram .
π΅οΈββοΈ My Site .
Visit our for e-books and courses. π
Support us and . β