• DMCA
  • Disclaimer
  • Terms and Conditions
  • Cookie Privacy Policy
  • Privacy Policy
  • Contact
  • Advertise
Real Hacker
  • Home
  • Review
    Meta introduces Instagram Reels APIs for developers – TechCrunch

    Meta introduces Instagram Reels APIs for developers – TechCrunch

    Basic home office hacks: 8 things you need to elevate your workspace

    Basic home office hacks: 8 things you need to elevate your workspace

    Fintech investors appear to be favoring later-stage deals as sector takes a hit, recent data shows – TechCrunch

    Fintech investors appear to be favoring later-stage deals as sector takes a hit, recent data shows – TechCrunch

    Spurred by Roe overturn, senators seek FTC probe of iOS and Android tracking

    Spurred by Roe overturn, senators seek FTC probe of iOS and Android tracking

    OSOM’s OV1 is now Solana’s web3 Android handset, Saga – TechCrunch

    OSOM’s OV1 is now Solana’s web3 Android handset, Saga – TechCrunch

    NFT summer in New York is in full swing amid crypto winter – TechCrunch

    NFT summer in New York is in full swing amid crypto winter – TechCrunch

  • Gaming
    How To Get Every Free Reward From Apex Legends Mobile’s Latest Login Event

    How To Get Every Free Reward From Apex Legends Mobile’s Latest Login Event

    Hideo Kojima set aside superhero project for being too close to Amazon’s The Boys

    Hideo Kojima set aside superhero project for being too close to Amazon’s The Boys

    Freshly Frosted Has Me Dreaming Colorful Donut Dreams

    Freshly Frosted Has Me Dreaming Colorful Donut Dreams

    Video Games Double Down On NFTs Despite Historic Crashes

    Video Games Double Down On NFTs Despite Historic Crashes

    Microsoft Flight Simulator update could lead to a virtual Space Shuttle

    Microsoft Flight Simulator update could lead to a virtual Space Shuttle

    Into The Breach Advanced Edition Introduces New Mechs And A Mobile Port Through Netflix

    Into The Breach Advanced Edition Introduces New Mechs And A Mobile Port Through Netflix

  • Gear
    • All
    • Audio
    • Camera
    • Laptop
    • Smartphone
    Nvidia GTX 1630 leaks, an entry level Turing card

    Nvidia GTX 1630 leaks, an entry level Turing card

    Check out the Akai Switch – a Nintendo Switch and Akai MPC concept

    Check out the Akai Switch – a Nintendo Switch and Akai MPC concept

    The Google Pixel 6a boasts faster fingerprint sensor than the 6 Pro in this video

    The Google Pixel 6a boasts faster fingerprint sensor than the 6 Pro in this video

    What to expect from Apple in the second half of 2022?

    What to expect from Apple in the second half of 2022?

    Intellytech Pocket-V Dual Charger – Newsshooter

    Intellytech Pocket-V Dual Charger – Newsshooter

    The Gamesir X3 adds a cooling fan to your phone, but does it work?

    The Gamesir X3 adds a cooling fan to your phone, but does it work?

    Trending Tags

    • Best iPhone 7 deals
    • Apple Watch 2
    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • iOS 10
    • iPhone 7
    • Sillicon Valley
  • Computers
    GEEKOM Mini IT8 Mini PC, A Price Almost As Small As The System

    GEEKOM Mini IT8 Mini PC, A Price Almost As Small As The System

    As HPC Chip Sizes Grow, So Does the Need For 1kW+ Chip Cooling

    As HPC Chip Sizes Grow, So Does the Need For 1kW+ Chip Cooling

    Cooler Master V850 SFX Gold, In White

    Cooler Master V850 SFX Gold, In White

    Banished To Work In The Metaverse For A Week

    Banished To Work In The Metaverse For A Week

    The Gigabyte UD1000GM PG5 1000W PSU Review: Prelude to ATX 3.0

    The Gigabyte UD1000GM PG5 1000W PSU Review: Prelude to ATX 3.0

    AMD Updates Ryzen Embedded Series, R2000 Series With up to Four Cores and Eight Threads

    AMD Updates Ryzen Embedded Series, R2000 Series With up to Four Cores and Eight Threads

  • Applications
    Cybersecurity Experts Warn of Emerging Threat of “Black Basta” Ransomware

    Cybersecurity Experts Warn of Emerging Threat of “Black Basta” Ransomware

    iMore Show 800: What’s the deal with the new M2 MacBook Pro?

    iMore Show 800: What’s the deal with the new M2 MacBook Pro?

    Air Twister Flies Onto Apple Arcade

    Air Twister Flies Onto Apple Arcade

    Popular Apple Music service tier gets sudden price hike in the US, UK, and Canada

    Popular Apple Music service tier gets sudden price hike in the US, UK, and Canada

    Hackers Exploit Mitel VoIP Zero-Day in Likely Ransomware Attack

    Hackers Exploit Mitel VoIP Zero-Day in Likely Ransomware Attack

    Zoom’s new subscription makes it an even better team collaboration service

    Zoom’s new subscription makes it an even better team collaboration service

  • Security
    Stories from the SOC – Detecting internal reconnaissance

    Stories from the SOC – Detecting internal reconnaissance

    Threat Intelligence Services Are Universally Valued by IT Staff

    Threat Intelligence Services Are Universally Valued by IT Staff

    #InfosecurityEurope2022: Preparing for Future Challenges and Opportunities

    #InfosecurityEurope2022: Preparing for Future Challenges and Opportunities

    Mitek launches MiVIP platform to fight identity theft

    Mitek launches MiVIP platform to fight identity theft

    #InfosecurityEurope2022: The Interactivity Between Nation-State Attackers and Organized Crime Gangs

    #InfosecurityEurope2022: The Interactivity Between Nation-State Attackers and Organized Crime Gangs

    Does an iPhone Need Antivirus Software?

    Does an iPhone Need Antivirus Software?

