From 49ba383eee907bc383fbdc11eefb3564c733b699 Mon Sep 17 00:00:00 2001 From: dmiller Date: Sun, 30 Apr 2017 13:18:06 +0000 Subject: [PATCH] Avoid crash if AuthMethod key is not set in iscsi handshake. Fixes #631 --- nselib/iscsi.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nselib/iscsi.lua b/nselib/iscsi.lua index f84848ab0..6d3ddf7b9 100644 --- a/nselib/iscsi.lua +++ b/nselib/iscsi.lua @@ -589,7 +589,9 @@ Helper = { end local auth_method = resp.kvp:get("AuthMethod")[1] - if ( auth_method:upper() ~= "NONE" ) then + if not auth_method then + stdnse.debug1("Missing AuthMethod, proceeding as if NONE was sent.") + elseif ( auth_method:upper() ~= "NONE" ) then return false, "ERROR: iscsi.Helper.discoverTargets: Unsupported authentication method" end