id: oracle-tns-listener

info:
  name: Oracle TNS Listener - Detect
  author: pussycat0x
  severity: info
  description: |
    Oracle clients communicate with the database using the Transparent Network Substrate (TNS) protocol. When the listener receives a connection request (tcp port 1521, by default), it starts up a new database process and establishes a connection between the client and the database.
  reference:
    - https://www.tenable.com/plugins/nessus/110053
  metadata:
    verified: true
    max-request: 1
    shodan-query: product:"Oracle TNS Listener"
  tags: js,detect,oracle,tns,network,discovery

javascript:
  - pre-condition: |
      isPortOpen(Host,Port);
    code: |
      var m = require("nuclei/oracle");
      var response = m.IsOracle(Host, Port);
      Export(response);
    args:
      Host: "{{Host}}"
      Port: "1521"

    extractors:
      - type: regex
        name: Version
        regex:
          - 'Oracle TNS Listener Version:([0-9.]+)'
# digest: 4a0a0047304502203de7f1776d1d7f3d4c955f6d333d10c6b5ce25eacc3c354ea581626fc4fad01f022100b7d54d775561d37513b0d164d2b96e6a9d888457f91a5d3a972d661cbbea0ded:922c64590222798bb761d5b6d8e72950