Rapid7 Vulnerability & Exploit Database

Ancillary Function Driver (AFD) for WinSock Elevation of Privilege

Back to Search

Ancillary Function Driver (AFD) for WinSock Elevation of Privilege

Disclosed
01/10/2023
Created
03/30/2023

Description

A vulnerability exists in the Windows Ancillary Function Driver for Winsock (`afd.sys`) can be leveraged by an attacker to escalate privileges to those of NT AUTHORITY\SYSTEM. Due to a flaw in `AfdNotifyRemoveIoCompletion`, it is possible to create an arbitrary kernel Write-Where primitive, which can be used to manipulate internal I/O ring structures and achieve local privilege escalation. This exploit only supports Windows 11 22H2 up to build 22621.963 (patched in January 2023 updates).

Author(s)

  • chompie
  • b33f
  • Yarden Shafir
  • Christophe De La Fuente

Platform

Windows

Architectures

x64

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/windows/local/cve_2023_21768_afd_lpe
msf exploit(cve_2023_21768_afd_lpe) > show targets
    ...targets...
msf exploit(cve_2023_21768_afd_lpe) > set TARGET < target-id >
msf exploit(cve_2023_21768_afd_lpe) > show options
    ...show and set options...
msf exploit(cve_2023_21768_afd_lpe) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;