Skip to content
Memory corruption Write-up Advanced

Arbitrary Write Primitive

The Dell dbutil_2_3.sys driver exposes an IOCTL that passes user-controlled arguments to memmove, allowing an attacker to write to arbitrary kernel memory. The author demonstrates how to turn this into a full arbitrary read/write primitive and then escalate to SYSTEM by corrupting page table entries.

connormcgarr.github.io

Published on connormcgarr.github.io

Recently I said I was going to focus on browser exploitation with Advanced Windows Exploitation being canceled. With this cancellation, I found myself craving a binary exploitation training, with AWE now being canceled for the previous two years.

Connor McGarr, on connormcgarr.github.io

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The driver fails to validate user-supplied arguments to memmove, allowing arbitrary kernel memory write.

Impact

An attacker could achieve arbitrary kernel memory read/write and escalate privileges to SYSTEM, unless mitigations like VBS/HVCI are enabled.

What the attacker needed

Local access to the system; ability to load the vulnerable driver

How it was found

  1. Obtain a handle to the driver using CreateFile with the symbolic link.
  2. Send an IOCTL code to the driver using DeviceIoControl.
  3. Craft a buffer of at least 0x18 bytes to pass the size check.
  4. Set the destination address in the buffer at offset 0x8 and source at offset 0x18.
  5. Ensure the lower 32 bits of the destination address are zero to avoid mangling.
  6. Trigger the IOCTL to perform the arbitrary write.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A kernel driver is a low-level program that runs with high privileges. This driver had a function that copied data from one place to another, but it let the user choose both the source and destination addresses. That means an attacker could overwrite important memory in the operating system and take full control.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.