Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last Build Installed #23

Open
miguelfaldutti87 opened this issue Mar 11, 2019 · 3 comments
Open

Last Build Installed #23

miguelfaldutti87 opened this issue Mar 11, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@miguelfaldutti87
Copy link

Hi!
For I can say, it seems that if you have the last build you have all the previous accumulative patchs. But, when you do a systeminfo, you only get the generic build number (17134 in my case).
What I found is that this guy found a way to get this data with PowerShell:
https://gist.github.com/SMSAgentSoftware/78659181ccbe0f59677209f3487d7030#file-get-windowsversion-ps1

When you run the script you get the full OS Build: 17134.619. Once you get it, you can compare and automatically skip previous KB.

I hope this could be helpful for you.

@bitsadmin
Copy link
Owner

Nice suggestion!

Maybe besides depending on the systeminfo output, we should develop a (PowerShell) collector script which collects all useful information from the local or a remote system which can then be fed into the wes.py script.

@miguelfaldutti87
Copy link
Author

I was trying to simplify the powershell script. What I can get is the following python code:

    build = subprocess.Popen(["C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\powershell.exe", "(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name CurrentBuild).CurrentBuild"], stdout=subprocess.PIPE);
    ubr = subprocess.Popen(["C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\powershell.exe", "(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name UBR).UBR"], stdout=subprocess.PIPE);
    osbuild = str(build.communicate()[0]) + '.' + str(ubr.communicate()[0])
    osbuild = osbuild.replace('b\'','')
    print(osbuild.replace('\\r\\n\'',''))

So, now you have the full Build into the "osbuild" variable (actually you have it on the print line but.... you understand jaja). Now you have to compare this number with the Windows Catalog I suppouse.
I know that this code is not the most beautiful code in the world so please if you can improve it, please do it!

@dormancygrace
Copy link

there is bug (?) in wes. It shows vulnerabilities for "missing" KB, but for Windows 10 and also Server 2016 cumulative updates supersedes previous ones

@bitsadmin bitsadmin added the enhancement New feature or request label Aug 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants