Example #1
0
        public static void FindVulns()
        {
            System.Console.WriteLine(Beaprint.YELLOW + "  [?] " + Beaprint.LBLUE + "Windows vulns search powered by " + Beaprint.LRED + "Watson" + Beaprint.LBLUE + "(https://github.com/rasta-mouse/Watson)" + Beaprint.NOCOLOR);

            // Supported versions
            List <string> supportedVersions = new List <string>()
            {
                "10240", //1507
                "10586", //1511
                "14393", //1607 & 2K16
                "15063", //1703
                "16299", //1709
                "17134", //1803
                "17763", //1809 & 2K19
                "18362", //1903
                "18363", //1909
            };

            // Get OS Build number
            string buildNumber = Wmi.GetBuildNumber();

            if (!string.IsNullOrEmpty(buildNumber))
            {
                System.Console.WriteLine(String.Format("    {0}: {1}", "OS Build Number", buildNumber));
            }
            else
            {
                return;
            }

            if (!supportedVersions.Contains(buildNumber))
            {
                Beaprint.GoodPrint("   Windows version not supported\r\n");
                return;
            }

            // List of KBs installed
            //Console.WriteLine(" [*] Enumerating installed KBs...\r\n");
            List <string> installedKBs = Wmi.GetInstalledKBs();

            /*#if DEBUG
             *          foreach (string kb in installedKBs)
             *              Console.WriteLine(" {0}", kb);
             *          Console.WriteLine();
             #endif*/

            // List of Vulnerabilities
            VulnerabilityCollection vulnerabiltiies = new VulnerabilityCollection();

            // Check each one
            CVE_2019_0836.Check(vulnerabiltiies, buildNumber, installedKBs);
            CVE_2019_0841.Check(vulnerabiltiies, buildNumber, installedKBs);
            CVE_2019_1064.Check(vulnerabiltiies, buildNumber, installedKBs);
            CVE_2019_1130.Check(vulnerabiltiies, buildNumber, installedKBs);
            CVE_2019_1253.Check(vulnerabiltiies, buildNumber, installedKBs);
            CVE_2019_1315.Check(vulnerabiltiies, buildNumber, installedKBs);
            CVE_2019_1385.Check(vulnerabiltiies, buildNumber, installedKBs);
            CVE_2019_1388.Check(vulnerabiltiies, buildNumber, installedKBs);
            CVE_2019_1405.Check(vulnerabiltiies, buildNumber, installedKBs);

            // Print the results
            vulnerabiltiies.ShowResults();
        }
        public static void FindVulns()
        {
            if (Program.using_ansi)
            {
                System.Console.WriteLine(Beaprint.YELLOW + "  [?] " + Beaprint.LBLUE + "Windows vulns search powered by" + Beaprint.LRED + "Watson" + Beaprint.LBLUE + "(https://github.com/rasta-mouse/Watson)" + Beaprint.NOCOLOR);
            }
            else
            {
                string      iniPrint = "  {0} Windows vulns search powered by {1} (https://github.com/rasta-mouse/Watson)";
                Formatter[] colors   = new Formatter[]
                {
                    new Formatter("[?]", Color.Yellow),
                    new Formatter("Watson", Color.OrangeRed),
                };
                Colorful.Console.WriteLineFormatted(iniPrint, Color.MediumPurple, colors);
            }

            List <string> supportedVersions = new List <string>()
            {
                "10240", //1507
                "10586", //1511
                "14393", //1607 & 2K16
                "15063", //1703
                "16299", //1709
                "17134", //1803
                "17763", //1809 & 2K19
                "18362"  //1903
                //"18363", //1909
            };

            // Get OS Build number
            string buildNumber = Wmi.GetBuildNumber();

            if (!string.IsNullOrEmpty(buildNumber))
            {
                string      iniPrint = "    {0}: {1}";
                Formatter[] colors   = new Formatter[]
                {
                    new Formatter("OS Build Number", Beaprint.color_key),
                    new Formatter(buildNumber, Beaprint.color_default),
                };
                Colorful.Console.WriteLineFormatted(iniPrint, Beaprint.color_key, colors);
            }
            else
            {
                return;
            }

            if (!supportedVersions.Contains(buildNumber))
            {
                Colorful.Console.WriteLine("   Windows version not supported\r\n", Beaprint.color_good);
                return;
            }

            // List of KBs installed
            List <string> installedKBs = Wmi.GetInstalledKBs();

            // List of Vulnerabilities
            VulnerabilityCollection vulnerabiltiies = new VulnerabilityCollection();

            // Check each one
            CVE_2019_0836.Check(vulnerabiltiies, buildNumber, installedKBs);
            CVE_2019_0841.Check(vulnerabiltiies, buildNumber, installedKBs);
            CVE_2019_1064.Check(vulnerabiltiies, buildNumber, installedKBs);
            CVE_2019_1130.Check(vulnerabiltiies, buildNumber, installedKBs);
            CVE_2019_1253.Check(vulnerabiltiies, buildNumber, installedKBs);
            CVE_2019_1315.Check(vulnerabiltiies, buildNumber, installedKBs);

            // Print the results
            vulnerabiltiies.ShowResults();
        }