A comprehensive study of the http.sys driver
This document presents a concise investigation into http.sys. While the research is not exhaustive, it aims to provide valuable insights for further exploration.
This vulnerability involves a Service name size overflow. The exploitation process is as follows:
- Pass a value larger than WORD
- Call the check via
UlIsChannelBindChangeNeeded
- The size is then copied to WORD
- Memory corruption occurs when copying a string in UNICODE with ASCII
This directory contains:
- Drivers of different versions
- httpapi.dll (To be added soon)
This section includes decompiled and analyzed functions of the driver, intended to assist further research.
The driver communicates with user-mode applications using IOCTLs. httpapi.dll serves as an intermediary layer in this process.
Purpose: Configures channel authentication Access: Through HTTP request handling or setting for:
- Group (IOCTL code: 0x12801D)
- Session (IOCTL code: 0x12800D)
- Allocates a container for server names
- Single argument: number of server names
- Returns 0 if more than 64 names, otherwise returns allocated memory address
- Memory allocation via ExAllocatePool3
Arguments:
- Address of allocation container
- Service name address
- Service name buffer
- Buffer length
Function:
- Checks length to prevent integer overflow
- x64: pServiceNameLen >= 0xFFFFFFFFE8
- x86: 0xFFFFFFFFF4
- If valid, allocates memory (length + 24 for x64, length + 12 for x86)
- Writes to the container
- Validates config
- Checks flags for compatibility
- Scans buffer for "."
- Returns false if "." is not found
Copies bind config from source to destination
Called in IOCTL handler (naming accuracy to be confirmed)
Copies authentication settings (flags, schemes, realms, domains)
Processes HTTP_SERVER_AUTHENTICATION_DIGEST_PARAMS from HTTP_SERVER_AUTHENTICATION_INFO
Handles HTTP_SERVER_AUTHENTICATION_BASIC_PARAMS from HTTP_SERVER_AUTHENTICATION_INFO
- Compares two bind configs
- Sets third argument result (1 if different)
Compares all Service Names in the container
Extracts and verifies authentication information from the request
Note: Other functions are either insufficiently researched or deemed less significant.
Relevant device paths:
\\Device\\Http\\Communication
\\Device\\Http\\ClientSession
\\Device\\Http\\ReqQueue