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

Added checks for Windows Update Server over HTTP #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
30 changes: 30 additions & 0 deletions SharpUp/Checks/WSUSOverHTTP.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using SharpUp.Classes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static SharpUp.Utilities.RegistryUtils;

namespace SharpUp.Checks
{
public class WSUSOverHTTP : VulnerabilityCheck
{
private static string _regPath = "Software\\Policies\\Microsoft\\Windows\\WindowsUpdate";
private static string _regName = "WUServer";
private static string _regPathEnabled = "Software\\Policies\\Microsoft\\Windows\\WindowsUpdate\\AU";
private static string _regNameEnabled = "UseWUServer";

public WSUSOverHTTP()
{
_name = "WSUS updates over HTTP";
string WSUSOverHTTPHKLM = GetRegValue("HKLM", _regPath, _regName);
string WSUSEnabledHKLM = GetRegValue("HKLM", _regPathEnabled, _regNameEnabled);

if (WSUSOverHTTPHKLM.ToLower().StartsWith("http://") & (WSUSEnabledHKLM == "1"))
{
_details.Add($"WUServer: {WSUSOverHTTPHKLM}");
_isVulnerable = true;
}
}
}
}
1 change: 1 addition & 0 deletions SharpUp/SharpUp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
<Compile Include="Checks\TokenPrivileges.cs" />
<Compile Include="Checks\UnattendedInstallFiles.cs" />
<Compile Include="Checks\UnquotedServicePath.cs" />
<Compile Include="Checks\WSUSOverHTTP.cs" />
<Compile Include="Classes\VulnerabilityCheck.cs" />
<Compile Include="Interfaces\IVulnerabilityCheck.cs" />
<Compile Include="Native\Win32.cs" />
Expand Down