httpx icon indicating copy to clipboard operation
httpx copied to clipboard

Unable to parse when the returned packet is not in normal http format

Open No-Github opened this issue 2 years ago • 1 comments
trafficstars

httpx version:

v1.2.6

Current Behavior:

[DBG] Failed 'http://*.*.*.*:8080': GET http://*.*.*.*:8080 giving up after 1 attempts: Get "http://*.*.*.*:8080": net/http: HTTP/1.x transport connection broken: malformed MIME header: missing colon: "user\""
[DBG] Failed 'http://*.*.*.*:8080': invalid header line: "user\"\r\n"
Snipaste_2023-02-06_01-10-12

Snipaste_2023-02-06_01-08-29

Expected Behavior:

The target is accessible and should have normal result output

Steps To Reproduce:

  1. fofa query: "wf2411" && port="8080"
  2. echo "*.*.*.*:8080" | httpx -debug -unsafe

Anything else:

No-Github avatar Feb 05 '23 17:02 No-Github

@No-Github Thanks for opening this issue. Unfortunately the standard library enforces strong validation on http protocol. Probably this will be indirectly fixed with https://github.com/projectdiscovery/rawhttp/pull/112

Mzack9999 avatar Apr 13 '23 22:04 Mzack9999

Although it is possible in some hacky way to override the internal net/textproto/reader.goreadMIMEHeader via linking after testing, it seems pretty much unreliable as the rest of the response fail to be parsed, and numerous runtime errors are introduced. Closing as not planned for the time being, it will be indirectly fixed with https://github.com/projectdiscovery/rawhttp/pull/112 fallback mechanism

Mzack9999 avatar Jul 04 '23 11:07 Mzack9999