Code Monkey home page Code Monkey logo

Comments (6)

hcancelik avatar hcancelik commented on July 17, 2024

@apecollector Cannot say the same. I just give it a shot, and it's not working :(

from cloudflare-bp-go.

DaRealFreak avatar DaRealFreak commented on July 17, 2024

I changed the credentials for my VPN accounts a while ago already, but never updated the secrets in all my github projects which caused the tests to fail.

Will check and update the tests if necessary.

from cloudflare-bp-go.

hcancelik avatar hcancelik commented on July 17, 2024

@DaRealFreak, maybe I'm not doing this right but here is my example code.

package main

import (
	"fmt"
	"github.com/DaRealFreak/cloudflare-bp-go"
	"net/http"
)

func main() {
	url := "https://www.lexusofpembrokepines.com/inventory/58ADZ1B12MU096560?type=U"

	client := &http.Client{}
	client.Transport = cloudflarebp.AddCloudFlareByPass(client.Transport)

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		fmt.Println("Error creating request:", err)
		return
	}

	resp, err := client.Do(req)
	if err != nil {
		fmt.Println("Error making request:", err)
		return
	}
	defer resp.Body.Close()

	fmt.Println("Status Code:", resp.Status)
}

from cloudflare-bp-go.

M41KL-N41TT avatar M41KL-N41TT commented on July 17, 2024

@hcancelik
That site enforces a JS/non-interactive challenge for that link regardless of TLS configuration.

This is (at least so far) NOT intended to solve challenges provided by CloudFlare, only to prevent CloudFlare from directly displaying you a challenge on the first request.

The RoundTripper is still working.
Try to request this URL https://www.lexusofpembrokepines.com/wp-content/cache/jellyfish-cache/new-vehicles-js.js?mt=1698335265 via the Go Roundtripper and then via curl.

You will see that the roundtripper gives 200 OK, but curl guarantees a 403 response

from cloudflare-bp-go.

hcancelik avatar hcancelik commented on July 17, 2024

@m41k1n4177 Thanks for the response.

I'm still getting 403 for that url. This is the code I have used.

Additionally, there is also no way for me to find out that javascript URL in advance so I'm not sure how this would help.

type MyRoundTripper struct {
	Transport http.RoundTripper
}

func (rt *MyRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
	resp, err := rt.Transport.RoundTrip(req)
	if err != nil {
		return nil, err
	}
	
	fmt.Printf("Status Code: %d\n", resp.StatusCode)

	return resp, nil
}

func main() {
	url := "https://www.lexusofpembrokepines.com/wp-content/cache/jellyfish-cache/new-vehicles-js.js?mt=1698335265"

	client := &http.Client{
		Transport: &MyRoundTripper{Transport: http.DefaultTransport},
	}

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		fmt.Println("Error creating request:", err)
		return
	}

	_, err = client.Do(req)
	if err != nil {
		fmt.Println("Error making request:", err)
		return
	}
}

from cloudflare-bp-go.

M41KL-N41TT avatar M41KL-N41TT commented on July 17, 2024

I don't think you should use that exact link as it seems to have some cache-busting added, I think it may have been suffixed with ?mt=time() or something.

Also not sure this, the original repo supports use with http.DefaultTransport.

Readme:

Using the http.DefaultTransport will currently still fail, nil or empty &http.Transport works. Didn't have the time to check what exactly is different causing the CloudFlare validation to fail though.

from cloudflare-bp-go.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.