More detail about MS08-067, the out-of-band netapi32.dll security update

Win32 调用netapi32实现用户枚举 netapi32.dll是Windows网络应用程序接口,用于支持访问微软网络。 先看代码; #include <windows.h> #include <assert.h> #include <lm.h> #include "resource.h" //#pragma comment(lib,"Y:\\xxx\\cfreePrj\\userdemo2\\mingw5\\NETAPI32.LIB") LRESULT CALLBACK WindowProcedur 阅读详情
 

Today Microsoft released a security update that fixes a remote code execution vulnerability in the Windows Server Service. This is a serious vulnerability and we have seen targeted attacks using this vulnerability to compromise fully-patched Windows XP and Windows Server 2003 computers so we have released the fix "out of band" (not on the regular Patch Tuesday). Due to the serious nature of the vulnerability and the threat landscape requiring an out-of-band release, you probably have questions about your own organization's risk level, what actions you can take to protect yourself, and why newer platforms are at reduced risk. We hope to answer those questions in this blog post.

Which platforms are at higher risk?

An unauthenticated attacker can trigger this vulnerability remotely for code execution on Windows Server 2000, Windows XP and Windows 2003. By default, Windows Vista and Windows Server 2008 require authentication. However, the attacker must be able to reach the RPC interface to exploit the vulnerability. In the default out-of-the-box scenario, the interface is not reachable due to the firewall enabled by default on Windows XP SP2, Windows Vista, and Windows Server 2008. Unfortunately, either one of the following two conditions exposes the RPC endpoint:

1) Firewall is disabled
2) Firewall is enabled but file/printer sharing is also enabled.

When File/Printer Sharing is enabled on Windows Vista and Windows Server 2008, the firewall only expose the RPC interface to the network type shared. For example, if a printer is shared on a network type ‘Private’, the firewall will block incoming RPC connections if the computer switches over to a network type ‘Public’. If you then choose to share the printer on the network type ‘Public’, Vista and Windows Server 2008 will prompt to ask if you really want to enable “File and Printer Sharing” for ALL public networks.

For more information about file/printer sharing, visit the following URLs:

- for Vista http://technet.microsoft.com/en-us/library/bb727037.aspx
- for XP http://www.microsoft.com/windowsxp/using/security/learnmore/sp2firewall.mspx

The following picture illustrates the risk for each platform in more detail.

More about mitigations (DEP, ASLR, /GS)

