%3CLINGO-SUB%20id%3D%22lingo-sub-701459%22%20slang%3D%22en-US%22%3ELUA%20Buglight%202.3%2C%20with%20support%20for%20Windows%208.1%20and%20Windows%2010%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-701459%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3E%20First%20published%20on%20MSDN%20on%20Jun%2030%2C%202015%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CP%3ELUA%20Buglight%20is%20a%20utility%20for%20identifying%20admin-permissions%20issues%20(a.k.a.%2C%20%22%20%3CA%20href%3D%22http%3A%2F%2Fblogs.msdn.com%2Fb%2Faaron_margosis%2Farchive%2F2006%2F02%2F06%2F525455.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20LUA%20bugs%20%3C%2FA%3E%20%22)%20in%20desktop%20applications.%20That%20is%2C%20it%20identifies%20the%20specific%20reasons%20that%20a%20particular%20application%20works%20only%20when%20run%20with%20administrative%20rights.%20Version%202.3%20is%20attached%20to%20this%20blog%20post%20and%20adds%20support%20for%20Windows%208.1%2C%20Windows%20Server%202012%20R2%2C%26nbsp%3Band%20Windows%2010.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EIt%20has%20been%20well-established%20for%20many%20years%20that%20for%20security%20and%20reliability%20reasons%2C%20users%20should%20log%20on%20with%20standard%20user%20rights%20and%20that%20their%20applications%20should%20not%20require%20administrative%20rights.%26nbsp%3B%20Windows%20Vista%20began%20the%20movement%20toward%20making%20that%20the%20default%20for%20Windows.%26nbsp%3B%20Although%20Windows%20Vista%20and%20Windows%207%20include%20technologies%20to%20help%20applications%20that%20had%20required%20administrative%20rights%20on%20earlier%20versions%20of%20Windows%20to%20run%20correctly%20with%20standard%20user%20rights%2C%20many%20users%20and%20organizations%20%22solved%22%20their%20application%20compatibility%20issues%20by%20disabling%20User%20Account%20Control%20(UAC)%20and%20continuing%20to%20run%20with%20full%20administrative%20rights.%26nbsp%3B%20Windows%208.x%20and%20Windows%2010%20increasingly%20depend%20on%20features%20that%20are%20absent%20when%20UAC%20is%20disabled%2C%20so%20the%20%22never%20notify%22%20Control%20Panel%20slider%20option%20that%20used%20to%20disable%20UAC%20now%20sets%20the%20%22silent%20elevation%22%20option%20and%20keeps%20UAC%20enabled.%26nbsp%3B%20That%20means%20that%20unless%20apps%20specifically%20request%20elevation%2C%20they'll%20run%20with%20standard%20user%20rights%2C%20and%20continuing%20to%20run%20everything%20with%20full%20administrative%20rights%20will%20become%20more%20difficult%20and%20inconvenient.%26nbsp%3B%20LUA%20Buglight%20can%20help%20you%20identify%20the%20causes%20for%20many%20of%20the%20compatibility%20issues%20and%20point%20to%20solutions.%26nbsp%3B%20(See%20below%20for%20some%20solutions.)%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ETo%20test%20an%20application%2C%20you%20must%20be%20logged%20on%20as%20a%20member%20of%20the%20Administrators%20group%20and%20with%20UAC%20enabled.%20(*)%26nbsp%3B%20Run%20LuaBuglight.exe%20%3CEM%3E%20without%20%3C%2FEM%3E%20elevation.%26nbsp%3B%20Specify%20the%20executable%20to%20test%2C%20any%20command%20line%20parameters%2C%20and%20the%20starting%20directory%2C%20and%20click%20Start.%26nbsp%3B%20LUA%20Buglight%20prompts%20for%20elevation%20and%20then%20starts%20the%20target%20application.%26nbsp%3B%20Run%20the%20program%20and%20test%20all%20functional%20areas%20of%20interest.%26nbsp%3B%20When%20done%20testing%2C%20click%20the%20Stop%20Logging%20button.%26nbsp%3B%20LUA%20Buglight%20will%20display%20a%20tabbed%20report%20showing%20issues%20that%20it%20found.%26nbsp%3B%20(As%20noted%20in%20%3CA%20href%3D%22http%3A%2F%2Fblogs.msdn.com%2Fb%2Faaron_margosis%2Farchive%2F2006%2F02%2F06%2F525455.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20the%20%22LUA%20bugs%22%20link%20%3C%2FA%3E%20above%2C%20just%20because%20an%20%22access%20denied%22%20is%20recorded%20doesn't%20mean%20there's%20a%20bug%20that%20needs%20to%20be%20fixed!)%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ELUA%20Buglight%20works%20by%20instrumenting%20the%20program%20being%20tested%2C%26nbsp%3Bintercepting%20hundreds%20of%20API%20entry%20points.%26nbsp%3B%20LUA%20Buglight%20runs%20the%20target%20program%20with%20standard-user%20rights.%26nbsp%3B%20When%20it%20detects%20an%20API%20failing%20with%20%22access%20denied%22%20or%20%22privilege%20not%20held%22%2C%20it%20impersonates%20the%20user's%20admin%2Felevated%20token%20(obtained%20when%20it%20prompted%20for%20UAC%20elevation)%20and%20repeats%20the%20operation%20before%20returning%20control%20back%20to%20the%20program.%26nbsp%3B%20If%20the%20API%20call%20failed%20with%20standard%20user%20rights%20and%20succeeded%20with%20administrative%20rights%2C%20LUA%20Buglight%20logs%20details%20about%20the%20API%20call%2C%20including%20all%20parameters%20of%20interest%20and%20the%20call%20stack.%26nbsp%3B(**)%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EAdmin%20permissions%20are%20one%26nbsp%3Bcause%20of%20application%20compatibility%20problems.%26nbsp%3B%20The%20prioritized%20list%20of%20preferred%20solutions%20for%20app-compat%20issues%20goes%20along%20these%20lines%3A%3C%2FP%3E%3CBR%20%2F%3E%3COL%3E%3CBR%20%2F%3E%3CLI%3ERetire%20or%20replace%20the%20app%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EGet%20an%20updated%20version%20of%20the%20app%20that%20fixes%20the%20issues%20from%20the%20app%20owner%20(i.e.%2C%20the%20vendor%20or%20your%20developers)%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EModify%20the%20installer%20via%20transforms%20or%20post-install%20scripts%20(for%20%22run-once%22%20issues%20where%20the%20app%20needs%20to%20be%20executed%20with%20admin%20rights%20only%20the%20first%20time%20it%20is%20run).%20Another%20option%20is%20to%20%3CA%20href%3D%22http%3A%2F%2Fblogs.msdn.com%2Fb%2Faaron_margosis%2Farchive%2F2012%2F12%2F10%2Fusing-ntfs-junctions-to-fix-application-compatibility-issues-on-64-bit-editions-of-windows.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20add%20junctions%20or%20directory%20symbolic%20links%20%3C%2FA%3E%20.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3ELet%20UAC%20file%2Fregistry%20virtualization%20do%20its%20magic.%26nbsp%3B%20(For%20older%20apps%20where%20file%2Freg%20virtualization%20would%20work%2C%20but%20were%20rebuilt%20with%20newer%20versions%20of%20Visual%20Studio%2C%20which%20adds%20an%20embedded%20manifest%20that%20declares%20compatibility%20with%20UAC%20and%20turns%20off%20virtualization.)%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EFor%20writes%20to%20.ini%20files%20in%20protected%20directories%2C%20use%20an%20IniFileMapping%20redirection%3B%20for%20writes%20to%20HKCR%2C%20pre-create%20equivalent%20keys%20under%20HKCU%5CSoftware%5CClasses..%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EApply%20application-compatibility%20shims.%26nbsp%3B%20(For%20some%20types%20of%20shims%2C%20this%20can%20be%20moved%20up%26nbsp%3Bahead%20of%26nbsp%3B%234.)%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3E%3CEM%3ESurgically%20%3C%2FEM%3E%20change%20permissions%20on%20files%2C%20directories%2C%20registry%20keys%2C%20or%20other%20objects.%26nbsp%3B%20(Unlike%20the%20previous%20six%20options%2C%20this%20one%20introduces%20risk%20of%20unauthorized%20elevation%20of%20privilege%2C%20so%20caution%20is%20required.)%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FOL%3E%3CBR%20%2F%3E%3CP%3ENote%20that%20automatic-elevation%20products%20are%20not%20on%20this%20list.%26nbsp%3B%20I%20recommend%20against%20their%20use.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CA%20href%3D%22http%3A%2F%2Fblogs.msdn.com%2Fb%2Faaron_margosis%2Farchive%2F2010%2F10%2F02%2Flua-buglight-tips-opening-a-report-file.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EHere's%20some%26nbsp%3Badditional%20tips%20%3C%2FA%3E%20I%20wrote%20a%20few%20years%20ago%20about%20using%20LUA%20Buglight.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E(*)%26nbsp%3B%20LUA%20Buglight%26nbsp%3Bshould%20still%20work%20with%20Windows%20XP%20and%20Windows%20Server%202003%2C%20but%20I%20haven't%20tested%20to%20verify%20that%20recently.%26nbsp%3B%20On%20those%20pre-UAC%20platforms%2C%20run%20LUA%20Buglight%20as%20a%20standard%20user%3B%20you%20will%20be%20prompted%20to%20enter%20the%20credentials%20of%20a%20separate%20administrative%20account.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E(**)%26nbsp%3B%26nbsp%3BLUA%20Buglight%26nbsp%3Bcan%20capture%20symbol%20information%20as%20part%20of%20the%20call%20stack%2C%20but%20it%20doesn't%20support%20use%20of%20symbol%20servers%2C%20so%20symbol%20files%20must%20already%20be%20downloaded%20and%20the%20_NT_SYMBOL_PATH%20variable%20must%20point%20to%20the%20symbol%20directory.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fmsdnshared.blob.core.windows.net%2Fmedia%2FMSDNBlogsFS%2Fprod.evol.blogs.msdn.com%2FCommunityServer.Components.PostAttachments%2F00%2F10%2F62%2F49%2F95%2FLuaBuglight.zip%22%20original-url%3D%22http%3A%2F%2Fblogs.msdn.com%2Fcfs-file.ashx%2F__key%2Fcommunityserver-components-postattachments%2F00-10-62-49-95%2FLuaBuglight.zip%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20LuaBuglight.zip%20%3C%2FA%3E%3C%2FP%3E%0A%20%0A%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-701459%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20MSDN%20on%20Jun%2030%2C%202015%20LUA%20Buglight%20is%20a%20utility%20for%20identifying%20admin-permissions%20issues%20(a.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-701459%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Eaaron%20margosis%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Efixing%20lua%20bugs%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Elua%20buglight%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESecurity%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EUtilities%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1251757%22%20slang%3D%22en-US%22%3ERe%3A%20LUA%20Buglight%202.3%2C%20with%20support%20for%20Windows%208.1%20and%20Windows%2010%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1251757%22%20slang%3D%22en-US%22%3E%3CP%3ELuaBugLight%20is%20a%20fantastic%20tool.%26nbsp%3B%20However%2C%20can%20Server%202016%20and%20above%20be%20added%20%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Former Employee
First published on MSDN on Jun 30, 2015

