Skip to content

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

@linholmes

Description

@linholmes

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

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions