伺服器被植入後門、挖礦、勒索軟體,往往源於弱密碼、未修補漏洞、暴露管理埠。本文提供無需專業工具、純原生指令、5 分鐘上手的三步自檢法,適合中小企業無專職安全部門場景。
lusrmgr.msc → 回車。Administrator(建議已重命名)、Domain Admins(域環境)。admin$、backup$、test、sql、oracle 等非預期帳號 → 立即停用、重置密碼、審計其登入日誌。
Guest 已停用)、業務必要服務帳號。eventvwr.msc → 回車。4624,4625,4634,4647(登入成功/失敗、登出、用戶登出)。mstsc.exe、lsass.exe、異常路徑)。shell:startup # 當前用戶 shell:common startup # 所有用戶
應為空。發現 .bat、.vbs、.exe、捷徑 → 全盤掃毒、提交沙箱分析。
msconfig → 「啟動」標籤(Win10/Server 2016+ 導向工作管理員)。A.EXE、XXXXI1SU2.EXE)、製造商為空、命令行指向 Temp/AppData/Public、簽名未驗證。regedit → HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Run (32位程式於64位系統)
powershell -enc/cmd /c/wscript、值名亂碼。# 檢查 Administrators 群組成員
Get-LocalGroupMember Administrators | Format-Table Name, PrincipalSource
# 近 7 天登入成功事件 (Type 10 = RDP)
Get-WinEvent -FilterHashtable @{LogName='Security'; ID=4624; StartTime=(Get-Date).AddDays(-7)} |
Where-Object {$_.Properties[8].Value -eq 10} |
Select-Object TimeCreated, @{N='Account';E={$_.Properties[5].Value}}, @{N='IP';E={$_.Properties[18].Value}}, @{N='LogonType';E={$_.Properties[8].Value}} |
Format-Table -AutoSize
# 掃描 Run 鍵值
$runPaths = @(
'HKCU:\Software\Microsoft\Windows\CurrentVersion\Run',
'HKLM:\Software\Microsoft\Windows\CurrentVersion\Run',
'HKLM:\Software\Microsoft\Windows\CurrentVersion\RunOnce',
'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Run'
)
foreach ($p in $runPaths) {
if (Test-Path $p) { Get-ItemProperty $p | Format-List }
}
賬戶、日誌、啟動項三步走,覆蓋「誰有權限、誰來過、誰常駐」三大核心面向。無專業工具也能完成基礎自檢。習慣每週跑一次腳本、每月審一次日誌、每季演練一次應急,將入侵發現時間從「月級」壓縮至「天/小時級」。