当前位置: 首页 > news >正文

建站源码下载东莞软文推广

建站源码下载,东莞软文推广,重庆可做网站 APP,电子商务的网站怎么做文章目录 Windows安全中心(病毒和威胁防护)的注册1. 简介2. WSC注册初探3. WSC注册原理分析4. 关于AMPPL5. 参考 Windows安全中心(病毒和威胁防护)的注册 本文我们来分析一下Windows安全中心(Windows Security Center…

文章目录

  • Windows安全中心(病毒和威胁防护)的注册
    • 1. 简介
    • 2. WSC注册初探
    • 3. WSC注册原理分析
    • 4. 关于AMPPL
    • 5. 参考

Windows安全中心(病毒和威胁防护)的注册

本文我们来分析一下Windows安全中心(Windows Security Center简称WSC)的注册原理,以及其中的一些比较有意思的技术性问题。

1. 简介

通常情况下,如果我们安装了一些第三方的安全软件之后,就会接管Windows的安全服务(Windows Defender);这里主要的原因大概是防止系统安全软件太多,导致Windows性能下降。可以看到如下:
在这里插入图片描述

以火绒为例,可以看到当系统安装了火绒安全软件之后,在Windows 安全中心的病毒和威胁防护就可以看到注册的安全软件信息了。

当系统注册了第三方安全软件之后,Windows Defender防病毒服务就停止了;这是Windows为第三方安全软件提供的一个入口,但是目前市面上很大安全软件还比不上Windows自带的Defender,也是比较讽刺。

那么怎么样才能将自己的安全软件注册到Windows安全中心呢?大致的步骤如下:

  1. 成为MVI会员。
  2. 微软提供一个内部的私有接口。
  3. 提供相关签名证书。

通过上面流程,我们就可以开发自己的安全软件,并且将自己的安全软件注册到WSC种。那么有没有办法可以绕过上面这些呢?这就是本文需要分析的技术性知识点。

2. WSC注册初探

WSC如果被注册成功之后,可以通过命令get-wmiObject -namespace root\SecurityCenter2 -class AntiVirusProduct来查询相关信息,结果如下:

> get-wmiObject  -namespace root\SecurityCenter2 -class AntiVirusProduct__GENUS                  : 2
__CLASS                  : AntiVirusProduct
__SUPERCLASS             :
__DYNASTY                : AntiVirusProduct
__RELPATH                : AntiVirusProduct.instanceGuid="{D68DDC3A-831F-4fae-9E44-DA132C1ACF46}"
__PROPERTY_COUNT         : 6
__DERIVATION             : {}
__SERVER                 : DESKTOP-1SIKOAK
__NAMESPACE              : ROOT\SecurityCenter2
__PATH                   : \\DESKTOP-1SIKOAK\ROOT\SecurityCenter2:AntiVirusProduct.instanceGuid="{D68DDC3A-831F-4fae-9E44-DA132C1ACF46}"
displayName              : Windows Defender
instanceGuid             : {D68DDC3A-831F-4fae-9E44-DA132C1ACF46}
pathToSignedProductExe   : windowsdefender://
pathToSignedReportingExe : %ProgramFiles%\Windows Defender\MsMpeng.exe
productState             : 393472
timestamp                : Tue, 17 Dec 2024 02:37:41 GMT
PSComputerName           : DESKTOP-1SIKOAK__GENUS                  : 2
__CLASS                  : AntiVirusProduct
__SUPERCLASS             :
__DYNASTY                : AntiVirusProduct
__RELPATH                : AntiVirusProduct.instanceGuid="{4C17E7AE-043A-D732-91B8-D139C9EB6B26}"
__PROPERTY_COUNT         : 6
__DERIVATION             : {}
__SERVER                 : DESKTOP-1SIKOAK
__NAMESPACE              : ROOT\SecurityCenter2
__PATH                   : \\DESKTOP-1SIKOAK\ROOT\SecurityCenter2:AntiVirusProduct.instanceGuid="{4C17E7AE-043A-D732-91B8-D139C9EB6B26}"
displayName              : 火绒安全软件
instanceGuid             : {4C17E7AE-043A-D732-91B8-D139C9EB6B26}
pathToSignedProductExe   : C:\Program Files\Huorong\Sysdiag\bin\wsctrlsvc.exe
pathToSignedReportingExe : C:\Program Files\Huorong\Sysdiag\bin\wsctrlsvc.exe
productState             : 266240
timestamp                : Tue, 17 Dec 2024 02:37:36 GMT
PSComputerName           : DESKTOP-1SIKOAK

在这里可以看到有两个类信息:

  1. Windows Defender表示默认的Windows Defender。
  2. 火绒安全软件表示火绒。

这里可以看到一个非常重要的信息,WSC注册的进程为C:\Program Files\Huorong\Sysdiag\bin\wsctrlsvc.exe

那么我们就可以请出IDA和调试神器WINDBG来分析和调试一下WSC注册的原理。

3. WSC注册原理分析

由于我们需要成为MVI会员之后,才能有相关私有SDK文档,这里我们就分析一下wsctrlsvc.exe这个程序,大致看一下私有SDK是怎么使用的。

我们可以看到WSC相关的主要文件有如下几个:

  1. wscisvif.dll这个是WSC客户端的接口提供DLL。
  2. wscapi.dll这个是WSC客户端的核心DLL。
  3. wscsvc.dll这个是WSC的核心服务DLL。

可以看到私有SDK就是对wscisvif.dll未公开的SDK的调用,我们可以对这些使用接口进行分析,可以看到核心接口如下:

virtual long _IWscAVStatus4<class CWscIsv>::Register(unsigned short *, unsigned short *, int, int)
virtual long _IWscAVStatus4<class CWscIsv>::Unregister(void)
virtual long _IWscAVStatus4<class CWscIsv>::UpdateStatus(enum  _WSC_SECURITY_PRODUCT_STATE, int)
virtual long _IWscAVStatus4<class CWscIsv>::InitiateOfflineCleaning(unsigned short *, unsigned short *)
virtual long _IWscAVStatus4<class CWscIsv>::NotifyUserForNearExpiration(unsigned long)

可以发现核心接口就是如下三个:

  1. Register注册WSC产品。
  2. Unregister反注册WSC产品。
  3. UpdateStatus更新产品的状态。

根据这些分析我们就可以自己向Windows安全中心注册自己的安全软件了,例如可以如下(这里注册了一个我的安全软件产品):
在这里插入图片描述

4. 关于AMPPL

通过上面的分析,我们成功向Windows安全中心注册了自己的安全软件,但是在某些情况下可能会失败,并且Register返回的结果为0x800704dc;这就是AMPPL安全检测导致的结果。

我们分析s_wscRegisterSecurityProduct函数,可以导致得到如下的判断:

if ( type == SECURITY_PRODUCT_TYPE_ANTIVIRUS )
{ValidateCallerAMPPL((int *)&v34, a1, L"s_wscRegisterSecurityProduct", a3, a4);v12 = (unsigned int)v34;if ( (_DWORD)v34 )goto Exit1;
} 

ValidateCallerAMPPL这个函数就是检测AMPPL的,大致检测的结果如下:

v12 = NtQueryInformationProcess(v9,  61, &v15, 1);
if ( (unsigned __int8)((v15.Level & 7) - 1) > IsAm1PPL || (v15.Level & 0xF0) != 0x30 )IsAmPPL = 0;

也就是说我们需要检测进程AMPPL的标记,通过NtQueryInformationProcess查询ProcessProtectionInformation,改查询得到的结构体信息如下:

typedef enum _PS_PROTECTED_SIGNER
{PsProtectedSignerNone = 0,PsProtectedSignerAuthenticode = 1,PsProtectedSignerCodeGen = 2,PsProtectedSignerAntimalware = 3,PsProtectedSignerLsa = 4,PsProtectedSignerWindows = 5,PsProtectedSignerWinTcb = 6,PsProtectedSignerMax = 7
} PS_PROTECTED_SIGNER;typedef enum _PS_PROTECTED_TYPE
{PsProtectedTypeNone = 0,PsProtectedTypeProtectedLight = 1,PsProtectedTypeProtected = 2,PsProtectedTypeMax = 3
} PS_PROTECTED_TYPE;typedef union _PS_PROTECTION
{UCHAR Level;struct{int Type : 3;int Audit : 1;int Signer : 4;} Flags;
} PS_PROTECTION, *PPS_PROTECTION;

这些结构体字段中Type含义如下:

  • PsProtectedTypeNone (0) - the process is not running as protected.

  • PsProtectedTypeProtectedLight (1) - the process is running as light-protected (PPL).

  • PsProtectedTypeProtected (2) - the process is running as fully-protected.

Signer字段的含义如下:

  • PsProtectedSignerNone (0) - the process has no signature that grants it protection.

  • PsProtectedSignerAuthenticode (1) - the process has an Authenticode signature.

  • PsProtectedSignerCodeGen (2) - the process has a Code Generation signature.

  • PsProtectedSignerAntimalware (3) - the process has an Antimalware signature.

  • PsProtectedSignerLsa (4) - the process has an LSA signature.

  • PsProtectedSignerWindows (5) - the process has a Windows signature.

  • PsProtectedSignerWinTcb (6) - the process has a WinTCB (trusted computer base) signature.

  • PsProtectedSignerWinSystem (7) - the process has a WinSystem signature.

  • PsProtectedSignerApp (8) - the process has a Store Application signature.

在进程启动的时候,内核会更加启动进程是否有签名(或者签名的类型)来设置相关值,流程为:

NtCreateUserProcess --> SeQuerySigningPolicy

这里似乎看起来又比较麻烦了,因为需要防病毒MVI相关证书才行。这里NtQueryInformationProcess查询的是EPROCESS中的字段的值,我们只要想办法修改这些值就可以了,例如我们可以将我们自己的进程EPROCESS修改为如下:

kd> dx -id 0,0,94040040 -r1 (*((ntkrpamp!_PS_PROTECTION *)0x940403a6))
(*((ntkrpamp!_PS_PROTECTION *)0x940403a6))                 [Type: _PS_PROTECTION][+0x000] Level            : 0x31 [Type: unsigned char][+0x000 ( 2: 0)] Type             : 0x1 [Type: unsigned char][+0x000 ( 3: 3)] Audit            : 0x0 [Type: unsigned char][+0x000 ( 7: 4)] Signer           : 0x3 [Type: unsigned char]

这样我们就可以完成ValidateCallerAMPPL这个函数的检测了,WSC也完全正常注册了。

5. 参考

WSC本来就是一个私有的接口文档,参考资料也非常少,下面是网上相关的一些参考文章:

  1. https://bbs.kanxue.com/thread-282498.htm
  2. https://github.com/m417z/ntdoc/blob/main/descriptions/ps_protection.md
  3. https://stackoverflow.com/questions/3698285/how-can-i-tell-the-windows-security-center-that-im-an-antivirus
  4. https://learn.microsoft.com/en-us/defender-xdr/virus-initiative-criteria
http://www.hkea.cn/news/786680/

相关文章:

  • 政务网站建设要求快速排名软件哪个好
  • 自己网站怎么做优化色盲和色弱的区别
  • 苏州建网站公司seo网络推广培训班
  • 福清市建设局网站石家庄学院
  • 找考卷做要去哪个网站中国国家培训网官网查询
  • 软件系统开发的大概步骤优化网站标题名词解释
  • 院校网站建设模板建站平台
  • 淘宝网站内搜索引擎优化怎么做广告推广平台网站有哪些
  • 大片播放网站国外免费推广网站有哪些
  • flash网站cms排名sem优化软件
  • 申请完域名怎么做网站百度链接提交
  • 驻马店市可以做网站的公司百度搜索竞价排名
  • 郑州市做网站吉林百度查关键词排名
  • 济宁网站建设seo抖音seo源码搭建
  • 茂名网站建设方案书简述seo和sem的区别
  • 江西网站做的好的企业文化百度指数在哪里看
  • 山东电商网站建设seo网站排名优化公司
  • 赤峰市做网站公司今日的最新消息
  • 上海最大的贸易公司seo网络推广机构
  • jsp 网站开发广告发布平台
  • b2c网站综合对比评价站长统计幸福宝
  • 网站建设意见做推广app赚钱的项目
  • 哈尔滨营销网站制作做外贸推广
  • 深圳网站建设外贸公司排名搜索热词排名
  • 网络科技公司招聘可靠吗seo多久可以学会
  • 企业网站建设的方案ppt网络营销的特点主要包括什么
  • 如何自行建设网站推广关键词优化
  • 建设学院网站百度收录关键词查询
  • 有关外贸的网站有哪些内容武汉抖音seo搜索
  • 娄底网站建设的话术深圳网站关键词排名优化