Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oracle-tns-version.nse cannot get the oracle 19c or 21c of version #2331

Closed
linholmes opened this issue Jun 29, 2021 · 1 comment
Closed

oracle-tns-version.nse cannot get the oracle 19c or 21c of version #2331

linholmes opened this issue Jun 29, 2021 · 1 comment
Assignees
Labels

Comments

@linholmes
Copy link

@linholmes linholmes commented Jun 29, 2021

oracle-tns-version.nse
oracle 19c response is : \x00g\x00\x00\x04\x00\x00\x00"\x00\x00[(DESCRIPTION=(TMP=)(VSNNUM=318767104)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))

VSNNUM 318767104 to hex is 13000000

local function decode_vsnnum (vsnnum)
local hex = stdnse.tohex(tonumber(vsnnum))
local maj, min, a, b, c = string.unpack("c1 c1 c2 c1 c2", hex)
return string.format("%d.%d.%d.%d.%d",
tonumber(maj, 16),
tonumber(min, 16),
tonumber(a, 16),
tonumber(b, 16),
tonumber(c, 16)
)
end

it will be 1.3.0.0.0

changed to:

local function decode_vsnnum (vsnnum)
local version = tonumber(vsnnum)
return string.format("%d.%d.%d.%d",
version >> 24,
version >> 16 & 0xf,
version >> 12 & 0xff,
version >> 8 & 0xf
)
end

it will be 19.0.0.0

the same as 21c of oracle

@linholmes linholmes added the Nmap label Jun 29, 2021
@linholmes linholmes changed the title oracle-tns-version.nse cannot get oracle version of 19c or 21c oracle-tns-version.nse cannot get the oracle 19c or 21c of version Jun 29, 2021
dvas0004 added a commit to dvas0004/nmap that referenced this issue Apr 27, 2022
@nnposter nnposter self-assigned this May 6, 2022
@nnposter nnposter added bug NSE script and removed Nmap labels May 6, 2022
@nnposter
Copy link

@nnposter nnposter commented May 6, 2022

Thank you for reporting the issue and proposing a fix.

The change has been committed as r38379, with the following modifications:

  • There was a bug in the second bit offset. It should be 20, not 16.
  • The final fifth number should be included, to match what is reported when receiving the full version from the listener.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
@nnposter @linholmes and others