No Result
View All Result
  • Home
  • Review
    Meta introduces Instagram Reels APIs for developers – TechCrunch

    Meta introduces Instagram Reels APIs for developers – TechCrunch

    Basic home office hacks: 8 things you need to elevate your workspace

    Basic home office hacks: 8 things you need to elevate your workspace

    Fintech investors appear to be favoring later-stage deals as sector takes a hit, recent data shows – TechCrunch

    Fintech investors appear to be favoring later-stage deals as sector takes a hit, recent data shows – TechCrunch

    Spurred by Roe overturn, senators seek FTC probe of iOS and Android tracking

    Spurred by Roe overturn, senators seek FTC probe of iOS and Android tracking

    OSOM’s OV1 is now Solana’s web3 Android handset, Saga – TechCrunch

    OSOM’s OV1 is now Solana’s web3 Android handset, Saga – TechCrunch

    NFT summer in New York is in full swing amid crypto winter – TechCrunch

    NFT summer in New York is in full swing amid crypto winter – TechCrunch

  • Gaming
    How To Get Every Free Reward From Apex Legends Mobile’s Latest Login Event

    How To Get Every Free Reward From Apex Legends Mobile’s Latest Login Event

    Hideo Kojima set aside superhero project for being too close to Amazon’s The Boys

    Hideo Kojima set aside superhero project for being too close to Amazon’s The Boys

    Freshly Frosted Has Me Dreaming Colorful Donut Dreams

    Freshly Frosted Has Me Dreaming Colorful Donut Dreams

    Video Games Double Down On NFTs Despite Historic Crashes

    Video Games Double Down On NFTs Despite Historic Crashes

    Microsoft Flight Simulator update could lead to a virtual Space Shuttle

    Microsoft Flight Simulator update could lead to a virtual Space Shuttle

    Into The Breach Advanced Edition Introduces New Mechs And A Mobile Port Through Netflix

    Into The Breach Advanced Edition Introduces New Mechs And A Mobile Port Through Netflix

  • Gear
    • All
    • Audio
    • Camera
    • Laptop
    • Smartphone
    Nvidia GTX 1630 leaks, an entry level Turing card

    Nvidia GTX 1630 leaks, an entry level Turing card

    Check out the Akai Switch – a Nintendo Switch and Akai MPC concept

    Check out the Akai Switch – a Nintendo Switch and Akai MPC concept

    The Google Pixel 6a boasts faster fingerprint sensor than the 6 Pro in this video

    The Google Pixel 6a boasts faster fingerprint sensor than the 6 Pro in this video

    What to expect from Apple in the second half of 2022?

    What to expect from Apple in the second half of 2022?

    Intellytech Pocket-V Dual Charger – Newsshooter

    Intellytech Pocket-V Dual Charger – Newsshooter

    The Gamesir X3 adds a cooling fan to your phone, but does it work?

    The Gamesir X3 adds a cooling fan to your phone, but does it work?

    Trending Tags

    • Best iPhone 7 deals
    • Apple Watch 2
    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • iOS 10
    • iPhone 7
    • Sillicon Valley
  • Computers
    GEEKOM Mini IT8 Mini PC, A Price Almost As Small As The System

    GEEKOM Mini IT8 Mini PC, A Price Almost As Small As The System

    As HPC Chip Sizes Grow, So Does the Need For 1kW+ Chip Cooling

    As HPC Chip Sizes Grow, So Does the Need For 1kW+ Chip Cooling

    Cooler Master V850 SFX Gold, In White

    Cooler Master V850 SFX Gold, In White

    Banished To Work In The Metaverse For A Week

    Banished To Work In The Metaverse For A Week

    The Gigabyte UD1000GM PG5 1000W PSU Review: Prelude to ATX 3.0

    The Gigabyte UD1000GM PG5 1000W PSU Review: Prelude to ATX 3.0

    AMD Updates Ryzen Embedded Series, R2000 Series With up to Four Cores and Eight Threads

    AMD Updates Ryzen Embedded Series, R2000 Series With up to Four Cores and Eight Threads

  • Applications
    Cybersecurity Experts Warn of Emerging Threat of “Black Basta” Ransomware

    Cybersecurity Experts Warn of Emerging Threat of “Black Basta” Ransomware

    iMore Show 800: What’s the deal with the new M2 MacBook Pro?

    iMore Show 800: What’s the deal with the new M2 MacBook Pro?

    Air Twister Flies Onto Apple Arcade

    Air Twister Flies Onto Apple Arcade

    Popular Apple Music service tier gets sudden price hike in the US, UK, and Canada

    Popular Apple Music service tier gets sudden price hike in the US, UK, and Canada

    Hackers Exploit Mitel VoIP Zero-Day in Likely Ransomware Attack

    Hackers Exploit Mitel VoIP Zero-Day in Likely Ransomware Attack

    Zoom’s new subscription makes it an even better team collaboration service

    Zoom’s new subscription makes it an even better team collaboration service

  • Security
    Stories from the SOC – Detecting internal reconnaissance

    Stories from the SOC – Detecting internal reconnaissance

    Threat Intelligence Services Are Universally Valued by IT Staff

    Threat Intelligence Services Are Universally Valued by IT Staff

    #InfosecurityEurope2022: Preparing for Future Challenges and Opportunities

    #InfosecurityEurope2022: Preparing for Future Challenges and Opportunities

    Mitek launches MiVIP platform to fight identity theft

    Mitek launches MiVIP platform to fight identity theft

    #InfosecurityEurope2022: The Interactivity Between Nation-State Attackers and Organized Crime Gangs

    #InfosecurityEurope2022: The Interactivity Between Nation-State Attackers and Organized Crime Gangs

    Does an iPhone Need Antivirus Software?

    Does an iPhone Need Antivirus Software?

No Result
View All Result
Real Hacker
No Result
View All Result

Home Security

Technical Analysis of CVE-2021-1732 | McAfee Blog

RealHacker Staff by RealHacker Staff
February 28, 2022
Technical Analysis of CVE-2021-1732 | McAfee Blog
Share on FacebookShare on Twitter


Introduction

In February 2021, the corporate Dbappsecurity found a pattern within the wild that exploited a zero-day vulnerability on Home windows 10 x64.

The vulnerability, CVE-2021-1732, is a win32k window object kind confusion resulting in an OOB (out-of-bounds) write which can be utilized to create arbitrary reminiscence learn and write capabilities throughout the Home windows kernel (native Elevation of Privilege (EoP)). Reminiscence exploitation typically requires a learn, write, and execute primitive to bypass trendy exploit mitigations akin to DEP, ASLR and CFG on hardened working techniques akin to Home windows 10. A knowledge-only assault requires solely a learn and write primitive because it doesn’t search to execute malicious code in reminiscence, however slightly manipulates knowledge buildings utilized by the working system to its benefit (i.e., to attain elevated privileges).

Kernel exploits are normally essentially the most subtle assault as they work together instantly with the Home windows kernel. When such assaults are profitable, they’re crucial as a result of they supply excessive privileges to the attacker, which can be utilized to extend the affect of the general exploit chain. On this case the exploit is a Native Privilege Escalation (LPE) that targets 64-bit Home windows 10 model 1909. The unique pattern found was compiled in Might 2020 and reported to Microsoft in December 2020. Whereas looking for further findings we went by means of a public exploit printed in March of 2021 by a researcher. Having this code publicly out there could elevate the potential for added menace attackers. Whereas now we have not discovered clear proof demonstrating malicious use of the proof-of-concept (POC), we did uncover some variants being examined and uploaded to VirusTotal.

