【问题标题】:Why does Administrator rights not allow me to disable UAC programatically?为什么管理员权限不允许我以编程方式禁用 UAC?
【发布时间】:2013-05-07 20:53:11
【问题描述】:

我正在尝试制作一个进行基本检查以使黑客工作的程序。 hack 会注入代码,并且需要确保 UAC 被禁用。在 Windows 8 上我有什么特殊的方法吗?

************** Exception Text **************
System.UnauthorizedAccessException: Cannot write to the registry key.
   at System.ThrowHelper.ThrowUnauthorizedAccessException(ExceptionResource resource)
   at Microsoft.Win32.RegistryKey.EnsureWriteable()
   at Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind valueKind)
   at Microsoft.Win32.RegistryKey.SetValue(String name, Object value)
   at Basic_Checker.Form1.linkLabel5_LinkClicked(Object sender, LinkLabelLinkClickedEventArgs e) in C:\Users\Jennifer\Documents\Visual Studio 2010\Projects\BasicChecker v1.1\BasicChecker\Form1.cs:line 386
   at System.Windows.Forms.LinkLabel.OnLinkClicked(LinkLabelLinkClickedEventArgs e)
   at System.Windows.Forms.LinkLabel.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Label.WndProc(Message& m)
   at System.Windows.Forms.LinkLabel.WndProc(Message& msg)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18033 built by: FX45RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
BasicChecker
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/Jennifer/Documents/Visual%20Studio%202010/Projects/BasicChecker%20v1.1/BasicChecker/bin/Release/BasicChecker.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18037 built by: FX45RTMGDR
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18022 built by: FX45RTMGDR
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18033 built by: FX45RTMGDR
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18033 built by: FX45RTMGDR
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
AxInterop.WMPLib
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/Jennifer/Documents/Visual%20Studio%202010/Projects/BasicChecker%20v1.1/BasicChecker/bin/Release/AxInterop.WMPLib.DLL
----------------------------------------
Interop.WMPLib
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/Jennifer/Documents/Visual%20Studio%202010/Projects/BasicChecker%20v1.1/BasicChecker/bin/Release/Interop.WMPLib.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

这是我的程序给出的错误。我以管理员身份运行它。它适用于 Windows 7,但是 Windows 8,它提供了这个。有没有办法解决这个问题?

【问题讨论】:

  • 如果您需要更多信息,请告诉我
  • 您要写入哪个注册表项?
  • 我不相信除了用户之外的任何人都应该关闭 UAC。手动。
  • 此外,将 EnableLUA 设置为 0 会对 Metro 产生不利影响。请三思而后行。
  • @Synposis 是的,但是您禁用 UAC 会破坏所有其他 Metro 应用程序,用户可能不会很高兴发生这种情况。

标签: c# windows-8 uac


【解决方案1】:

为什么管理员权限不允许我以编程方式禁用 UAC?

因此,如果管理员运行某些代码,他们不必担心在其中某处注入恶意代码会禁用 UAC,然后以提升的用户身份运行代码。

【讨论】:

  • +1 直观的答案。理想情况下,希望看到可靠的文档链接。
  • 程序本身,不会向公众发布。我这样做只是为了我自己,但是,我需要知道为什么提升的进程仍然不允许它修改键值
  • 问问自己,“如果这可能会怎样?”该程序是否仅适用于您自己也没关系。如果您能如此轻松地破坏安全性,那正是恶意软件作者会做的事情。”
猜你喜欢
  • 1970-01-01
  • 2011-01-06
  • 1970-01-01
  • 2010-10-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-01-06
  • 2014-12-02
相关资源
最近更新 更多