Aaron Margosis' "Non-Admin" and App-Compat WebLog

The Non-Admin blog - running with least privilege on the desktop... and then dealing with the application compatibility fallout

PrivBar -- An IE/Explorer toolbar to show current privilege level

PrivBar -- An IE/Explorer toolbar to show current privilege level

[Aug 15 2008:  Click here for updated links and instructions.]

I’ve long wanted a way to know at a glance whether I am logged in as a member of the all-powerful Administrators group, the slightly less-powerful Power Users group, or as an ordinary User. The more I use RunAs (including with Explorer)and MakeMeAdmin, the more I need to be able to distinguish privilege levels of various apps on my desktop. Someday I might try to come up with a robust way to do this for all windows on my desktop. For now, I’ve got PrivBar.

PrivBar is a toolbar for Explorer and Internet Explorer that shows you broadly at what privilege level that particular instance is running. Here are some examples:


PrivBar with IE running as an administrator


PrivBar with IE running as a Power User


PrivBar with IE running as a normal User


PrivBar with IE running with a restricted token

PrivBar shows you roughly what your privilege level is by checking the current process’ token for membership in Administrators, Power Users, Users, or Guests.  The circle on the bar will be red if you are in Administrators, yellow if you are Power User, green otherwise.  If you are an admin, the bar’s background will be yellow.  Finally, if that instance is running with a restricted token (e.g., by using the RunAs dialog’s “protect my computer” option, which I will describe in detail in a future post), the circle will be green with a red line through it. (For the geeks: PrivBar uses the CheckTokenMembership API, so yes, it properly takes into account disabled or deny-only SIDs.)

If you click on the circle or the group name, PrivBar will display a dialog like the one below showing you detailed information about the current token, including its principal (the user account), logon ID, whether you are running with a restricted token, groups, restricted SIDs (if a restricted token), and privileges. The information that appears in the dialog is collected in a background thread so as not to slow down IE/Explorer startup. If it has not collected all the data yet, it will say so. Just close the dialog and click the circle again.

For more information about what this stuff actually means, check out any or all of the following:

System Requirements:

I have tested the current version of PrivBar on Windows XP SP1 and SP2 (RC2), and on Windows Server 2003. I tried installing it one time on Windows 2000 Server but there was some missing dependency that I haven’t bothered to track down yet.

Installation:

My sincerest apologies, but it’s a manual installation:

  1. Download the zip file
  2. Extract PrivBar.dll and put it somewhere where all users have Read access to it.
  3. At a command prompt (or the Run dialog), run
    regsvr32 path\PrivBar.dll
    where path is the folder location to which you extracted PrivBar.dll. You need to be running as an administrator or Power User to do this.
  4. Extract PrivBarReg.reg from the zip file and import it into the registry. The easiest way is to double-click the file in Explorer. Again, you need to be an administrator or Power User to do this.

You can now enable the bar in Explorer or IE by choosing View / Toolbars / PrivBar. Its initial, default location is not very good, but as far as I know there isn’t a way for PrivBar to dictate a better position unless it insists on using up an entire row (which isn’t worth it). You may need to unlock the toolbars so that you can place it somewhere better. If you want PrivBar always to be shown, note that there are three different per-user views that are separately configured: Internet Explorer, Explorer “Open” view, and Explorer “Explore” view. You need to enable and position PrivBar for each of these views, for each user. If anyone knows of a reliable way to automate this, please let me know! (One somewhat helpful tip: try double-clicking multiple times on the “handle” thing on the left edge of a menu or toolbar to see some useful pre-set sizes.)

 

  • Nice thing.
    Do you thing there is a change we could get the source of it?
  • On Server 2003 Pl Std View / Toolbars / PrivBar is not present.
  • Boyd - I think posting the source would be a good thing. I'll try to get it presentable and post it.

    JackoPlacko - make sure that you have copied the DLL into a location in which all users have at least Read access. Make sure to regsvr32 the DLL in that location, and also import the .reg file in the zip file.
  • Aaron.
    All my steps (follow yours) are property executed - but View / Toolbars / PrivBar is not present.
    Just I send for You message with more info about fragments registry.
    Thx.
  • Aaron,

    I'm in the same boat as Jacko...I've installed and registered the DLL in a location where the Users group has Read access, I've added the registry entries, and confirmed that the value was added to the correct key, and I've rebooted to ensure that the settings would be picked up. PrivBar is still not showing up in View > Toolbars. Any suggestions?

  • Jacko & Andrew -- I just built a fresh Server 2003, fully updated, added Office, SQL, RKs, tools, etc. Then regsvr32 privbar.dll and imported the additional reg key file. PrivBar was *not* in the View/Toolbars menu. I closed that Explorer window (the only Explorer window), opened a new Explorer window, and PrivBar *was* there. I enabled it and it works fine. I don't know what the problem might be. Make sure that you are an admin when you register/import.
  • Jacko & Andrew - make sure that this setting is enabled: Tools / Internet Options / Advanced / Enable third-party browser extensions (requires restart). If its checkbox is not checked, check it and close all instances of iexplore.exe.
  • OK I've been doing security 'way too long, but this never ceases to astound me. The Most Dangerous Thing most users can do is run as Administrator, especially while surfing the Net, but I hardly ever hear advice-givers address this issue, especially in vulnerable home users!

    I can generally talk my employer into giving me admin access to my desktop machine, but I never get a threat briefing on why I shouldn't use it as part of my routine login account.

    I sould probably start a blog and rant there instead...
  • Aaron,

    "enable third-party browser extensions" did the trick for me. PrivBar is now working as expected, with one minor exception...I don't get the yellow background when the window is running with Administrator privileges. Still, this is a very useful tool, and I will most certainly be using and recommending this often.

  • Andrew, I've already traded email with you about this, but I wanted to add to this thread that if you have a background bitmap defined for an account (per earlier posts), that it will override the background color for the toolbar.
  • Aaron:

    I just wanted to thank you for taking the time to post these tips and tricks around how to run as LUA and still be able to get work done when applications require Admin privileges.

    It just happens that I also work for MS, but as a User Experience (UX) Program Manager and I will be working on a number of areas around the user experience associated with application security, including the UX for LUA users. As a result I decided that I should run as LUA if for no other reason than to gain first hand knowledge of the current UX and find all those "pain points" for myself. I don't think I could have successfully gone forward without your list of tips and workarounds.

    Thanks again!
  • And every time you create a rooted Explorer window with the /root, command line option (a.k.a., Explore from here), it gets its own, brand-new process.

    In experimenting I find All /root windows go into a third process not seperate processes most of the time.

    EG
    Start My Comp
    Start any number of /root from Start Run
    Max Process is 3

    and + but

    Start a /root from Start Run
    Start a second
    Max Process = 3
    Now start My Comp (from QL)
    Max Process = 3
    Start a /root
    Max Process = 4

    This is screwy. The rules don't seem so simple.
Page 1 of 7 (103 items) 12345»
Leave a Comment
  • Please add 1 and 1 and type the answer here:
  • Post