mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 21:21:31 +00:00
* Cryptographic numbers should be output as such,
not as userdata pointers to opaque data structures. Fixes #1876
This commit is contained in:
@@ -25,10 +25,13 @@ o [Windows] Add support for the new loopback behavior in Npcap 0.9983. This
|
|||||||
Adapter to be installed, which was a source of problems for some users.
|
Adapter to be installed, which was a source of problems for some users.
|
||||||
[Daniel Miller]
|
[Daniel Miller]
|
||||||
|
|
||||||
o [NSE][GH1837] Nmap no longer crashes when SMB scripts, such as smb-ls, call
|
o [NSE][GH#1876] XML output from script ssl-cert now includes RSA key modulus
|
||||||
|
and exponent [nnposter]
|
||||||
|
|
||||||
|
o [NSE][GH#1837] Nmap no longer crashes when SMB scripts, such as smb-ls, call
|
||||||
smb.find_files [nnposter]
|
smb.find_files [nnposter]
|
||||||
|
|
||||||
o [NSE][GH1802] The MongoDB library was causing errors when assembling protocol
|
o [NSE][GH#1802] The MongoDB library was causing errors when assembling protocol
|
||||||
payloads. [nnposter]
|
payloads. [nnposter]
|
||||||
|
|
||||||
o [NSE][GH#1781][GH#1796] The RTSP library was not correctly generating request
|
o [NSE][GH#1781][GH#1796] The RTSP library was not correctly generating request
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ local string = require "string"
|
|||||||
local table = require "table"
|
local table = require "table"
|
||||||
local tls = require "tls"
|
local tls = require "tls"
|
||||||
local unicode = require "unicode"
|
local unicode = require "unicode"
|
||||||
|
local have_openssl, openssl = pcall(require, "openssl")
|
||||||
|
|
||||||
description = [[
|
description = [[
|
||||||
Retrieves a server's SSL certificate. The amount of information printed
|
Retrieves a server's SSL certificate. The amount of information printed
|
||||||
@@ -101,6 +102,8 @@ certificate.
|
|||||||
-- <table key="pubkey">
|
-- <table key="pubkey">
|
||||||
-- <elem key="type">rsa</elem>
|
-- <elem key="type">rsa</elem>
|
||||||
-- <elem key="bits">2048</elem>
|
-- <elem key="bits">2048</elem>
|
||||||
|
-- <elem key="modulus">DF40CCF2C50A0D65....35B5927DF25D4DE5</elem>
|
||||||
|
-- <elem key="exponent">65537</elem>
|
||||||
-- </table>
|
-- </table>
|
||||||
-- <elem key="sig_algo">sha1WithRSAEncryption</elem>
|
-- <elem key="sig_algo">sha1WithRSAEncryption</elem>
|
||||||
-- <table key="validity">
|
-- <table key="validity">
|
||||||
@@ -212,7 +215,18 @@ local function output_tab(cert)
|
|||||||
local o = stdnse.output_table()
|
local o = stdnse.output_table()
|
||||||
o.subject = name_to_table(cert.subject)
|
o.subject = name_to_table(cert.subject)
|
||||||
o.issuer = name_to_table(cert.issuer)
|
o.issuer = name_to_table(cert.issuer)
|
||||||
o.pubkey = cert.pubkey
|
o.pubkey = {}
|
||||||
|
for k, v in pairs(cert.pubkey) do
|
||||||
|
local out = v
|
||||||
|
if have_openssl and type(v) == "userdata" then
|
||||||
|
if k == "exponent" then
|
||||||
|
out = openssl.bignum_bn2dec(v)
|
||||||
|
else
|
||||||
|
out = openssl.bignum_bn2hex(v)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
o.pubkey[k] = out
|
||||||
|
end
|
||||||
o.extensions = cert.extensions
|
o.extensions = cert.extensions
|
||||||
o.sig_algo = cert.sig_algorithm
|
o.sig_algo = cert.sig_algorithm
|
||||||
o.validity = {}
|
o.validity = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user