Skip to content

Instantly share code, notes, and snippets.

@obscuresec
Last active August 29, 2015 14:19
Show Gist options
  • Save obscuresec/89d12076d51295994e51 to your computer and use it in GitHub Desktop.
Save obscuresec/89d12076d51295994e51 to your computer and use it in GitHub Desktop.
MS15-034 Test
function Test-MS15034($url) {
try {
$wr = [Net.WebRequest]::Create($url)
$wr.AddRange('bytes',234234,28768768)
$res = $wr.GetResponse()
$status = $res.statuscode
Write-Output "$status means it is not vulnerable"
$res.Close()
}catch {
if ($Error[0].Exception.InnerException.Response.StatusCode -eq '416') {Write-Output "Site is vulnerable"}
}
}
@Zagrophyte
Copy link

The WebClient/WebRequest object doesn't let you set the full Range required to reliably detect the vulnerability. I wrote one that uses TcpClient instead. This also shows whether a system has been patched, or is indeterminate.

I humbly submit:
https://gist.github.com/Zagrophyte/ea086087e6fd7ca579ef (Powershell)
https://gist.github.com/Zagrophyte/0fa7a8e2e507fac2b59d (C#)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment