Service:
Oracle Database (TNS Listener)Protocol:
TCPPort:
1521Used for:
Brokering client connections to Oracle Database instances through the TNS listener, which resolves SID and service names and hands each session off to the database enginePort 1521 is the default port for the Oracle TNS listener — the network process that fronts an Oracle Database. TNS (Transparent Network Substrate) is Oracle’s own connection protocol, and the listener is the broker: a client connects to 1521, asks for a database by its SID (system identifier) or service name, and the listener hands the session off to the matching instance. Nothing in the database is reachable until you get past the listener, which makes port 1521 the front door to some of the most sensitive data in an enterprise — HR, finance, ERP, and application back-ends all tend to sit behind Oracle. An open 1521 rarely means an easy pre-auth crash; it means a high-value target where the real path in is usually a guessed SID, a default password, and a misconfigured listener. That is exactly the combination that has burned Oracle shops for two decades.
Why It’s Open
Port 1521 is open because an Oracle Database is running and accepting network connections — that is the listener’s entire job. Application servers, reporting tools, ETL jobs, and DBAs all reach the database through it, so on any host running Oracle, 1521 (or a nearby port in the 1521–1526 range, since large deployments run multiple listeners) is expected to be listening. The problem is where it listens. The listener frequently ends up bound to 0.0.0.0 and reachable well beyond the application tier that legitimately needs it — exposed to the whole corporate LAN, a flat VLAN, a cloud security group that’s wider than intended, or occasionally the public internet. Older installs also shipped with the listener effectively unauthenticated and with valid node checking (the listener’s IP allowlist) turned off, so anything that can route to port 1521 can interrogate it. Because Oracle is long-lived infrastructure, plenty of production listeners are years behind on patches and still carry the defaults they were installed with.
Common Risks
- SID / service-name disclosure and brute force. You can’t attack the database until you know a valid SID or service name. Unpatched listeners answer
STATUSandSERVICESqueries that leak them outright; where they don’t, SIDs are short and brute-forceable from wordlists (ORCL,XE,PROD,ORACLE). - Default and weak database credentials. Oracle historically shipped a long list of well-known accounts: SYSTEM/manager, SYS/change_on_install, SCOTT/tiger, DBSNMP/dbsnmp, OUTLN/outln, MDSYS/mdsys and dozens more. Any one that was never changed is a direct login, and DBSNMP or SYSTEM often means immediate DBA.
- TNS Poisoning. On listeners without valid node checking, an attacker can register a rogue instance with the same service name and man-in-the-middle real client sessions (CVE-2012-1675, below).
- Post-authentication becomes host compromise. Once you have any database account, Oracle’s built-in packages (
UTL_FILE,DBMS_SCHEDULER, Java stored procedures, external tables) turn a single low-privileged login into file read/write, OS command execution, and privilege escalation to DBA. - Offline password cracking. Weaknesses in the native authentication protocol let a remote, unauthenticated attacker pull the session key and salt for a named user and crack the password offline (CVE-2012-3137).
- Cleartext protocol on legacy setups. Without Oracle Native Network Encryption or TLS, TNS traffic — including data and, on older versions, authentication material — can be sniffed on the wire.
Want to save time on reporting?
Let PentestPad generate, track, and export your reports - automatically.

