Skip to content

Commit

Permalink
fix forcing http/1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ybadaoui-ostorlab committed Nov 13, 2024
1 parent 21b5771 commit fdd4729
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions agent/exploits/cve_2019_16278.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Agent Asteroid implementation for CVE-2019-16278"""

import datetime
import http.client as http_client
from urllib import parse as urlparse

import requests
Expand All @@ -23,6 +22,7 @@
@exploits_registry.register
class CVE201916278Exploit(webexploit.WebExploit):
accept_request = definitions.Request(method="GET", path="/")

metadata = definitions.VulnerabilityMetadata(
title=VULNERABILITY_TITLE,
description=VULNERABILITY_DESCRIPTION,
Expand Down Expand Up @@ -76,10 +76,9 @@ def check(self, target: definitions.Target) -> list[definitions.Vulnerability]:
"User-Agent": "Mozilla/5.0",
}

# Force HTTP/1.0 by setting the default version in the HTTPConnection class
http_client.HTTPConnection._http_vsn = 10 # type: ignore[attr-defined]
http_client.HTTPConnection._http_vsn_str = "HTTP/1.0" # type: ignore[attr-defined]

# Force HTTP/1.0
self.session._http_vsn = 10
self.session._http_vsn_str = "HTTP/1.0"
try:
req = requests.Request(
method="POST", url=target_endpoint, headers=headers, data=payload
Expand Down

0 comments on commit fdd4729

Please sign in to comment.