diff --git a/nselib/afp.lua b/nselib/afp.lua index 040116b9e..2a259fd2c 100644 --- a/nselib/afp.lua +++ b/nselib/afp.lua @@ -886,12 +886,16 @@ Proto = { local status, response if not HAVE_SSL then - return false, "OpenSSL not available, aborting ..." + response = Response:new() + response:setErrorMessage("OpenSSL not available, aborting ...") + return response end -- currently we only support AFP3.3 if afp_version == nil or ( afp_version ~= "AFP3.3" and afp_version ~= "AFP3.2" and afp_version ~= "AFP3.1" ) then - return false, "Incorrect AFP version" + response = Response:new() + response:setErrorMessage("Incorrect AFP version") + return response end if ( uam == "No User Authent" ) then @@ -1120,8 +1124,6 @@ Proto = { local pad = 0 local response, fork = {}, {} - print("volume_id" .. volume_id) - local data = bin.pack( "CC>S>I>S>S", COMMAND.FPOpenFork, flag, volume_id, did, file_bitmap, access_mode ) if path.type == PATH_TYPE.LongName then diff --git a/scripts/afp-brute.nse b/scripts/afp-brute.nse index aa698f60c..5e3a40bb6 100644 --- a/scripts/afp-brute.nse +++ b/scripts/afp-brute.nse @@ -6,6 +6,10 @@ local string = require "string" local table = require "table" local unpwdb = require "unpwdb" +-- we dont really need openssl here, but let's attempt to load it as a way +-- to simply prevent the script from running, in case we don't have it +local openssl = stdnse.silent_require("openssl") + description = [[ Performs password guessing against Apple Filing Protocol (AFP). ]]