Hice la
vacuna ahora porque luego a la tarde no voy a poder.
El código no esta comentado y tiene muy poco manejo de errores, lo hice de esa manera para terminarlo mas rápido. Igualmente no debería ser muy difícil de entender pero si quieren que lo comente lo hago luego.
A grandes rasgos cierra el proceso del malware, elimina algunas entradas del registro, y renombra y mueve el ejecutable malicioso al mismo directorio donde se ejecute la vacuna (renombrado a txt, para el que no quiera perder la muestra).
No le he prestado demasiado tiempo al análisis porque esta a la vista que el malware es muy simple. Tal vez por esa razón me hayan quedado algunas entradas del registro en el tintero, pero en ese caso si alguien ve mas, agréguelas al código. Igualmente con esto el malware no seguirá funcionando.
Vaccine.h#ifndef VACCINE_H
#define VACCINE_H
#include <iostream>
#include <cstdlib>
#include <windows.h>
#include <Tlhelp32.h>
class Vaccine
{
public:
INT KillProcess(const char* ProcessName);
LONG DeleteReg (HKEY Hkey, const char* SubKey, const char* KeyValue);
INT FileDelete (const char* Path);
};
#endif // VACCINE_H
Vaccine.cpp#include "Vaccine.h"
INT Vaccine::KillProcess(const char* ProcessName)
{
PROCESSENTRY32 P32 = {0};
P32.dwSize = sizeof( PROCESSENTRY32 );
HANDLE Handle = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
DWORD ExitCode = 0;
if(Process32First(Handle,&P32))
while(strcmp(P32.szExeFile,ProcessName)!= 0 && Process32Next(Handle,&P32));
HANDLE Hprocess = OpenProcess(PROCESS_ALL_ACCESS,0,P32.th32ProcessID);
if(Handle)
{
GetExitCodeProcess(Hprocess,&ExitCode);
TerminateProcess(Hprocess,ExitCode);
return EXIT_SUCCESS;
}
return EXIT_FAILURE;
}
LONG Vaccine::DeleteReg (HKEY Hkey, const char* SubKey, const char* KeyValue)
{
HKEY HkeyHandle;
long RegReturn = 0;
if(!RegOpenKeyEx(Hkey, SubKey, 0, KEY_ALL_ACCESS, &HkeyHandle))
{
RegReturn = RegDeleteValue(HkeyHandle, KeyValue);
RegCloseKey(HkeyHandle);
return RegReturn;
}
return RegReturn;
}
INT Vaccine::FileDelete(const char* Path)
{
SetFileAttributes(Path, FILE_ATTRIBUTE_NORMAL);
MoveFileEx(Path,"NewCopyMalware.txt",MOVEFILE_WRITE_THROUGH);
return EXIT_SUCCESS;
}
main.cpp#include "Vaccine.h"
int main()
{
Vaccine Vac;
Vac.KillProcess("nvsvc32.exe");
Vac.DeleteReg(HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Terminal Server\\Install\\Software\\Microsoft\\Windows\\CurrentVersion\\Run",
"NVIDIA driver monitor");
Vac.DeleteReg(HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",
"NVIDIA driver monitor");
Vac.DeleteReg(HKEY_CURRENT_USER,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",
"NVIDIA driver monitor");
Vac.FileDelete("C:\\WINDOWS\\nvsvc32.exe");
system("sc config wuauserv start= auto");
system("net start wuauserv");
system("net start MsMpSvc");
std::cin.get();
return EXIT_SUCCESS;
}
Posiblemente algún antivirus detecte la vacuna como una aplicación riesgosa por las llamadas a system y demás, pero en fin, ahi esta el codigo para el que quiera compilarla.
Ejecutable de la vacuna:
http://www.megaupload.com/?d=X8D580N2MD5 : 695830eace00c253e11aae440abbae24
SHA1 : 86eb76dd3f1776b50e8442f62879eba8b63d1bb8
SHA256: 0c092a4c2e9edf20f8e3fdc6d08937a8ae7c8a150902dcbc8b28005f4125d97d
Los que la ejecuten recuerden hacerlo como administrador.
Saludos.