On this weblog publish, McAfee Superior Risk Analysis (ATR) carried out a deep dive into the evaluation of the vulnerability, to determine the primitives for detection and safety. The exploit is novel in its use of a brand new win32k arbitrary kernel reminiscence learn primitive utilizing the GetMenuBarInfo API, which to one of the best of our data had not been beforehand recognized publicly.

CVE-2021-1732 Deep Dive

Exploitation of CVE-2021-1732 might be divided into six phases with the top aim of escalating a course of’ privileges to System. The next diagram reveals the phases.

Determine 1 – Six phases of CVE-2021-1732

Earlier than we dive into the small print, we should give some background to win32k exploitation primitives that are used within the exploitation of CVE-2021-1732.

Win32K Background

Win32k is a Graphical (GUI) element of the Microsoft Home windows Subsystem, most of which exists within the kernel for efficiency causes. It’s used for graphical print of the Home windows OS desktop. Nonetheless, because of the win32k structure, the kernel element of win32k nonetheless wants to have the ability to make calls to person mode by means of user-mode callback capabilities to facilitate window creation and administration.

Kernel user-mode callbacks have been nicely researched way back to 2008 and 2010, with a really complete evaluation in 2011 by Mandt. A win32k kernel perform akin to xxxCreateWindowEx will make a callback perform akin to xxxClientAllocWindowClassExtraBytes by means of the person course of PEB KernelCallbackTable.

When the user-mode callback has accomplished, NtCallbackReturn executes and passes the anticipated return parameter again to the kernel. As a result of stateless nature of those callbacks, many vulnerabilities have been found associated to the locking mechanisms on the objects resulting in use-after-free (UAF) exploitation.

Win32k has been one of the exploited parts within the Home windows kernel accounting for 63% of vulnerabilities from 2010 to 2018, resulting from its giant assault floor of syscalls relative to ntdll syscalls. Win32k vulnerabilities are typically become data-only assaults utilizing a learn/write kernel primitive through the use of a desktop object referred to as a tagWND knowledge construction.

There are two features to data-only assaults:

  1. Discovering a vulnerability.
  2. Leveraging present or new learn/write primitives utilizing particular OS APIs on object fields akin to tagWND.cbWndExtra.

The tagWND knowledge construction has two fields which make it a first-rate goal for studying/writing inside kernel reminiscence; tagWND.cbWndExtra and tagWND.ExtraBytes. When a window is created utilizing CreateWindowEx, it’s potential to request further bytes of reminiscence instantly after the tagWND object in reminiscence by means of the cbWndExtra subject within the WNDCLASSEXA construction when registering the window class.

The variety of further bytes is managed by the cbWndExtra subject, and the allotted further reminiscence handle is positioned on the ExtraBytes subject. The learn/write primitive is created as follows:

  1. Uncover a vulnerability akin to a UAF, which can assist you to write to a tagWND object in reminiscence referred to as WND0.
  2. Allocate one other tagWND object referred to as WND1 close to the beforehand corrupted WND0 in reminiscence.
  3. Overwrite WND0.cbWndExtra to a big worth akin to 0xFFFFFFF.
  4. Name an API akin to SetWindowLongPtr on WND0 which can write OOB to fields inside WND1.

Win32k kernel user-mode callbacks have been exploited many occasions by leveraging tagWND learn/write capabilities throughout the Home windows kernel for escalation of privileges akin to CVE-2014-4113, CVE-2015-0057, MS15-061, CVE-2016-7255 and CVE-2019-0808.

