httpx icon indicating copy to clipboard operation
httpx copied to clipboard

Issue with blank location header with redirerct status code

Open Ph33rr opened this issue 2 years ago • 2 comments

Hello, v1.2.1

echo "http://testphp.vulnweb.com/redir.php" | httpx -status-code -content-length -ip -cdn -title -tech-detect -random-agent

nothing

curl http://testphp.vulnweb.com/redir.php -v

> GET /redir.php HTTP/1.1
> Host: testphp.vulnweb.com
> User-Agent: curl/7.82.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 302 Moved Temporarily
< Server: nginx/1.19.0
< Date: Sat, 30 Apr 2022 04:51:09 GMT
< Content-Type: text/html; charset=UTF-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Powered-By: PHP/5.6.40-38+ubuntu20.04.1+deb.sury.org+1
< Location:
<
* Connection #0 to host testphp.vulnweb.com left intact

Ph33rr avatar Apr 30 '22 04:04 Ph33rr

httpx failed to print probed results when location header is blank with redirect status code, ideally this is expected when client is used with fr flag, without fr flag the initial probed should be displayed.

echo http://testphp.vulnweb.com/redir.php | httpx -v

[DBG] Failed 'http://testphp.vulnweb.com/redir.php': GET http://testphp.vulnweb.com/redir.php giving up after 1 attempts: Get "http://testphp.vulnweb.com/redir.php": 302 response missing Location header

ehsandeep avatar May 01 '22 06:05 ehsandeep

On Hold - Fixed in go (https://github.com/golang/go/issues/49281) but not yet released upstream

Mzack9999 avatar May 12 '22 12:05 Mzack9999

Fixed with latest go release:

$ echo "http://testphp.vulnweb.com/redir.php" | go run . -status-code -content-length -ip -cdn -title -tech-detect -random-agent

    __    __  __       _  __
   / /_  / /_/ /_____ | |/ /
  / __ \/ __/ __/ __ \|   /
 / / / / /_/ /_/ /_/ /   |
/_/ /_/\__/\__/ .___/_/|_|
             /_/

                projectdiscovery.io

[INF] Current httpx version v1.3.4 (latest)
http://testphp.vulnweb.com/redir.php [302] [0] [] [44.228.249.3] [Nginx:1.19.0,PHP:5.6.40,Ubuntu]

Mzack9999 avatar Aug 08 '23 08:08 Mzack9999