Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8900093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:01:19+00:00 2026-06-15T01:01:19+00:00

I have a program based on WPF in C#, and I want to remove

  • 0

I have a program based on WPF in C#, and I want to remove the user’s privileges for debugging the application (SeDebugPrivilege) (in Release mode at least). What’s the best way to go about this ? I’ve found a couple of ways of doing it in code that requires unsafe calls to unmanaged code. I’d prefer to do this either purely in C# or, even better, via an application manifest or some other means that prevents the user from having the SeDebugPrivilege at all during the execution of my application. Is there anyway of declaring a Windows group and revoking the privilege for the whole group ? The motivation for this is part of a push to better secure my application by following the principles of least privilege. There are other privileges I’m sure I’d like to remove at some point later, but I’d like to worry about one thing at a time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T01:01:20+00:00Added an answer on June 15, 2026 at 1:01 am

    I think you may be misunderstanding the effects of privileges such as SeDebugPrivilege. Whilst you can certainly remove the privilege from process token using AdjustTokenPrivileges, this does not prevent the application from being debugged, it instead prevents the application itself from performing certain debugging actions. This could however be used to reduce the impact of possible vulnerabilities in your application by preventing it from affecting other processes via means that require the privilege.

    Note that by default, a user can debug an application they have started themselves even without SeDebugPrivilege, so even if run as a non-administrative user (which by default will not have the privilege at all) this will not prevent the application from being debugged.

    There are of course many examples of applications that attempt to detect whether a debugger is attached and they do so with varying levels of success. At best you will be able to make it harder to debug the application but you won’t be able to prevent it entirely if you are running on the user’s machine.

    You could perhaps periodically check System.Diagnostics.Debugger.IsAttached, and take some action if the value is true, but it would be relatively straightforward to overcome for someone determined to debug the application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I develop a Python-based drawing program, Whyteboard . I have tools that the user
i have a command line based program that i want to write a gui
I have a codefirst EF-4.1 based program. The user gets a context and can
I have created a simple WPF test program, based on what Visual Studio gives
I have a program which places structures in a linked list based on the
I have a text file exported from a Foxpro (Dos-based) program, but this text
I have program that runs fast enough. I want to see the number of
I have Perl program based on IO::Async , and it sometimes just exits after
I have a client program based on LibCurl. I have run into a situation
I have a Visual Studio C++ based program that uses pre-compiled headers ( stdafx.h

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.