Database Assessmentoracletnslsnrdatabaseversionpingstatus

tnscmd10g

tnscmd10g is a tool to prod the Oracle TNSLSNR process on port 1521/tcp. It sends TNS commands like version, ping, and status to query the target Oracle listener.

Description

tnscmd10g is designed to interact with Oracle TNS listeners by sending specific CONNECT_DATA commands to probe the service. The tool targets the tnslsnr process typically running on TCP port 1521, allowing security researchers to gather information about Oracle database servers.

Common use cases include version enumeration, service status checking, and basic connectivity testing (ping). It reveals details like TNS listener version, platform information, and protocol adapters without requiring authentication, making it valuable for reconnaissance during database assessments.

The tool supports customization through various flags for port specification, logging raw packets, formatting output, and advanced options like faking command sizes to detect packet leakage or compatibility with 10G versions.

How It Works

tnscmd10g constructs and sends TNS protocol packets to the target host on port 1521/tcp (configurable). It builds CONNECT_DATA structures with specified commands (version, ping, status, etc.) wrapped in TNS formatting. The tool writes the packet, reads the response from the tnslsnr process, and displays raw or formatted output showing version numbers, error codes, and service details. Options like --rawcmd allow custom CONNECT_DATA strings, while --cmdsize fakes packet lengths to test for information leakage.

Installation

bash
sudo apt install tnscmd10g

Flags

-hspecify target hostname
-palternate TCP port to use (default is 1521)
--logfilewrite raw packets to specified logfile
--indentindent & outdent on parens
--10Gmake it work against 10G
--rawcmdbuild your own CONNECT_DATA string
--cmdsizefake TNS command size (reveals packet leakage)

Examples

Retrieve the version from the target server
tnscmd10g version -h 192.168.1.205
Send default ping command to target (default command)
tnscmd10g -h 192.168.1.205
Explicitly ping the target TNS listener
tnscmd10g ping -h 192.168.1.205
Retrieve status information from the target server
tnscmd10g status -h 192.168.1.205
Retrieve version using alternate port 1522
tnscmd10g version -h 192.168.1.205 -p 1522
Retrieve version and log raw packets to file
tnscmd10g version -h 192.168.1.205 --logfile packets.log
Retrieve version with indented output formatting
tnscmd10g version -h 192.168.1.205 --indent
Updated 2026-04-16kali.org ↗