LUA Buglight is a utility for identifying admin-permissions issues (a.k.a., " LUA bugs ") in desktop applications. That is, it identifies the specific reasons that a particular application works only when run with administrative rights. Version 2.3 is attached to this blog post and adds support for Windows 8.1, Windows Server 2012 R2, and Windows 10.


It has been well-established for many years that for security and reliability reasons, users should log on with standard user rights and that their applications should not require administrative rights.  Windows Vista began the movement toward making that the default for Windows.  Although Windows Vista and Windows 7 include technologies to help applications that had required administrative rights on earlier versions of Windows to run correctly with standard user rights, many users and organizations "solved" their application compatibility issues by disabling User Account Control (UAC) and continuing to run with full administrative rights.  Windows 8.x and Windows 10 increasingly depend on features that are absent when UAC is disabled, so the "never notify" Control Panel slider option that used to disable UAC now sets the "silent elevation" option and keeps UAC enabled.  That means that unless apps specifically request elevation, they'll run with standard user rights, and continuing to run everything with full administrative rights will become more difficult and inconvenient.  LUA Buglight can help you identify the causes for many of the compatibility issues and point to solutions.  (See below for some solutions.)


To test an application, you must be logged on as a member of the Administrators group and with UAC enabled. (*)  Run LuaBuglight.exe without elevation.  Specify the executable to test, any command line parameters, and the starting directory, and click Start.  LUA Buglight prompts for elevation and then starts the target application.  Run the program and test all functional areas of interest.  When done testing, click the Stop Logging button.  LUA Buglight will display a tabbed report showing issues that it found.  (As noted in the "LUA bugs" link above, just because an "access denied" is recorded doesn't mean there's a bug that needs to be fixed!)