Enumeration & Testing
Work the listener from the outside in: confirm the version, learn a SID/service name, then test credentials, and only then look at what a valid login lets you do.
Fingerprint the listener and version
nmap -sV -p 1521 --script "oracle-tns-version" <target>Query the listener directly
tnscmd10g speaks TNS and asks the listener about itself. Unpatched or unauthenticated listeners answer with version, service names, and status:
tnscmd10g version -h <target> -p 1521tnscmd10g status -h <target> -p 1521Discover the SID / service name
If the listener won’t volunteer a SID, brute-force it:
# Nmap NSE SID brutenmap -p 1521 --script "oracle-sid-brute" <target>
# odat (Oracle Database Attacking Tool) SID guesserodat.py sidguesser -s <target> -p 1521Metasploit listener and SID modules
msfconsole -quse auxiliary/scanner/oracle/tnslsnr_versionset RHOSTS <target>run
use auxiliary/scanner/oracle/sid_enumset RHOSTS <target>run
use auxiliary/scanner/oracle/sid_bruteset RHOSTS <target>runCheck for TNS Poisoning (CVE-2012-1675)
use auxiliary/scanner/oracle/tnspoison_checkerset RHOSTS <target>runTest credentials against a known SID
# Nmap default-account and brute scripts (need a SID)nmap -p 1521 --script "oracle-brute" --script-args oracle-brute.sid=<SID> <target>
# odat password guesserodat.py passwordguesser -s <target> -p 1521 -d <SID>
# Metasploit account brute forceuse auxiliary/scanner/oracle/oracle_loginset RHOSTS <target>set SID <SID>run
# Hydra against the listener password (PL/SQL listener)hydra -P passwords.txt <target> oracle-listenerLog in and check what the account can do
sqlplus system/manager@//<target>:1521/<SID>The full post-auth kill chain — UTL_FILE file read/write, DBMS_XSLPROCESSOR uploads, external-table OS command execution, and DBA privilege escalation — is what odat.py all -s <target> -p 1521 -d <SID> automates once you have a credential. Record every SID you recover, every account that authenticates, and every listener that answers a STATUS query, so the evidence lands in the pentest report instead of a scratch terminal you’ll lose.
What to Look For
| Checkpoint | What it means |
|---|---|
Listener answers STATUS/SERVICES to tnscmd10g |
Valid node checking is off — SIDs, versions, and service names leak to anyone who can reach the port |
| SID recovered by brute force or disclosure | You now have the target string every credential and exploit needs |
| Default account logs in (SYSTEM/manager, SYS/change_on_install, SCOTT/tiger, DBSNMP/dbsnmp) | High severity — direct database access, often DBA |
tnspoison_checker reports the listener as vulnerable |
Rogue-instance registration and session MITM are possible (CVE-2012-1675) |
| Old version banner (10g / 11g pre-CPU) | Check for the session-key theft flaw (CVE-2012-3137) and the Java VM RCE (CVE-2018-3110) |
| Listener reachable from outside the app tier | Front door of a sensitive database exposed far wider than it should be |
Known CVEs and Exploits
Oracle Database’s biggest real-world exposure is not a single glamorous pre-auth bug — it’s weak or default credentials, a chatty listener, and post-authentication abuse of built-in packages. Oracle ships security fixes on a strict quarterly Critical Patch Update (CPU) cadence, so a database that is even a couple of quarters behind will carry dozens of lower-profile issues. The named CVEs below are the ones that matter most for port 1521 specifically; each is verified against its NVD record:
- CVE-2012-1675 — TNS Poisoning (“TNS Poison”). A remote attacker registers a database instance or service name that already exists with the listener, then man-in-the-middles connections that clients make to that service — allowing them to hijack sessions and run database commands. Affects Oracle Database 10g/11g (10.2.0.3–11.2.0.3) and other TNS-based Oracle products; CVSS 2.0 base 7.5. Oracle never shipped a patch that changes the default behaviour; it is mitigated by enabling valid node checking / COST (Class of Secure Transports) to restrict remote registration. Metasploit’s
auxiliary/scanner/oracle/tnspoison_checkertests for it. - CVE-2012-3137 — A flaw in the Oracle authentication protocol (the “stealth password” O5LOGIN mechanism) lets a remote, unauthenticated attacker obtain the session key and salt for an arbitrary named user, then brute-force that user’s password entirely offline. Affects Oracle Database 10.2.0.3–11.2.0.3; CVSS 2.0 base 6.4. It turns a single valid username into a crackable hash without ever touching the login counter.
- CVE-2018-3110 — A critical flaw in the Oracle Database Java VM component. An attacker with a low-privileged account holding only
CREATE SESSIONand network access over Oracle Net can fully compromise the Java VM, with the scope changing to take over the host (CVSS 3.0 base 9.9 Critical, vectorAV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H). It affects 11.2.0.4, 12.1.0.2, 12.2.0.1 and 18. Oracle considered it serious enough to break its normal schedule and publish an out-of-band security alert, and the Windows patches in particular shipped outside the regular CPU. Note that it is post-authentication — you still need a database account first, which is why weak credentials and SID brute forcing are the real enablers.
Honest framing: unlike, say, Telnet or an old SMB stack, most Oracle compromises through port 1521 do not start with a memory-corruption exploit. They start with a guessed SID and a default password, and then use entirely legitimate database features (UTL_FILE, external tables, DBMS_SCHEDULER, Java procedures) to reach the OS. Treat credential hygiene and listener hardening as the primary defence, and the CVE patching as the necessary backstop.
Mitigation
- Change every default and weak password. Audit for SYSTEM/manager, SYS/change_on_install, SCOTT/tiger, DBSNMP/dbsnmp, OUTLN, MDSYS and the rest; lock or expire accounts you don’t use, and enforce Oracle password verification profiles with lockout thresholds.
- Enable valid node checking / COST so only known application-tier IPs can connect to or register with the listener — this is the primary mitigation for TNS Poisoning (CVE-2012-1675) and a hard limit on remote enumeration.
- Set a listener password and restrict administration, and don’t run the listener or the database as an over-privileged OS user.
- Encrypt the transport. Turn on Oracle Native Network Encryption or TLS (TCPS) so TNS traffic and authentication material aren’t sniffable.
- Stay current on Critical Patch Updates. Applying the quarterly CPU is what closes CVE-2012-3137, CVE-2018-3110, and the long tail of lower-severity bugs — a database several quarters behind is the norm and it’s exploitable.
- Firewall port 1521 to the specific application and admin hosts that need it. An Oracle listener should never be reachable from a flat corporate LAN, let alone the internet — rescan (
nmap -p 1521 <target>) after locking it down to confirm.
Real-World Example
The canonical port-1521 attack is TNS Poisoning, disclosed by Joxean Koret and assigned CVE-2012-1675. Oracle’s listener allowed any host that could reach it to remotely register a database instance. Register a second instance using the same service name as a real production database, and the listener — trying to load-balance — begins routing a share of incoming client sessions to the attacker’s rogue instance. The attacker relays that traffic to the genuine database while sitting in the middle, reading and modifying queries and results: a full man-in-the-middle against sessions the client believed were going straight to production. What made it notorious was Oracle’s response — rather than a code patch that changed the default, the fix was to configure the listener (valid node checking / COST) to refuse remote registration, meaning every unhardened 10g/11g listener stayed vulnerable by default long after disclosure. It’s the perfect illustration of the port-1521 lesson: the danger isn’t an exotic overflow, it’s a powerful protocol left open and unrestricted. Tools like Metasploit’s tnspoison_checker and odat.py tnspoison will tell you in seconds whether a given listener still accepts the trick.
FAQ
What is port 1521 used for?
Port 1521 is the default port for the Oracle TNS listener, the process that accepts client connections to an Oracle Database. A client connects to 1521, requests a database by its SID or service name, and the listener hands the session to the matching instance. Application servers, reporting tools, and DBAs all reach Oracle through it.
Why is port 1521 open?
Because an Oracle Database is running and listening for network connections — that’s expected on any Oracle host. The risk is scope: the listener is often bound to all interfaces and reachable far beyond the application tier that legitimately needs it, sometimes across a flat LAN or, occasionally, the internet. If you don’t run Oracle and see 1521 open, investigate what installed it.
Is port 1521 dangerous to expose?
Yes, on any untrusted network. Behind it sits some of the most sensitive data in an organization, and the usual path in — guess a SID, try default passwords, then abuse built-in database features to reach the OS — needs no zero-day. Combined with TNS Poisoning on unhardened listeners, an exposed 1521 is a high-value target. Keep it firewalled to known app and admin hosts.
What are the default Oracle database passwords?
Historically Oracle shipped many well-known accounts, including SYSTEM/manager, SYS/change_on_install, SCOTT/tiger, DBSNMP/dbsnmp, OUTLN/outln and MDSYS/mdsys, among dozens more. Any that were never changed are direct logins, and several (SYSTEM, DBSNMP) often carry high privilege. Auditing and rotating these is the single highest-impact fix on the port.
What is TNS Poisoning?
TNS Poisoning (CVE-2012-1675) is an attack where a remote host registers a rogue database instance under the same service name as a real one, causing the listener to route a portion of client sessions through the attacker for a man-in-the-middle. It affects listeners without valid node checking. Oracle’s fix is a configuration change (valid node checking / COST) rather than a default-behaviour patch, so many old listeners remain vulnerable.
How do I secure or close port 1521?
Change all default credentials, enable valid node checking / COST and a listener password, turn on network encryption, apply the quarterly Critical Patch Update, and firewall 1521 to only the application and admin hosts that require it. If nothing legitimately connects to a given listener, stop it and confirm the port is closed with a rescan.
TL;DR
- Service: Oracle Database TNS listener (the connection broker fronting Oracle instances)
- Default port: 1521/TCP (large deployments also use 1521–1526)
- Biggest risk: default/weak database credentials plus a chatty, unrestricted listener — SID brute force, default logins, TNS Poisoning (CVE-2012-1675), and post-auth abuse of built-in packages to reach the OS
- Mitigation: rotate all default passwords, enable valid node checking / COST and a listener password, encrypt the transport, apply quarterly CPUs, and firewall 1521 to known app/admin hosts — capture findings in the pentest report
Related database ports worth checking on the same engagement: Port 1433 – Microsoft SQL Server, Port 3306 – MySQL, Port 5432 – PostgreSQL, and Port 27017 – MongoDB.