Win32k Exploit Primitives

A number of primitives have been noticed within the CVE-2021-1732 exploit utilized by the attackers; moreover, it’s value mentioning that a few of them are new and never beforehand seen within the wild.

Previous to Home windows RS4 it was trivial to leak tagWND kernel addresses utilizing a number of methods, akin to calling HMValidateHandle to repeat tagWND objects from the kernel to person desktop heap. The newest model of Home windows 10 has been hardened towards such trivial methods.

Nonetheless, utilizing the spmenu kernel handle leak method and relative tagWND desktop heap offsets, as soon as a vulnerability is found to overwrite a tagWND.cbWndExtra subject, it’s potential to attain kernel learn/write capabilities with out leaking the precise tagWND kernel addresses. The spmenu method on this exploit was used right here and right here, however we aren’t conscious of the GetMenuBarInfo API ever getting used earlier than in a win32k exploit.

The next diagram reveals the primitives utilized in CVE-2021-1732.

Determine 2 – CVE-2021-1732 Primitives

Current Home windows OS Mitigations

Nice work has been finished to harden the safety of win32k towards EoP assaults with new and improved mitigations by the Microsoft OSR staff, Mandt, Google Venture Zero, Schenk and Dabah.  These mitigations embody:

  1. Kind isolation (all identical kind objects tagWND getting used).
  2. Win32k filtering (restricted to Edge browser and never course of extensive however since this analysis there have been many enhancements on win32k API filtering capabilities such because the addition of _stub_UserSetWindowLong and _stub_UserSetWindowLongPtr _stub_UserGetMenuBarInfo in win32k.sys).
  3. Fragmenting kernel desktop heap and elimination of kernel addresses within the person desktop heap (can use relative offsets inside person and desktop heaps described later within the weblog).
  4. Elimination of knowledge kind symbols from win32k drivers (obfuscation slightly than mitigation).

Within the context of a malicious course of exploiting CVE-2021-1732, the above mitigations present no safety. Nonetheless, it doesn’t affect Google Chrome because it disallows win32k calls (Home windows 8 and better), or Microsoft Edge because it applies win32k filtering on the related APIs.

Triggering the Vulnerability and Patch Evaluation

When a window is created utilizing CreateWindowEx API, a tagWND object is created by the Home windows working system. This window, as defined above, might be created with a parameter to allocate further reminiscence utilizing cbWndExtra.

In the course of the home windows creation course of (CreateWindowEx API) a callback named xxxClientAllocWindowClassExtraBytes is triggered to allocate house within the person mode desktop heap for the tagWND.ExtraBytes (offset 0x128) per the tagWND.cbWndExtra (offset 0xc8) worth measurement (see determine 3 and 4 under for WND1).

Determine 3 – WND1 Kernel tagWND – Consumer mode copy positioned at offset 0x28
Determine 4 – WND1 Consumer Mode tagWND

The situation of this reminiscence is saved as a person mode reminiscence pointer to the desktop heap and positioned at tagWND.ExtraBytes. It’s then potential to transform the traditional window to a console window utilizing NtUserConsoleControl which can convert that person mode pointer at tagWND.ExtraBytes to an offset worth which factors into the kernel desktop heap (see determine 5 under for WND0). It’s this modification in worth at tagWND.ExtraBytes (window kind confusion) that may be exploited for an OOB write throughout the xxxClientAllocWindowClassExtraBytes callback window.

Determine 5 – WND0 Consumer Mode tagWND
Determine 6 – Triggering the sort confusion vulnerability inside win32kfull!xxxCreateWindowEx

Per determine 6 above the next steps are required to set off the vulnerability:

  1. Get a pointer to the HMValidateHandle inline perform inside user32.dll.
  2. Hook xxxClientAllocWindowClassExtraBytes throughout the PEB KernelCallBack desk.
  3. Create a number of home windows (we are going to simply use the primary two WND0 and WND1 created), utilizing the CreateWindowEx API, in order that two home windows are created in shut reminiscence proximity.
  4. Name HMValidateHandle on WND0 and WND1 which can copy their objects from the kernel desktop heap to person desktop heap. At tagWND+0x8 an offset is saved into the desktop heap; this offset is similar for the person and kernel desktop heaps. The exploit makes use of these offset values to calculate the relative distance between WND0 and WND1 within the kernel desktop heap which is required later for studying and writing OOB. Per desk 1 under, through the use of these offsets there is no such thing as a requirement to leak the precise WND0 and WND1 kernel addresses since learn and writes might be finished relative to the offsets (person and kernel desktop heaps have the identical offsets).
Desk 1 – Consumer and Kernel Desktop heaps have the identical offsets

5. WND0 is then transformed to a console window by calling NtUserConsoleControl which converts WND0.ExtraBytes from a person desktop heap pointer to an offset throughout the kernel desktop heap. That is wanted later in order that WND0 can write OOB to WND1.

6. Create malicious window WND_Malicious utilizing the CreateWindowEx API

    • In the course of the window creation the callback xxxClientAllocWindowClassExtraBytes API is executed to request person mode to allocate reminiscence for WND_Malicious.cbWndExtra and cross the person desktop heap pointer again to the kernel perform win32kfull!xxxCreateWindowEx.
    • xxxClientAllocWindowClassExtraBytes has now been hooked and we do the next earlier than returning to win32kfull!xxxCreateWindowEx:
      • Name NtUserConsoleControl to transform WND_Malicious to a console window so changing its WND_Malicious.cbWndExtra from a person desktop heap pointer to an offset throughout the kernel desktop heap.
      • Lastly name NtCallbackReturn which completes the callback and returns a single worth to xxxClientAllocWindowClassExtraBytes. As an alternative of passing the person desktop heap pointer as anticipated by xxxClientAllocWindowClassExtraBytes again to the kernel we cross the worth at WND0+0x08 which is the kernel desktop heap offset to WND0 per determine 7 under. Now anytime we name SetWindowLongW on WND_Malicious we will probably be writing to WND0.
Determine 7 – WND_Malicious

Patch Evaluation

The vulnerability lies in the truth that win32kfull!xxxCreateWindowEx doesn’t test whether or not the window kind has modified between the time it initiates the xxxClientAllocWindowClassExtraBytes and will get the response from NtCallbackReturn.

After we name NtUserConsoleControl with WND_Malicious within the hook above, xxxConsoleControl checks if tagWND+0xE8 flag has been set to 0x800 to point a console window per determine  under. As WND_Malicious was created as a traditional window, xxxConsoleControl allocates reminiscence at an offset throughout the kernel desktop heap after which frees the person desktop heap pointer present at WND_Malicious.ExtraBytes (0ffset 0x128). It then locations the offset to this new allocation within the kernel heap at WND_Malicious.ExtraBytes (0ffset 0x128) and units the tagWND+0xE8 flag to 0x800 to point it’s a console window.

After coming back from the callback once we issued NtCallbackReturn above, xxxCreateWindowEx doesn’t test that the window kind has modified and locations the WND0+0x08 at WND_Malicious.ExtraBytes per determine 9 under. The RedirectFieldpExtraBytes checks the WND_Malicious.ExtraBytes initialized worth however it’s too late as WND0+0x08 has already been written to WND_Malicious.ExtraBytes (offset 0x128).

Determine 9 – win32kfull!xxxCreateWindowEx (susceptible model)

The patched win32kfull.sys has up to date xxxCreateWindowEx to now test the ExtraBytes initialized worth earlier than writing the returned worth from person mode to tagWND. ExtraBytes (offset 0x128) per determine 10 under.

Determine 10 – win32kfull!xxxCreateWindowEx (patched model)

Determine 11 under reveals that tagWND. ExtraBytes is initialized to zero inside xxxCreateWindowEx throughout regular window creation.

Determine 11 – tagWND. ExtraBytes initialization for regular window

Determine 12 under reveals that tagWND. ExtraBytes is initialized to the brand new offset worth within the kernel desktop heap inside xxxConsoleControl throughout console window creation. RedirectFieldpExtraBytes merely checks this initialized worth to find out if the window kind has modified. As well as, Microsoft have additionally added telemetry for detecting modifications to the window kind flag within the patched model.

Determine 12 – tagWND. ExtraBytes initialization for console window

tagWND OOB Write

