projectdiscovery / httpx

httpx is a fast and multi-purpose HTTP toolkit that allows running multiple probes using the retryablehttp library.
https://docs.projectdiscovery.io/tools/httpx
MIT License
7.76k stars 844 forks source link

Supporting storing request chained data #200

Closed ehsandeep closed 3 years ago

ehsandeep commented 3 years ago

Currently with httpx when -sr flag is used, httpx store the final response data into a file, sometimes it also requires storing response data of intermediate redirects data as well and that is not possible as of now.

Suggested addition:-

When follow-redirects flag is used, httpx should save all the chain data into the same file.


HTTP/1.1 301 Moved Permanently
Connection: close
Content-Length: 92
Cache-Control: no-cache
Cf-Cache-Status: DYNAMIC
Cf-Ray: 62302a5e1ebb3966-MAA
Cf-Request-Id: 0851f8cecd00003966bd075000000001

HTTP/1.1 200 OK
Connection: close
Transfer-Encoding: chunked
Cf-Cache-Status: DYNAMIC
Cf-Ray: 623021a4ca56396b-MAA
Cf-Request-Id: 0851f35afa0000396b48a46000000001
Content-Security-Policy: default-src 'none'; block-all-mixed-content; connect-src 'self' www.google-analytics.com cdn.jsdelivr.net *.algolia.net *.algolianet.com; font-src 'self'; img-src 'self' data:; script-src 'self' 'unsafe-eval' 'unsafe-inline' www.google-analytics.com cdn.jsdelivr.net *.algolia.net *.algolianet.com; style-src 'self' 'unsafe-inline' cdn.jsdelivr.net; form-action 'self';
Content-Type: text/html
Date: Wed, 17 Feb 2021 14:17:21 GMT
Etag: W/"602c2775-1e65"
Expect-Ct: enforce, max-age=86400
Last-Modified: Tue, 16 Feb 2021 20:13:41 GMT
Referrer-Policy: strict-origin-when-cross-origin
Server: cloudflare
Set-Cookie: __cfduid=d85231708ee738c41b774b6242315c2541613571441; expires=Fri, 19-Mar-21 14:17:21 GMT; path=/; Domain=api.hackerone.com; HttpOnly; SameSite=Lax; Secure
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: DENY
X-Permitted-Cross-Domain-Policies: none
X-Xss-Protection: 1; mode=block
.
.
.
.
Mzack9999 commented 3 years ago

Using the flag -store-chain an additional new file named domain.port.chain.txt gets created in the store folder containing the whole chain (requests + responses)