Noooste / azuretls-client

An easy-to-use HTTP client 100% in Go to spoof TLS/JA3 and HTTP2 fingerprint
MIT License
172 stars 25 forks source link

[BUG] Issue with 403 Status Code Page #73

Closed musicyin closed 6 months ago

musicyin commented 7 months ago
    session := azuretls.NewSession()
    defer session.Close()

    _ = session.SetProxy("socks5://127.0.0.1:30001") // you should use charles proxy to see this issue
    session.InsecureSkipVerify = true

    headers := http.Header{
        "user-agent": {"robot"}, //use robot user-agent to make issue
    }

    for {
        req := &azuretls.Request{
            Method:           http.MethodGet,
            Url:              "https://driverpracticaltest.dvsa.gov.uk/",  //I cannot find other website protected by incapsula , just use this to test
            Header:           headers,
            DisableRedirects: true,
        }

        response, err := session.Do(req)

        if err != nil {
            fmt.Println(err.Error())
        } else {
            fmt.Println(response.StatusCode)
            fmt.Println(string(response.Body))
        }
        time.Sleep(2 * time.Second) //Prevent attack the website
    }

Error Details:

http2: timeout awaiting response headers
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x38 pc=0x12b7c51]                    

goroutine 1 [running]:                                                 
github.com/Noooste/fhttp.(*Request).Cookies(...)                       
        C:/Users/Administrator/go/pkg/mod/github.com/!noooste/fhttp@v1.0.11/request.go:412
github.com/Noooste/azuretls-client.(*Session).makeHeadersCopier(0xc0000e4340, 0xc000294000)
        C:/Users/Administrator/go/pkg/mod/github.com/!noooste/azuretls-client@v1.4.9/header.go:197 +0x2f1
github.com/Noooste/azuretls-client.(*Session).do(0xc0000e4340, 0xc000294000, {0x0, 0x0, 0x0})
        C:/Users/Administrator/go/pkg/mod/github.com/!noooste/azuretls-client@v1.4.9/session.go:269 +0x251
github.com/Noooste/azuretls-client.(*Session).Do(...)
        C:/Users/Administrator/go/pkg/mod/github.com/!noooste/azuretls-client@v1.4.9/session.go:239

Expect: Status code and content should be response correctly

Remark: You may need to use a non-US IP to trigger this status code

musicyin commented 6 months ago

Is there any news for this?

Noooste commented 6 months ago

Hello, I will patch this issue asap

musicyin commented 6 months ago

The problem is still not solved. The second request cannot be sent and no error is reported.

musicyin commented 6 months ago

Appears after 30 seconds, http2: timeout awaiting response headers But the actual request was not sent (Charles can clearly see that the request was not sent)