The vulnerability throughout the xxxCreateWindowEx API allowed the WND_Malicious.ExtraBytes subject be to set to a price of WND0 offset throughout the kernel desktop heap. Now any time SetWindowLongW known as on WND_Malicious it is going to write to WND0. By supplying an offset of 0xc8, the perform will overwrite the WND0.cbWndExtra subject to a big worth of 0XFFFFFFF per figures 13 and 14 under.

This implies it could actually write past its tagWND construction and ExtraBytes in kernel reminiscence to fields inside WND1. As well as, WND0.ExtraBytes can also be overwritten with the offset to itself so calls to SetWindowLongPtrA on WND0 will write to an offset in kernel desktop heap relative to the beginning of WND0.

Determine 13 – OOB Write from WND_Malicious to WND0
Determine 14 – WND0 cbWndExtra overwritten with 0xFFFFFFF by WND_Malicious OOB write

Kernel Tackle Leak

Now that the WND0.cbWndExtra subject has been set to a really giant worth (0xFFFFFFF), anytime SetWindowLongPtrA known as on WND0 it is going to write into the adjoining WND1 in kernel reminiscence per determine 15 under. By writing to particular fields in WND1 we are able to create a kernel handle reminiscence leak as follows:

  1. Write a price of 0x400000000000000 to WND1 fashion subject to briefly change it to a toddler window per figures 15 and 16 under.
  2. Calling SetWindowLongPtrA API on WND0 with a price of -12 (GWLP_ID) now permits the spmenu subject (kind tagMENU) of WND1 to be overwritten with a pretend spmenu knowledge construction since now we have modified it to be a toddler window per determine 15 and 17 under.
  3. Per SetWindowLongPtrA API documentation, the return worth will give us the unique worth on the offset overwritten, i.e., the spmenu knowledge construction pointer which is a kernel reminiscence handle. So, we now have leaked a pointer to a spmenu (kind tagMENU) knowledge construction in kernel reminiscence and changed the pointer in WND1.spmenu with a pretend spmenu knowledge construction inside person desktop heap per determine 17 under.
Determine 15 – OOB Write from WND0 to WND1 to Leak Kernel Tackle
Determine 16 – WND1 Model subject earlier than and after writing 0x4000000000000000
Determine 17 – spmenu kernel reminiscence handle pointer leaked and subsequently changed by a person mode handle pointing to a pretend spmenu knowledge construction

Kernel Arbitrary Learn

Utilizing the spmenu knowledge construction kernel pointer leaked beforehand we are able to use the structure of this knowledge construction and the GetMenuBarInfo API logic to show it into an arbitrary kernel reminiscence learn per figures 18,19 and 20 under.

Determine 18 – Kernel Arbitrary Learn utilizing pretend spmenu and GetMenuBarInfo
Determine 19 – Faux spmenu knowledge construction in person desktop heap with authentic spmenu leaked kernel pointer at crafted location to allow arbitrary learn utilizing GetMenuBarInfo API
Determine 20 – WinDbg command to point out location inside spmneu knowledge construction that’s deferenced by xxGetMenuBarInfo

As you may see from the xxxGetMenuBarInfo perform in figures 21 and 22 under, by putting our leaked kernel handle on the proper location in our pretend spmenu knowledge construction we are able to create an arbitrary kernel reminiscence learn when calling GetMenuBarInfo.

Determine 21 – win32kfull!xxxGetMenuBarInfo
Determine 22 – GetMenuBarInfo knowledge construction populated return values per regular spmenu and faux spmenu (leaks kernel handle)

Kernel Arbitrary Write

An arbitrary kernel write primitive might be simply achieved now by writing our vacation spot handle to WND1.ExtraBytes subject by calling SetWindowLongPtrA on WND0 which can write OOB to WND1 relative to the offset we specify per determine 23 under

On this case the offset is 0x128 which is ExtraBytes. Then merely calling SetWindowLongPtrA on WND1 will write a specified worth on the handle positioned within the WND1.ExtraBytes subject. The arbitrary write is achieved as a result of WND1 is a traditional window (has not been transformed to a console window like WND0 and WND_Malicious) and so will write to no matter handle we place in WND1.ExtraBytes.

Determine 23– Kernel Arbitrary Write for What-Write-The place (WWW)

Knowledge Solely Assault

The arbitrary kernel learn and write primitives might be mixed to carry out a data-only assault to overwrite a malicious course of EPROCESS token with that of PID 4 which is System for an escalation of privilege (EoP).

