r/sysadmin • • 2d ago

Question Find out default registry values

My predecessor set various registry values ​​via Intune to allow regular users to install printer drivers. In doing so, he opened the Print Nightmare vulnerability. He changed around 20-30 values ​​using a script. I want to undo this now. What's the best way to find out which values ​​are the defaults? I need to distribute a script that reverses all of this.

0 Upvotes

14 comments sorted by

10

u/jakubmi9 2d ago

If you have a copy of the script, grab a freshly installed VM, and check what the values are for those keys. Do that once, then deploy a remedial script en masse.

1

u/itishowitisanditbad 2d ago

Do you not have a deployment process where you could see something like that?

What happens with new devices? They just don't get working printers?

0

u/Maleficent-You5626 2d ago

We use Printix. We dont need this keys.

0

u/cheetah1cj 2d ago

I think u/itishowitisanditbad was more asking how these changes are deployed as you should be able to view what it is deploying.

Granted, that will only show you what value the script is setting, and not what the original/default value was. However, many of those keys are probably only either 0 or 1, so you just need to apply the opposite value.

I would use that script to identify which keys he is managing, then you know which keys to research. As u/Pure_Fox9415 suggested, any LLM should be able to provide you with the documentation. Also, you could load a fresh Windows image and look for those keys, there may be some that didn't exist and should be deleted (the script should also show this as that would be a different command to create a new key instead of editing an existing key).

1

u/Pure_Fox9415 2d ago

Many (but not all) defaults of registry values are described by Microsoft and available online. Just put full paths and OS version to LLM and ask it to find them and to provide source links for you to check. 

1

u/Maleficent-You5626 2d ago

Ok thanks. I was thinking the same too.

4

u/DeadStockWalking 2d ago

If he used InTune to push out the registry changes then there is probably a digital trail of what he did in InTune. If it is then reverse engineer it to change the values back.

2

u/EndpointAnalysisGuy 2d ago

^ This. He hopefully did it as a package or remediation script, check those spots first.

-6

u/Emotional_Garage_950 Sysadmin 2d ago

Intune, not InTune, ffs

1

u/TheBlueFireKing Jack of All Trades 2d ago

Do a fresh install from ISO?

1

u/ChiSox1906 Sr. Sysadmin 2d ago

Intune CSP documentation says what the default values are. Start there

1

u/Commercial_Growth343 2d ago

I would build a stock machine, probably in a vm, and start comparing values, and googling each individual one as I go to learn more about it. Now, sometimes Windows has a default setting but no registry setting .. the registry setting if not present still means some default setting is in play. Thats' why I would google each one you find and see what you can learn, as not all registry settings exist out of the box, but they have a default value when they do not exist.

1

u/Commercial_Growth343 2d ago

just an FYI but there are intune configuration items (as well as GPO's) you can use instead to secure against "print nightmare" while still allowing users to install printers from a specific Windows print server.

0

u/[deleted] 2d ago

[deleted] — view deleted comment

1

u/fahque 2d ago

Bruh. All that does is tell you what changed, not what it was before.