Skip to content

Script Path Check

Enumerates user logon script paths and checks whether the Standard User has write access to those scripts.

ad-kit check scriptPath

Prerequisite

Requires a valid Standard User account (authenticated).

Commands run

ad-kit reads user logon script paths with NetExec:

nxc ldap <dc_ip> -u <username> -p <password> -M get-scriptpath

The resolved SMB paths are then inspected using write-capable file handles (Impacket, in-process - no separate shell command).

What it checks

ad-kit:

  1. Reads the scriptPath attribute from user objects.
  2. Resolves each path (relative paths are resolved against the NETLOGON share).
  3. Inspects the resolved SMB paths using write-capable file handles, without writing any data.

How it works

A logon script runs automatically when the associated user signs in. Scripts are normally stored under the SYSVOL tree and exposed through the NETLOGON share. If a lower-privileged user can write to a script that a higher-privileged or targeted account runs, they can modify it to execute their own commands in that user's context at next logon.

Why it matters

Write access to a logon script is an opportunity to run code as the user who executes it, which can be a step towards privilege escalation where that user is privileged.

Findings

Finding ID Title
SCRIPT-001 Logon Script Writable by Standard User

Tooling

References