Skip to content
This repository was archived by the owner on Sep 17, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions Watson/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;

using Watson.Msrc;

namespace Watson
Expand All @@ -15,28 +14,27 @@ static void Main(string[] args)
var supportedVersions = new Dictionary<int, string>()
{
{ 10240, "1507" }, { 10586, "1511" }, { 14393, "1607" }, { 15063, "1703" }, { 16299, "1709" },
{ 17134, "1803" }, { 17763, "1809" }, { 18362, "1903" }, { 18363, "1909" }, { 19041, "2004" }
{ 17134, "1803" }, { 17763, "1809" }, { 18362, "1903" }, { 18363, "1909" }, { 19041, "2004" }, { 19042, "20H2" }
};

// Get OS Build number
var buildNumber = Wmi.GetBuildNumber();
if (buildNumber != 0)
{
var version = supportedVersions[buildNumber];
Console.WriteLine(" [*] OS Version: {0} ({1})", version, buildNumber);
}
else
if (buildNumber == 0)
{
Console.Error.WriteLine(" [!] Could not retrieve Windows BuildNumber");
return;
}
}

if (!supportedVersions.ContainsKey(buildNumber))
{
Console.Error.WriteLine(" [!] Windows version not supported");
return;
}


var version = supportedVersions[buildNumber];
Console.WriteLine(" [*] OS Version: {0} ({1})", version, buildNumber);

// List of KBs installed
Console.WriteLine(" [*] Enumerating installed KBs...");
var installedKBs = Wmi.GetInstalledKBs();
Expand Down Expand Up @@ -73,4 +71,4 @@ static void Main(string[] args)
vulnerabiltiies.ShowResults();
}
}
}
}