Skip to content

Instantly share code, notes, and snippets.

@fuglede
Created April 25, 2018 06:45
Show Gist options
  • Save fuglede/b98cd37717e07706c956c53629e245da to your computer and use it in GitHub Desktop.
Save fuglede/b98cd37717e07706c956c53629e245da to your computer and use it in GitHub Desktop.
Test for Total Meltdown vulnerability
// Tests if a Windows 7 or Windows Server 2008 machine is vulnerable
// to the privilege escalation bug "Total Meltdown" described in
// http://blog.frizk.net/2018/03/total-meltdown.html
#include "stdafx.h"
int main() {
unsigned long long *p = (unsigned long long*)0xfffff6fb7dbedf68;
printf("Reading PML4E entry. If this causes a crash, you're safe.\n");
if (*p & 4)
printf("Value at address %p is %llx whose third bit is set. You're vulnerable.\n", p, *p);
else
printf("Value at address %p is %llx whose third bit is not set. You're safe.\n", p, *p);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment