From 12fe7851857c7e502472593b35c4b7dfd81572c5 Mon Sep 17 00:00:00 2001 From: ron Date: Thu, 29 Apr 2010 11:46:58 +0000 Subject: [PATCH] Added the script-arg 'smbnoguest' to the smb scripts. It disables use of the guest account. Andrew Smith on nmap-dev commented that trying the guest account raised an IDS flag, and asked for a way to disable it. --- nselib/smbauth.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nselib/smbauth.lua b/nselib/smbauth.lua index 9ada636cf..e813b01e8 100644 --- a/nselib/smbauth.lua +++ b/nselib/smbauth.lua @@ -77,6 +77,7 @@ -- protocol altogether!). If you're using an extremely old system, you might need to set -- this to v1 or lm, which are less secure but more compatible. -- For information, see smbauth.lua. +--@args smbnoguest Set to 'true' or '1' to disable usage of the 'guest' account. module(... or "smbauth", package.seeall) @@ -257,7 +258,10 @@ function init_account(host) -- Add the anonymous/guest accounts add_account(host, '', '', '', nil, 'none') - add_account(host, 'guest', '', '', nil, 'ntlm') + + if(nmap.registry.args.smbnoguest == nil) then + add_account(host, 'guest', '', '', nil, 'ntlm') + end -- Add the account given on the commandline (TODO: allow more than one?) local args = nmap.registry.args