Security Mistakes That Leave You Vulnerable To Compromise #5: Caching Windows Credentials


There are lots of web sites and books devoted to Windows security.  But I’m always surprised at the number of Windows administrators that are not even aware that Windows, by default, caches (stores) the last ten user credentials (names and passwords) used on a PC.

Why is this a problem?   Because, odds are, one of those credentials belongs to the system administrator.  If the administrator has ever logged into that PC, to set it up initially, to install software or to troubleshoot, the administrator’s credentials are likely in the cache.  If (I mean…when) one of your PCs gets compromised, the first thing the attacker does is look in that cache to get the administrator’s credentials.  Once the attacker has that, he has free reign to go anywhere in your network and steal any information.  In short, the administrator’s credentials give the attacker access to everything.   Having the administrator’s credentials in the cache is a little like leaving the front door key under the mat; that’s the first place criminals look.

The idea behind caching credentials is to allow multiple users to log in to a PC when the domain controller is unavailable. In modern enterprise networks, however, this almost never happens, so there’s no need to cache credentials.  You can change the cache setting to 0 so the PC won’t cache any.  Laptops, which might be disconnected from the network, are an exception, but they should be set to only cache one credential (i.e. the last user).

Another credential to be concerned about is the local administrator’s.  This is the account used to initially configure the PC, and is also commonly used for troubleshooting or making hardware changes.  In many large organizations, the same local admin credentials are used on every PC.  Again, if the attacker gets the local administrator’s credentials, he will be able to log into every PC.

To prevent attackers from stealing administrator credentials and having free reign over your network, you should follow these basic account hygiene rules:

  1. Set every PC and server to not cache credentials.  In the Windows registry, go to HKLMSoftwareWindows NTWinlogon.  Set the CachedLogonsCount to 0.  For laptops, set this to 1.
  2. Configure the policy on each PC to prevent to prevent the local administrator from logging on remotely.  It is especially important to do this on servers.  The exact steps are different depending on which version of Windows you’re using (see for details).
  3. As an additional layer of security, use a different local administrator password for user PCs and servers.
  4. Make sure that your administrators have separate accounts for admin duties.  They should use a user-level account for general work, and only use their administrator account for administrative duties.

One response to “Security Mistakes That Leave You Vulnerable To Compromise #5: Caching Windows Credentials

  1. Item number 4 – Internet access should be enabled on user-level account ONLY and never any accounts with admin rights.

Leave a Reply


Nick Kelly

Cybersecurity Engineer, Cisco

Nick has over 20 years of experience in Security Operations and Security Sales. He is an avid student of cybersecurity and regularly engages with the Infosec community at events like BSides, RVASec, Derbycon and more. The son of an FBI forensics director, Nick holds a B.S. in Criminal Justice and is one of Cisco’s Fire Jumper Elite members. When he’s not working, he writes cyberpunk and punches aliens on his Playstation.


Virgilio “BONG” dela Cruz Jr.

CCDP, CCNA V, CCNP, Cisco IPS Express Security for AM/EE
Field Solutions Architect, Tech Data

Virgilio “Bong” has sixteen years of professional experience in IT industry from academe, technical and customer support, pre-sales, post sales, project management, training and enablement. He has worked in Cisco Technical Assistance Center (TAC) as a member of the WAN and LAN Switching team. Bong now works for Tech Data as the Field Solutions Architect with a focus on Cisco Security and holds a few Cisco certifications including Fire Jumper Elite.


John Cavanaugh

CCIE #1066, CCDE #20070002, CCAr
Chief Technology Officer, Practice Lead Security Services, NetCraftsmen

John is our CTO and the practice lead for a talented team of consultants focused on designing and delivering scalable and secure infrastructure solutions to customers across multiple industry verticals and technologies. Previously he has held several positions including Executive Director/Chief Architect for Global Network Services at JPMorgan Chase. In that capacity, he led a team managing network architecture and services.  Prior to his role at JPMorgan Chase, John was a Distinguished Engineer at Cisco working across a number of verticals including Higher Education, Finance, Retail, Government, and Health Care.

He is an expert in working with groups to identify business needs, and align technology strategies to enable business strategies, building in agility and scalability to allow for future changes. John is experienced in the architecture and design of highly available, secure, network infrastructure and data centers, and has worked on projects worldwide. He has worked in both the business and regulatory environments for the design and deployment of complex IT infrastructures.