Skip to content

NTLMv1 evidence: who still uses it, from exported event logs - #20

Merged
alexlinos merged 1 commit into
mainfrom
ntlmv1-evidence
Oct 5, 2026
Merged

alexlinos merged 1 commit into
mainfrom
ntlmv1-evidence

Conversation

@alexlinos

Copy link
Copy Markdown
Owner

This is step 3 of the review follow-up: a "who would break" check for NTLMv1. Microsoft's BlockNtlmv1SSO switches to enforce this month.

ADitor still never reads event logs itself. An admin runs a read-only script and ADitor reads its CSV.

Commands

  • aditor ntlm-script prints a PowerShell script built on Get-WinEvent. Event Log Readers membership is enough; it doesn't need Domain Admin. The admin lists the hosts to export. For each host it exports:
    • Security 4624 events with LmPackageName = NTLM V1. TargetUserSid S-1-5-7 (ANONYMOUS LOGON) is skipped.
    • NTLM/Operational 4020–4023 and 4030–4033 whose message says NTLM Version: NTLMv1. These exist on Windows 11 24H2 and Server 2025. Microsoft documents them by display label, not XML field name, so the script reads the message text, which assumes English.
    • Probe rows: the Security log's oldest event, the newest 4624, the newest NTLM-log event, and the export time.
  • aditor ntlm-check CSV… lists account, client and server pairs with counts and a last-seen time, a coverage line per host, and a verdict:
    • blocked: NTLMv1 was seen. Exit 1.
    • not yet: a host couldn't be read, logon auditing was off, or a log covers less than 14 days. Exit 1.
    • clear: none of those. It applies only to the hosts in the export, and says so. Exit 0.
    • Exit 2 means a file couldn't be read.
  • aditor scan --ntlm-evidence CSV… puts the result on the NTLMv2 card, with a table and the hosts covered. Start here shows "Still using NTLMv1" when the verdict is blocked. Without evidence, the card explains how to collect it.

Testing

  • CI: a new step runs the generated script on the Windows build machine's own logs, with Windows PowerShell 5.1. It prints the first lines of the CSV, has the built aditor-cli.exe read it, and fails if the Security log wasn't read.
  • Unit tests: 1,494 pass. New tests cover the verdict cases, combining several exports, refusing a CSV that isn't an export, the commands and exit codes, the report block and the Start here warning. One test asserts the script uses only read-only cmdlets.

Not in this PR

  • The desktop app.
  • Unsigned LDAP binds (2889).
  • RC4.
  • Mapping exported hosts to the scan's computer list (for example "exported 4 of 60 servers").

ADitor still never reads event logs itself. New:

- aditor ntlm-script prints a read-only PowerShell script (Get-WinEvent,
  Event Log Readers is enough) that exports, per host:
  - Security 4624 events with LmPackageName 'NTLM V1', skipping
    ANONYMOUS LOGON;
  - NTLM/Operational 4020-4023 and 4030-4033 whose message says
    NTLMv1 (Windows 11 24H2 / Server 2025);
  - probe rows: the log's oldest event, the newest logon, the newest
    NTLM-log event and the export time.
- aditor ntlm-check reads one or more exports. It lists account,
  client and server pairs with counts, and gives a verdict: blocked
  (NTLMv1 seen), not yet (an unreadable host, no logon auditing, or under
  14 days of log), or clear (only for the hosts exported). Exit codes
  0 / 1 / 2.
- aditor scan --ntlm-evidence puts the result on the NTLMv2 card. Start
  here warns "Still using NTLMv1" when it's blocked. Without evidence,
  the card says how to collect it.
- CI runs the script on the Windows build machine with Windows
  PowerShell 5.1 and has the built exe read its CSV.
@alexlinos
alexlinos merged commit 0666e7b into main Oct 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant