Skip to content

Instantly share code, notes, and snippets.

@hasherezade
Created April 4, 2017 14:11
Show Gist options
  • Select an option

  • Save hasherezade/ca96912986d393031b3526528bedf5e1 to your computer and use it in GitHub Desktop.

Select an option

Save hasherezade/ca96912986d393031b3526528bedf5e1 to your computer and use it in GitHub Desktop.
Defensive checks from Moker Trojan
#include <Windows.h>
#include <stdio.h>
bool isVBox()
{
HKEY hKey = NULL;
RegOpenKeyA(HKEY_LOCAL_MACHINE, "HARDWARE\\ACPI\\DSDT\\VBOX__", &hKey);
if (hKey != NULL) {
RegCloseKey(hKey);
return true;
}
return false;
}
bool isTrusterRapportInstalled()
{
HKEY hKey = NULL;
RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Trusteer\\Rapport", &hKey);
if (hKey != NULL) {
RegCloseKey(hKey);
return true;
}
return false;
}
int main()
{
size_t score = 0;
if (isVBox()) {
printf("[+] VM detected by the key: HKLM\\HARDWARE\\ACPI\\DSDT\\VBOX__\n");
score++;
}
if (isTrusterRapportInstalled()) {
printf("[+] Truster Rapport detected by the key: HKCU\\Software\\Trusteer\\Rapport\n");
score++;
}
printf("---\nTotal score: %d\n", score);
if (score == 0) {
printf("Clean!\n");
} else {
printf("Not clean!\n");
}
system("pause");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment