Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2024-30088 — CVE-2024-30088 的概念验证利用代码,这是一个 Windows 内核中的 TOCTOU 漏洞,位于 AuthzBasepCopyoutInternalSecurityAttributes 中,通过竞态条件实现任意写入以进行权限提升。 | Kitploit
工具/GitHubGitHub/tykawaii98/cve-2024-30088
权限提升漏洞分析漏洞利用二进制利用
GitHubtykawaii98/cve-2024-30088

CVE-2024-30088

CVE-2024-30088 的概念验证利用代码,这是一个 Windows 内核中的 TOCTOU 漏洞,位于 AuthzBasepCopyoutInternalSecurityAttributes 中,通过竞态条件实现任意写入以进行权限提升。

查看仓库
29061462年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2024-30088

漏洞:

  • 漏洞位于函数 AuthzBasepCopyoutInternalSecurityAttributes 中,当内核将当前令牌对象的 _AUTHZBASEP_SECURITY_ATTRIBUTES_INFORMATION 复制到用户模式时,该结构如下:
root@kitploit:~
//0x30字节(sizeof)
struct _AUTHZBASEP_SECURITY_ATTRIBUTES_INFORMATION
{
    ULONG SecurityAttributeCount;                                           //0x0
    struct _LIST_ENTRY SecurityAttributesList;                              //0x8
    ULONG WorkingSecurityAttributeCount;                                    //0x18
    struct _LIST_ENTRY WorkingSecurityAttributesList;                       //0x20
}; 
  • 在复制 SecurityAttributesList 时,内核将 SecurityAttribute 结构体列表直接设置到用户提供的指针中。之后,它调用 RtlCopyUnicodeString 和 AuthzBasepCopyoutInternalSecurityAttributeValues 函数来复制 SecurityAttribute 结构的名称和值,导致此函数中存在多个 TOCTOU 问题。

  • 通过一个简单的竞态线程,在调用 RtlCopyUnicodeString 之前修改属性名称的 Buffer 指针[*],我可以轻松实现一个固定值和可控制大小的任意地址写入。

  • 注意,还有其他利用方式,但在我的案例中,我选择利用 RtlCopyUnicodeString。

触发漏洞:

  • 通过使用 TokenAccesInformation 类调用 NtQueryInformationToken 即可轻松触发此漏洞。

补丁:

  • 补丁使用内核栈上的局部变量(以下代码块中的 v18)作为缓冲区,先复制安全属性的名称,然后再写回到用户缓冲区(如果系统调用来自用户模式)。
root@kitploit:~
    [...]
        p_SecurityAttributesList = &a1->SecurityAttributesList;
        Flink = a1->SecurityAttributesList.Flink;
        if ( Flink == p_SecurityAttributesList )
          return (unsigned int)inserted;
        v13 = a2 + 0x98;
        while ( 1 )
        {
          if ( (unsigned int)Feature_2516935995__private_IsEnabledDeviceUsage() )
          {
            inserted = AuthzBasepProbeAndInsertTailList(a2 + 8, v13 - 0x68);
            if ( inserted < 0 )
              goto LABEL_24;
          }
          else
          {
            [...]
          }
          ++*(_DWORD *)a2;
          *(_WORD *)(v13 - 56) = Flink[3].Flink;
          *(_DWORD *)(v13 - 52) = HIDWORD(Flink[3].Flink);
          *(_QWORD *)(v13 - 24) = v13 - 32;
          *(_QWORD *)(v13 - 32) = v13 - 32;
          *(_QWORD *)v13 = v13 - 8;
          *(_QWORD *)(v13 - 8) = v13 - 8;
          *(_QWORD *)(v13 - 48) = 0i64;
          *(_DWORD *)(v13 - 40) = 0;
          *(_DWORD *)(v13 - 16) = 0;
          Flink_low = LOWORD(Flink[2].Flink);
          v19 = Flink_low;
          v17 = (wchar_t *)((v10 + 1) & 0xFFFFFFFFFFFFFFFEui64);
          v15 = (unsigned __int64)v17 + Flink_low;
          if ( (unsigned __int64)v17 + Flink_low > v6 )
            break;
          if ( (unsigned int)Feature_3391791421__private_IsEnabledDeviceUsage() )
          {
            *(_QWORD *)&v18.Length = 0i64;
            v18.MaximumLength = Flink_low;
            v18.Buffer = v17;
            RtlCopyUnicodeString(&v18.Length, (unsigned __int16 *)&Flink[2]);
            *(_UNICODE_STRING *)(v13 - 0x48) = v18;
          }
          else
          {
            [...]
          }
          inserted = AuthzBasepCopyoutInternalSecurityAttributeValues(
                       (__int64)Flink,
                       v13 - 104,
                       v15,
                       (int)v6 - (int)v15,
                       &v19);
    [...]
  • 在调试会话中,我们可以看到修补后 rcx 是内核地址:
root@kitploit:~
5: kd> 
nt!AuthzBasepCopyoutInternalSecurityAttributes+0x1aa:
fffff803`5dbcf14a e8810fa5ff      call    nt!RtlCopyUnicodeString (fffff803`5d6200d0)
5: kd> r
rax=0000025a81d006a0 rbx=0000025a81d00590 rcx=ffffe20697c4f778
rdx=ffffa609c7a101a0 rsi=0000025a81d00598 rdi=0000025a81d00628
rip=fffff8035dbcf14a rsp=ffffe20697c4f740 rbp=0000025a81d006c0
 r8=0000000000000003  r9=0000025a81d00590 r10=ffffa609c816ef78
r11=ffffe20697c4f7d0 r12=0000000000000a70 r13=ffffa609ca9b1118
r14=ffffa609c7a10180 r15=0000025a81d01000
iopl=0         nv up ei pl nz na pe nc
cs=0010  ss=0018  ds=002b  es=002b  fs=0053  gs=002b             efl=00040202
nt!AuthzBasepCopyoutInternalSecurityAttributes+0x1aa:
fffff803`5dbcf14a e8810fa5ff      call    nt!RtlCopyUnicodeString (fffff803`5d6200d0)

POC:

  • https://youtu.be/y5LnlHjzA64
下载工具