LUA Buglight works by instrumenting the program being tested, intercepting hundreds of API entry points.  LUA Buglight runs the target program with standard-user rights.  When it detects an API failing with "access denied" or "privilege not held", it impersonates the user's admin/elevated token (obtained when it prompted for UAC elevation) and repeats the operation before returning control back to the program.  If the API call failed with standard user rights and succeeded with administrative rights, LUA Buglight logs details about the API call, including all parameters of interest and the call stack. (**)


Admin permissions are one cause of application compatibility problems.  The prioritized list of preferred solutions for app-compat issues goes along these lines:



  1. Retire or replace the app

  2. Get an updated version of the app that fixes the issues from the app owner (i.e., the vendor or your developers)

  3. Modify the installer via transforms or post-install scripts (for "run-once" issues where the app needs to be executed with admin rights only the first time it is run). Another option is to add junctions or directory symbolic links .

  4. Let UAC file/registry virtualization do its magic.  (For older apps where file/reg virtualization would work, but were rebuilt with newer versions of Visual Studio, which adds an embedded manifest that declares compatibility with UAC and turns off virtualization.)

  5. For writes to .ini files in protected directories, use an IniFileMapping redirection; for writes to HKCR, pre-create equivalent keys under HKCU\Software\Classes..

  6. Apply application-compatibility shims.  (For some types of shims, this can be moved up ahead of #4.)

  7. Surgically change permissions on files, directories, registry keys, or other objects.  (Unlike the previous six options, this one introduces risk of unauthorized elevation of privilege, so caution is required.)


Note that automatic-elevation products are not on this list.  I recommend against their use.


Here's some additional tips I wrote a few years ago about using LUA Buglight.


(*)  LUA Buglight should still work with Windows XP and Windows Server 2003, but I haven't tested to verify that recently.  On those pre-UAC platforms, run LUA Buglight as a standard user; you will be prompted to enter the credentials of a separate administrative account.


(**)  LUA Buglight can capture symbol information as part of the call stack, but it doesn't support use of symbol servers, so symbol files must already be downloaded and the _NT_SYMBOL_PATH variable must point to the symbol directory.



LuaBuglight.zip

1 Comment
Occasional Visitor

LuaBugLight is a fantastic tool.  However, can Server 2016 and above be added ?