Closed exploide closed 1 year ago
Yes, I'm well aware of this issue. Even the Win32 API does not return the correct information.
However, the official answer from Microsoft seems to be that Windows 10 and 11 can be told apart thanks to the build version. If the build version is greater than 22000, it is Windows 11.
I'll make the appropriate adjustments and keep you posted.
BTW, thank you for being such an active member. Your issue reports are well appreciated. 🙂
Fixed with commit e1567e62d4dbc0ad388edcf49daf9532d7158e6c.
I added a test case for the build number.
On Windows 10:
PS C:\Temp> Invoke-SystemInfoCheck
Name Version
---- -------
Windows 10 Pro 10.0.19045 Version 2009 (19045.2486)
On Windows 11:
PS C:\Temp> Invoke-SystemInfoCheck
Name Version
---- -------
Windows 11 Pro 10.0.22621 Version 2009 (22621.1105)
Nice. Tested it, works. Thank you!
Recently I ran PrivescCheck on the Windows 11 client of a customer but
Invoke-SystemInfoCheck
andGet-WindowsVersion
detected the OS as Windows 10. I thought this might be because the system has been upgraded from 10 to 11 and maybe something wasn't clean afterwards.But now I installed a fresh Windows 11 Pro myself (no upgrade) and the issue is reproducible:
Which is no surprise, given that Microsoft apparently messed it up in the registry. See
ProductName
Value below. (Again, this is a fresh install from today!)The only commands I found that show the correct OS are
Get-WMIObject
andsysteminfo
(the latter in German):