บทความก่อนหน้าเคยกล่าวว่าการปิด Debug Privilege สำหรับ System Admins ผ่าน Policy "Debug Programs" เป็นวิธีป้องกัน Mimikatz แต่นอกจากนี้พบว่า ถ้าไม่มี Debug Privilege (SeDebugPrivilege) Local Server Admin จะติดตั้งหรืออัปเดต Microsoft SQL Server ไม่ได้ เพราะ SQL Server Installer ตรวจสอบสิทธิ์ SeSecurity, SeBackup และ SeDebug ตอนเริ่มต้น ต้องรัน SQL Server Process และตรวจสอบการ Start สำเร็จ
อาการปัญหา
ระหว่างติดตั้ง SQL Server Installer ทำ Preliminary Checks พบปัญหา Setup account privileges คลิก Failed Link จะเห็น:
Rule "Setup account privileges" failed. The account that is running SQL Server Setup does not have one or all of the following rights: the right to back up files and directories, the right to manage auditing and the security log and the right to debug programs.
ใน Report SystemConfigurationCheck_Report.htm กฎ HasSecurityBackupAndDebugPrivilegesCheck พบว่า Process ปัจจุบันไม่มี Privileges: SeSecurity, SeBackup, SeDebug
วิธี Bypass Policy โดยไม่ปิด GPO
ใช้ Tool secedit จัดการ Local Security Policies
- ตรวจสอบ Privileges ปัจจุบัน:
whoami /priv→ ไม่มี SeDebugPrivilege - Export User Rights ปัจจุบัน:
secedit /export /cfg secpolicy.inf /areas USER_RIGHTS - เปิด secpolicy.inf เพิ่มบรรทัดใน Section [Privilege Rights]:
SeDebugPrivilege = *S-1-5-32-544(SID ของ Built-in Administrators Group) - Save แล้ว Apply:
secedit /configure /db secedit.sdb /cfg secpolicy.inf /overwrite /areas USER_RIGHTS(ยืนยัน Overwrite) - Log off/on แล้วตรวจสอบ
secpol.mscและwhoami /priv→ จะเห็นSeDebugPrivilege Debug programs Enabled
ตอนนี้สามารถติดตั้ง/อัปเดต SQL Server ได้ แต่จำไว้ว่า SeDebugPrivilege นี้เป็นชั่วคราว จะ Reset กลับค่าเดิมในรอบ GPO Update ถัดไป (หลัง Log off)
คำเตือน การ Enable Debug Programs Policy ไม่ป้องกัน Malicious Software ที่ได้ Local Admin Rights แล้วจากการขอ SeDebugPrivilege และอาจ Compromise Accounts ทั้งหมดบน Server