The unique spmenu kernel handle leaked beforehand has a pointer to WND1 at offset 0x50 per figures 24 and 25 under. Via a number of arbitrary reads utilizing the GetMenuBarInfo on our pretend spmenu knowledge construction with this WND1 kernel handle we are able to ultimately learn the PID 4 System EPROCESS token.

Determine 24 – Combining pretend spmenu with GetMenuBarInfo arbitrary learn to get PID 4 token
Determine 25– Authentic spmenu with WND1 kernel handle pointer at offset 0x50

By putting the vacation spot handle (malicious course of EPROCESS token) at WND1.ExtraBytes then the next name to SetWindowLongPtrA will write the worth (PID 4 – System EPROCESS token) to that handle per figures 26 and 27 under.

Determine 26 – EPROCESS Token swap
Determine 27 – Overwriting WND1.ExtraBytes with handle of EPROCESS token

The exploit then restores overwritten knowledge construction values as soon as the EoP is full to forestall a BSOD (Blue Display screen of Demise).

Conclusion

On this report, we undertook a deep evaluation of CVE-2021-1732 which is a Native Privilege Escalation on Home windows 10. Home windows kernel data-only assaults are troublesome to defend towards, as as soon as a vulnerability is found they use official and trusted code by means of particular APIs to control knowledge buildings in kernel reminiscence.

The win32k element has been hardened by means of nice work by Microsoft towards learn/write primitives, however there are nonetheless alternatives for exploitation resulting from its giant assault floor (syscalls and callbacks) and lack of win32k filtering on a process-wide foundation. It might even be nice to see a system extensive win32k filtering coverage functionality inside Home windows 10.

Patching is all the time one of the best answer for vulnerabilities, however a powerful protection technique akin to menace looking can also be required the place patching is probably not potential, and to detect variants of vulnerabilities/exploits being utilized by campaigns.





Source link

Related

Tags: AnalysisBlogCVE20211732McAfeeTechnical
RealHacker Staff

RealHacker Staff

Recommended.

Safari tops 1 billion users, still dwarfed by Google Chrome

Safari tops 1 billion users, still dwarfed by Google Chrome

June 1, 2022
Cyber-attack on California Healthcare Organization

Cyber-attack on California Healthcare Organization

March 31, 2022

Trending.

Hypex Presents New Nilai500 DIY Audio Amplifier Module

Hypex Presents New Nilai500 DIY Audio Amplifier Module

May 16, 2022
ADPTR Audio Sculpt review: A must-have dynamics plug-in for mastering and mixing engineers

ADPTR Audio Sculpt review: A must-have dynamics plug-in for mastering and mixing engineers

March 15, 2022
NAMM 2022: Audeze partners Manny Marroquin on the Manny MM-500 headphones

NAMM 2022: Audeze partners Manny Marroquin on the Manny MM-500 headphones

June 3, 2022
12 best rotary mixers for DJs

12 best rotary mixers for DJs

March 16, 2022
Behringer synthesizers 2022: Every hardware instrument Behringer is working on

Behringer synthesizers 2022: Every hardware instrument Behringer is working on

April 12, 2022

Follow Us

Categories

  • Applications
  • Audio
  • Camera
  • Computers
  • Gaming
  • Gear
  • Laptop
  • Metaverse
  • Microsoft
  • Photography
  • Review
  • Security
  • Smartphone
  • Uncategorized

Recent News

Meta introduces Instagram Reels APIs for developers – TechCrunch

Meta introduces Instagram Reels APIs for developers – TechCrunch

June 27, 2022
How To Get Every Free Reward From Apex Legends Mobile’s Latest Login Event

How To Get Every Free Reward From Apex Legends Mobile’s Latest Login Event

June 27, 2022
  • DMCA
  • Disclaimer
  • Terms and Conditions
  • Cookie Privacy Policy
  • Privacy Policy
  • Contact
  • Advertise

© 2019 - theme develop by real hacker news.

No Result
View All Result
  • Home
  • Review
  • Applications
  • Computers
  • Gaming
  • Gear
    • Audio
    • Camera
    • Smartphone
  • Microsoft
  • Photography
  • Security

© 2019 - theme develop by real hacker news.

error: Content is protected !!