Windows OS Hub
  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux

 Windows OS Hub / SQL Server / How to Obtain SeDebugPrivilege when Debug Program Policy is Enabled

March 11, 2024 SQL ServerWindows Server 2019

How to Obtain SeDebugPrivilege when Debug Program Policy is Enabled

In the previous article, we told that one of the ways to defending against mimikatz-like tools is disabling the debug privilege for system administrators using Debug Program policy. However, recently it turned out that without the debug privilege (it is SeDebugPrivilege in Windows), a local server administrator cannot install or update Microsoft SQL Server. The matter is that when started, the SQL Server installer checks if there are the SeSecurity, SeBackup and SeDebug privileges. It needs to run the SQL Server process and get the information about the successful start of SQL Server. Here is what it looks like.

During SQL Server installation, the installer performs preliminary checks and identifies some problems with Setup account privileges.

sql server setup error: Setup account privileges failed

If you click the Failed link, you can see the following message:

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. To continue, use an account with both of these rights. For more information, see https://msdn.microsoft.com/en-us/library/ms813696.aspx, https://msdn.microsoft.com/en-us/library/ms813959.aspx and https://msdn.microsoft.com/en-us/library/ms813847.aspx.

Rule “Setup account privileges” failed.

Now open the SystemConfigurationCheck_Report.htm report.

HasSecurityBackupAndDebugPrivilegesCheck failed

As you can see, when checking the HasSecurityBackupAndDebugPrivilegesCheck rule, the installer has found that the current process hasn’t got one of the following privileges:

  • SeSecurity – managing the audit and security logs
  • SeBackup – the permissions to backup files and folders
  • SeDebug — the privilege to debug programs

There is some detailed information in the log showing that the installation process doesn’t have SeDebug flag.

(09) 2017-12-12 11:15:13 Slp: Initializing rule      : Setup account privileges
(09) 2017-12-12 11:15:13 Slp: Rule is will be executed  : True
(09) 2017-12-12 11:15:13 Slp: Init rule target object: Microsoft.SqlServer.Configuration.SetupExtension.FacetPrivilegeCheck
(09) 2017-12-12 11:15:13 Slp: Rule ‘HasSecurityBackupAndDebugPrivilegesCheck’ Result: Running process has SeSecurity privilege, has SeBackup privilege and does not have SeDebug privilege.
(09) 2017-12-12 11:15:13 Slp: Evaluating rule        : HasSecurityBackupAndDebugPrivilegesCheck
(09) 2017-12-12 11:15:13 Slp: Rule running on machine: rom-sql10
(09) 2017-12-12 11:15:13 Slp: Rule evaluation done   : Failed

I have decided to look for a workaround solution of getting SeDebugPrivilege without changing or disabling the Debug programs policy. It turned out that there is quite an easy way to bypass this policy if you have local administrator privileges on your server. The secedit tool that allows managing local security policies of the server will help us.

Check the current privileges:

whoami /priv

whoami priv

As you can see, there is no SeDebugPrivilege in the current token of the user.

Export the current user rights set by the group policies to a text file:

secedit /export /cfg secpolicy.inf /areas USER_RIGHTS

Using any text editor, open secpolicy.inf and add a string to the [Privilege Rights] section that enables Debug Programs privileges to the group of local administrators.

SeDebugPrivilege = *S-1-5-32-544

set SeDebugPrivilege for local adminis group

Note. The SID of the group of local administrators, S-1-5-32-544, may be changed to any other SID. To transform a group or user name into SID, see How to Convert SID to UserName and Vice Versa.

Save the file. Now apply the new user rights:

secedit /configure /db secedit.sdb /cfg secpolicy.inf /overwrite /areas USER_RIGHTS

Note. You have to confirm the overwriting of the current settings.

secedit overwrite USER_RIGHTS

Log off and log on again and using secpol.msc make sure that the Debug Program privileges are assigned to the group of local administrators. The same is shown in the results of whoami /priv command:

SeDebugPrivilege                Debug programs                            Enabled

Obtaining SeDebugPrivilege

Now you can run the installation or update your SQL Server. But bear in mind that SeDebugPrivilege is assigned temporarily and it will be reset at the next GPO update cycle (after the user has logged off).

You should understand that if you enable Debug programs policy it will not completely protect you from getting SeDebugPrivilege by malicious software that has already penetrated to your server with the local administrator rights, and it may compromise all user/administrator accounts working on the server.

7 comments
10
Facebook Twitter Google + Pinterest
previous post
How to Clear Event Viewer Logs on Windows
next post
Creating an MSDaRT Recovery Drive for Windows 10/11

Related Reading

Remote Desktop fix: The number of connections to...

February 7, 2025

How to Hide or Show the ‘Safely Remove...

August 13, 2024

Change Network Connection (Adapter) Priorities in Windows

August 5, 2024

Fix: Multiple Connections to a Server or Shared...

July 16, 2024

Configure File and Folder Access Auditing on Windows...

June 27, 2024

7 comments

Jack June 28, 2019 - 11:29 pm

Went through it all. Twice. SeDbugPrivilege is still disabled (but at least it’s THERE – it wasn’t before). Now what?

Reply
SM July 1, 2019 - 6:11 pm

Great article! Thank you for this article. I spent more than a week looking for a fix for this issue and finally came across your article.

Reply
sa September 18, 2019 - 5:50 pm

save my work, thaks a lot.

Reply
Akshay Pujari March 7, 2020 - 6:28 am

Save my time and work. I have been working on this issue from 3 days. Thank you.!

Reply
Nathan May 29, 2020 - 4:27 pm

Thank You!

Reply
jon October 4, 2021 - 3:42 pm

Thank you, this guide helped me to resolve my issue! I had the same issue but with seSecurityPrivilege.

Reply
Ekta December 9, 2021 - 7:05 am

Tried so many other solutions and none of them worked but this Worked like a charm! and I was able to proceed with the installation

Reply

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMware
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025
  • Load Drivers from WinPE or Recovery CMD

    March 26, 2025
  • How to Block Common (Weak) Passwords in Active Directory

    March 25, 2025
  • Fix: The referenced assembly could not be found error (0x80073701) on Windows

    March 17, 2025
  • Exclude a Specific User or Computer from Group Policy

    March 12, 2025
  • AD Domain Join: Computer Account Re-use Blocked

    March 11, 2025
  • How to Write Logs to the Windows Event Viewer from PowerShell/CMD

    March 3, 2025
  • How to Hide (Block) a Specific Windows Update

    February 25, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
    Footer Logo

    @2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


    Back To Top