On Vista and Windows Server 2008, the combination of Address Space Layout Randomization (ASLR, http://blogs.msdn.com/michael_howard/archive/2006/05/26/address-space-layout-randomization-in-windows-vista.aspx) and Data Execution Protection (DEP, http://support.microsoft.com/kb/875352/EN-US/ ) will make the exploitation of this vulnerability more difficult. ASLR will randomize the base address of modules, heaps, stacks, PEB, TEBs, etc. making difficult the return into known locations. Known DEP bypass techniques will not be applicable on these platforms because of the presence of ASLR.

Regarding /GS protection, the stack frame of the function that contained the overflowed buffer was protected with a stack frame boundary cookie. However, due to the nature of this particular vulnerability, the exploit code is able to take advantage of another stack frame that was not meant to be protected by the /GS security cookie. The /GS security cookie is only emitted for functions meeting certain criteria.

UAC mitigates even when the prompting is disabled

As mentioned above, Windows Vista and Windows Server 2008 by default require authentication. But the security callback on the RPC interface has not been changed on the more recent platforms. Instead, the UAC and integrity level hardening work introduced with Vista is forcing the authentication requirement. The anonymous user connects with integrity level "Untrusted" while the named pipe requires at least a "Low" integrity level. Since "Untrusted" is lower than "Low" integrity level, the access check fails. Note that disabling the UAC prompt does not disable the integrity level access check. In other words, regardless of whether the UAC prompt is enabled or disabled, the integrity level check will be performed. The integrity level check will fail on Vista and Windows Server 2008 if the user connects anonymously. See http://msdn.microsoft.com/en-us/library/bb625963.aspx for more information.

There is a non-default scenario where a non-domain-joined Windows Vista and Windows Server 2008 can be exploited anonymously. If the feature “Password Protected Sharing” is disabled, anonymous connections come in at “Medium” integrity level. Because "Medium" integrity level is a higher integrity level than "Low", the integrity level check will succeed. This would allow Windows Vista and Windows Server 2008 to be exploited anonymously. This feature could be disabled through Vista’s Network Sharing Center in the “Sharing and Discovery” section.

Most perimeter firewalls will block exploit attempts from outside your organization

If you are behind a perimeter firewall that filters inbound connections to TCP ports 139 and 445, you will not be reachable from the Internet. This is a common home user scenario. In this scenario, only the machines in your local LAN will have the ability to exploit this vulnerability.

How you can protect yourself

You should apply the security update as soon as you can. This is the best way you can protect yourself. While you are testing the update and preparing your deployment process, you may choose to use one or more of the workarounds listed in the security bulletin. (http://www.microsoft.com/technet/security/Bulletin/MS08-067.mspx) We have researched several options that range from turning off the affected component to limiting the exposure to authenticated users.

There is one other workaround option that we didn't include in the bulletin because it is not a supported scenario. The Server service exposes the vulnerable code over an RPC named pipe. The access control list for the named pipe is specified in the netapi32.dll code. It can be changed for any current Windows session. When Windows is rebooted, the ACL will get reset to the default value. However, if you were to change the ACL on every boot after the service is started, the window of attack for anonymous users would be very small. We have developed a simple tool that can remove the ANONYMOUS access control entry is the named pipe's access control list. (Please remember that this is not a supported scenario.) Here's what it looks like when run:

C:/>chacl.exe //./pipe/srvsvc
opening up //./pipe/srvsvc
Got back 3 ACE entries
Found an entry for ANONYMOUS LOGON. Deleting it...
deleted that ACE

Setting new DACL changes...
Done

C:/>chacl.exe //./pipe/browser
opening up //./pipe/browser
Got back 3 ACE entries
Found an entry for ANONYMOUS LOGON. Deleting it...
deleted that ACE

Setting new DACL changes...
Done

We have attached the chacl.c source code at the bottom of this blog post.

Greetz

A great deal of investigation in a short amount of time went into this case. We'd like to publicly thank all the engineers who helped provide definitive answers (some requiring hours of debugging) to these hard technical questions.

- Bruce Dang, Fermin J. Serna, Damian Hasse, Andrew Roths and Jonathan Ness from the SVRD team
- Matt Miller and other members from the Microsoft Security Engineering Science Team
- David Kruse, Tassaduq Basu, and Jon Schwartz from the core file system, networking, and kernel teams (respectively)
- Carlos Trueba Salinas from the Windows Sustained Engineering team

Posting is provided "AS IS" with no warranties, and confers no rights.

Published Thursday, October 23, 2008 10:00 AM by swiblog
 
 
/*
 * This source code is provided "AS IS" with no warranties, and confers no rights.
 */

#include <windows.h>
#include <aclapi.h>
#include <sddl.h>

#pragma comment(lib, "advapi32")

int __cdecl main(int argc, char *argv[])
{
	HANDLE pipe;
	SE_OBJECT_TYPE ot = SE_KERNEL_OBJECT;
	SECURITY_INFORMATION sinfo = DACL_SECURITY_INFORMATION;
	PACL dacl;
	DWORD res;
	ULONG nent;
	EXPLICIT_ACCESS *ea;
	int i;
	BOOL found = FALSE;

	if (argc != 2) {
		printf("Named pipe DACL changer/nUsage: %s ////.//pipe//<name>/nExample: %s ////.//pipe//srvsvc/n", argv[0], argv[0]);
		exit(-1);
	}

	printf("opening up %s/n", argv[1]);

	pipe = CreateFileA(
			argv[1],
			WRITE_DAC | GENERIC_READ,
			FILE_SHARE_WRITE,
			NULL,
			OPEN_EXISTING,
			0,
			NULL
			);

	if (pipe == INVALID_HANDLE_VALUE) {
		printf("failed %x/n", GetLastError());
		exit(-1);
	}

	res = GetSecurityInfo(
			pipe,
			ot,
			sinfo,
			NULL,
			NULL,
			&dacl,
			NULL,
			NULL
			);

	if (res != ERROR_SUCCESS) {
		printf("getsecurityinfo() failed %x/n", res);
		exit(-1);
	}

	res = GetExplicitEntriesFromAcl(
			dacl,
			&nent,
			&ea);

	if (res != ERROR_SUCCESS) {
		printf("GetExplicitEntriesFromAcl() failed %x/n", res);
		exit(-1);
	}

	printf("Got back %d ACE entries/n", nent);

	for (i=0; i < nent; i++) {
		if (ea[i].Trustee.TrusteeForm == TRUSTEE_IS_SID) {
			if( IsWellKnownSid(ea[i].Trustee.ptstrName, WinAnonymousSid) == TRUE) { // ANONYMOUS LOGON
				printf("Found an entry for ANONYMOUS LOGON. Deleting it.../n");
				found = TRUE;
				if( !DeleteAce(dacl, i)) {
					printf("DeleteAce() failed %x/n", GetLastError());
					LocalFree(ea);
					exit(-1);
				}
				printf("deleted that ACE/n");
				printf("/nSetting new DACL changes.../n");
				res = SetSecurityInfo(
						pipe, // pipe
						ot, // type
						sinfo, // security info
						NULL,
						NULL,
						dacl, // our DACL
						NULL
						);
				printf("%s/n", res == ERROR_SUCCESS ? "Done" : "Failed.. not admin?");
				break;
			}
		}
	}

	if (found == FALSE)
		printf("No anonymous ACEs found .../n");

	CloseHandle(pipe);

    LocalFree(ea);

}
 
wtsapi.h&wtsapi.lib wtsapi.h&wtsapi.lib VC2008提取 立即下载

相关推荐

Advapi32.lib

保护vs2008还有winkit winsdk 32位与64位 error LNK1104: cannot open file 'advapi32.lib'

LM.h 使用时要加入库 Netapi32.lib

#include #pragma comment(lib,"Netapi32.lib")

pan_jiewu的专栏 1451

advapi32.lib

c++安装时刻能缺少的lib文件,缺少时刻能造成连接错误,避免了重新安装c++

Windows提示缺少netapi32.dll文件如何解决?

其实很多用户玩单机游戏或者安装软件的时候就出现过这种问题,如果是新手第一时间会认为是软件或游戏出错了,其实并不是这样,其主要原因就是你电脑系统的该dll文件丢失了或者损坏了,这时你只需下载这个netapi32.dll文件进行安装(前提是找到适合的版本),当我们执行某一个.exe程序时,相应的DLL文件就会被调用,因此安装好之后就能重新打开你的软件或游戏了.那么出现netapi32.dll丢失要怎么解决?

file 2797

PTA编程—币值转换

我对于这个题的主要思想就是把九位数分三块,对每块进行处理后,再合并。有了这个思想就开始写代码,后面就是哪有洞补哪,哪个测试用例没通过就对其特殊处理…。反正最后测试用例全通过了。 #include<iostream> #include <string> #include <algorithm> using namespace std; char a[10]={'a','b','c','d','e','f','g','h','i','j'}; //既然题目说了最多9位

uyo9ko的博客 991

Vivado与Vscode无缝集成:高效Verilog开发环境搭建指南

本文详细介绍了如何将Vivado与Vscode无缝集成,打造高效的Verilog开发环境。通过替换Vivado默认编辑器为Vscode,配置必备插件和语法检查工具,开发者可以大幅提升FPGA项目的编码效率。文章还提供了代码片段、Testbench自动生成等高级技巧,帮助开发者快速上手这一集成方案。

weixin_33737774的博客 493

DCMTK的Lib 引用顺序

我们知道,在引用lib的时候,只需要配置项目属性     1、 Linker-&gt;General里,Additional Library Directories里填写lib所在的文件夹 2、Linker-&gt;Input里,在Additional Dependencies 里依次加上 wsock32.lib;netapi32.lib;ofstd.lib;oflog.lib;dcm...

qimo601的专栏 507

Py6S安装失败?手把手教你解决‘6S executable not found‘错误

本文详细解析了Py6S安装过程中常见的'6S executable not found'错误,提供了从MinGW-w64安装到Fortran编译器配置的完整解决方案。通过优化编译环境和进阶技巧,帮助用户高效完成大气辐射传输建模,提升科学计算效率。

x1y2z的博客 645

软件缺少netapi32.dll文件及错误提示问题

在大部分情况下出现我们运行或安装软件,游戏出现提示丢失某些DLL文件或OCX文件的原因可能是原始安装包文件不完整造成,原因可能是某些系统防护软件将重要的DLL文件识别为可疑,阻止并放入了隔离单里,还有一些常见的DLL文件缺少是因为系统没有安装齐全的微软运行库,还有部分情况是因为系统更新升级补丁造成的系统内部文件损坏。

2401_89440294的博客 1406

基于Simulink的超级电容快速响应特性建模与仿真

本文介绍了基于Simulink的超级电容快速响应特性建模与仿真方法。主要内容包括:超级电容的工作原理、一阶RC等效电路模型及其动态电压方程;通过Simulink搭建超级电容模型的两种方法(Simscape Electrical推荐方案和基础模块透明教学方案);仿真100A×100ms放电脉冲下的电压响应特性,并与锂电池进行动态对比;分析超级电容在混合储能系统中的功率分配优势。文章还提供了工程实践要点和扩展方向,如电压均衡、温度影响评估以及与DC-DC变换器集成等。通过建模实践,验证了超级电容在毫秒级响应、高

xiaoheshang_123的博客 98

整车的智能配电系统

本文探讨了汽车电网安全的重要性,分析了传统汽车电网的现状,并重点介绍了半导体在汽车智能配电系统中的作用。半导体凭借其单向导电性和可控性,如二极管、MOSFET等,提供了更高效、安全的电力控制。通过对比传统保险丝与半导体器件,阐述了半导体在过流保护、电压监测和故障诊断方面的优势,强调其在减少安全隐患、提高能源管理和续航里程方面的贡献。极氪智能配电系统展示了如何运用半导体技术实现整车能源的精细化管理,降低维修成本,减少线束复杂性,提升安全性能。

让你爱上电路设计 1612

关于#pragma comment(lib,"ws2_32.lib")

mysql的触发器中 有个for each row, 可是我不行每行更新都去触发它,而是 只针对某几行修改了我才触发, 比如,只有修改了 type 字段为‘mother’ 的行,我才会触发,应该如何写触发器?   replace into 不支持   pragma   comment(lib,"Ws2_32.lib")表示链接Ws2_32.lib这个库。   和在工程设...

我的笔记本 2182

【2026年华为暑期实习(AI)-4月8日-第一题- 选择题】(题目+思路+Java&C++&Python解析+在线测试)

答案与解析 1. 相关系数问题 答案:C. 完全负线性相关 解析:相关系数ρ=-1表示X和Y之间存在完全负线性相关关系,所有数据点都严格落在一条斜率为负的直线上。 2. 矩阵秩问题 答案:B. Σ的对角线上非零奇异值的个数 解析:矩阵A的秩等于其奇异值矩阵Σ中非零奇异值的个数,因为U和V都是正交矩阵,不改变矩阵的秩。 3. 条件概率问题 答案:B. 0.5 解析:根据全概率公式和贝叶斯公式计算,P(B)=0.5×0.4+0.3×0.6=0.38,P(A|B)=(0.5×0.4)/0.38≈0.526,最接近

m0_73659489的博客 287

取本机IP地址和网卡号

取本机IP地址和网卡号 界面如下,主要是使用Winsock的一些东东取机器名和IP地址,取网卡就麻烦些,需要发送Netbios命令,需要注意的是需要包含winsock2.h和nb30.h,并且要引入两个lib: 包含头和lib如下: #include #include  #pragma comment(lib, "netapi32.lib") #pragma comment(l

wjeson的专栏 3258

UE实现贴地线(SurfaceLine)效果

UnrealEngine实现贴地线效果

专注GIS开发 4572

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

调用Win32 API netapi32.dll 实现UNC(网络共享)连接的管理(一)

 本章将使用Win32 API netapi32.dll 实现UNC的 连接授权, 断开连接, 获取UNC连接状态三项功能.一. 首先导入DLL文件:#region Register Win32 DLL File netapi32.dll//导入连接授权函数NetUseAdd [DllImport("netapi32", CharSet = CharSet.Auto, S

Flyear_cheng的专栏 5730

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

获取远程网卡MAC地址。

首先在头文件定义中加入#include "nb30.h"#pragma comment(lib,"netapi32.lib")typedef struct _ASTAT_{ ADAPTER_STATUS adapt; NAME_BUFFER    NameBuff[30];} ASTAT, * PASTAT;就可以这样调用来获取远程网卡MAC地址了:CString GetMacAddress(

1454

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

循环嵌套(多层 for 循环)

表:order(订单表,order_id, user_id)、user(用户表,user_id, user_name)✅ 优化:先查所有订单,拿到所有 user_id 批量 in 查询,内存 join。✅ 优化:先把优惠券转 HashMap,单层循环查找(hash 查找 O (1))SQL 只有 2 次,O (1) 数据库查询,内存遍历 O (n)。需求:查询所有订单列表,同时带出每个订单对应的用户名称。需求:订单列表、优惠券列表,把订单匹配对应的优惠券名称。复杂度:O (M+N),非常快。

weixin_43732943的博客 195
上一篇: Microsoft Security Bulletin MS08-067 – Critical
下一篇: Trojan exploiting MS08-067 RPC vulnerability
iiprogram
博客等级 码龄25年 1068粉丝 1515原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值