1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-28 02:19:04 +00:00

Update default-category scripts to use bitwise operators instead of bit.lua

This commit is contained in:
dmiller
2017-03-13 14:58:56 +00:00
parent 090b522c06
commit 3e3f600b8a
10 changed files with 80 additions and 91 deletions

View File

@@ -1,4 +1,3 @@
local bit = require "bit"
local os = require "os"
local datetime = require "datetime"
local smb = require "smb"
@@ -121,7 +120,7 @@ action = function(host)
local warnings = {}
-- User-level authentication or share-level authentication
if(bit.band(security_mode, 1) == 1) then
if(security_mode & 1) == 1 then
response.authentication_level = "user"
else
response.authentication_level = "share"
@@ -129,7 +128,7 @@ action = function(host)
end
-- Challenge/response supported?
if(bit.band(security_mode, 2) == 0) then
if(security_mode & 2) == 0 then
response.challenge_response = "plaintext-only"
warnings.challenge_response = "dangerous"
else
@@ -137,9 +136,9 @@ action = function(host)
end
-- Message signing supported/required?
if(bit.band(security_mode, 8) == 8) then
if(security_mode & 8) == 8 then
response.message_signing = "required"
elseif(bit.band(security_mode, 4) == 4) then
elseif(security_mode & 4) == 4 then
response.message_signing = "supported"
else
response.message_signing = "disabled"