1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-17 05:09:00 +00:00

Rectify error "bad argument #2 to 'format'" in SMB scripts

Fixes #1713, closes #1714, closes #1480
This commit is contained in:
nnposter
2019-09-06 04:13:07 +00:00
parent 991a2fa888
commit ce28753b89
2 changed files with 5 additions and 1 deletions

View File

@@ -18,6 +18,9 @@ o [NSE][GH#1720] Functions lsa_lookupnames2 and lsa_lookupsids2 in library
msrpc were incorrectly referencing function strjoin when called with debug msrpc were incorrectly referencing function strjoin when called with debug
level 2 or higher. [Ivan Ivanov] level 2 or higher. [Ivan Ivanov]
o [NSE][GH#1480][GH#1713][GH#1714] A bug in SMB library was causing scripts to
fail with bad format argument error. [Ivan Ivanov]
o [NSE] New script, dicom-brute.nse, attempts to brute force the called o [NSE] New script, dicom-brute.nse, attempts to brute force the called
Application Entity Title of DICOM servers. [Paulino Calderon] Application Entity Title of DICOM servers. [Paulino Calderon]

View File

@@ -1206,7 +1206,8 @@ local function start_session_basic(smb, log_errors, overrides)
return false, "SMB: ERROR: Server returned less data than it was supposed to (one or more fields are missing); aborting [17]" return false, "SMB: ERROR: Server returned less data than it was supposed to (one or more fields are missing); aborting [17]"
end end
-- Check if we were allowed in -- Check if we were allowed in
local protocol_version, command, status, flags, flags2, pid_high, signature, unused, tid, pid, uid, mid, pos = string.unpack(header_format, header) local protocol_version, command, flags, flags2, pid_high, signature, unused, tid, pid, uid, mid, pos
protocol_version, command, status, flags, flags2, pid_high, signature, unused, tid, pid, uid, mid, pos = string.unpack(header_format, header)
-- Check if we're successful -- Check if we're successful
if(status == 0) then if(status == 0) then