command
I don't know way I can not use this command: cdn-proxy cloudfront create --host like the video?
The video was for an old version of the cli, I unfortunately haven't been able to update it yet.
I'll double check in the morning what the command should be, but you shouldn't really need to specify the host anymore. That's done dynamically when the request is sent.
The usage info should be under the CloudFront or CloudFlare section of the readme (can't link it from my phone rn, sorry).
Hello~ I am super super super happy to receive your reply. I hope to implement a case to demonstrate CDN Shadowing(My homework). I am clear know how CDN Shadowing works,but I'm not proficient to use @.*** function. I have registered a domain(d28v8aptqir7br.cloudfront.net) to point google.com http://google.com/. When I search a word by using this website I hope the page to still show d28v8aptqir7br.cloudfront.net instead of google.com http://google.com/ I consider that cdn-proxy may help me.However I really can not use cdn-proxy to achieve my demo. Could you show the operation steps in more detail?
2022年4月21日 下午6:45,Ryan Gerstenkorn @.***> 写道:
The usage info should be under the CloudFront section of the readme (can't link it from my phone rn, sorry).
— Reply to this email directly, view it on GitHub https://github.com/RyanJarv/cdn-proxy/issues/3#issuecomment-1105046424, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIPJH7KFS3XAO6AFRLLAFGTVGEWWDANCNFSM5T6ZDHKQ. You are receiving this because you authored the thread.
So the reason why you are getting redirected to google.com when you click anything is because the HTML is not modified by CloudFront when it is returned to you. The page google.com returns has fully qualified URLs using their own domain name, so clicking on any of them will send you to google rather than your cloudfront domain.
Normally, when you are using cdn-proxy you can fix this issue by using the Burp extension which rewrites all the links in the HTML to point to your distribution. However, I think there is something else going on here as well, I'll have to look into what's going on there.
In the mean time I'd recommend using something else as an example. Using a website you set up your self is likely the best option, in my demo I used wordpress on AWS Lightsail which was fairly simple to set up. I then configured IP tables to only allow access from the CloudFront IP ranges.
I'm also assuming for the distribution you set up the origin is configured to use google.com? If this is the case it's not really demoing the issue because you are still being routed through Google's intended CDN, instead you are just adding another proxy in front of theirs. The origin really should be set to the backend servers google uses to be effective, they of course don't publish these so you would need to figure this out by using cdn-scanner (really a modified version that looks for specific html strings) or some other means. This process is not particularly straight forward unless you are testing your own network. Lastly, it's also unlikely it would work in this case, since I imagine google doesn't use a shared CDN, if they did it's most likely GCP (but that's just a guess).
Anyways, setting up your own server will likely be the best way to demo this issue. Happy to help with the specifics of this if you want to ping me at [email protected].
Regarding the correct command on the latest version, it should just be:
cdn-proxy cloudfront --profile <my_profile> create
After that's complete the distribution should have instructions for routing to specific backends with curl on demand as well as work with cdn-proxy and the burp plugin for browsing various sites.
Hello~
Thank you for your reply!
I still need your help~
Please confirm that you have released the latest can-proxy version.
I use pip3 download the the cdn-proxy-0.1.8, however this command cdn-proxy cloudfront --profile create is still unavailable.
Follow your precious advice, I have built a wordpress websites. Then I set mywordpress.com <http://mywordpress.com/> as origin domain and get a distribution domain.
I input cdn-proxy cloudfront --profile create mywordpress.com <http://mywordpress.com/> mycloudfont.com
The error message is
Usage: cdn_proxy cloudfront [OPTIONS] COMMAND [ARGS]...
Try 'cdn_proxy cloudfront -h' for help.
Error: No such command ‘mywordpress.com <http://mywordpress.com/>’
2022年4月24日 上午8:58,Ryan Gerstenkorn @.***> 写道:
Sorry for the delay. The reason why you are getting redirected to google.com when you click anything is because the HTML is not modified by CloudFront when it is returned to you. The page google.com returns has fully qualified URLs using their own domain name, so clicking on any of them will send you to google rather than your cloudfront domain.
Normally, when you are using cdn-proxy you can fix this issue by using the Burp extension https://github.com/RyanJarv/cdn-proxy#burp-suite-extension which rewrites all the links in the HTML to point to your distribution. However, I think there is something else going on here as well, I'll have to look into what's going on there.
In the mean time I'd recommend using something else as an example. Using a website you set up your self is likely the best option, in my demo I used wordpress on AWS Lightsail which was fairly simple to set up. I then configured IP tables to only allow access from the CloudFront IP ranges https://d7uri8nf7uskq.cloudfront.net/tools/list-cloudfront-ips.
I'm assuming for the distribution you set up the origin is configured to use google.com? If this is the case it's not really demoing the issue because you are still being routed through Google's intended CDN, instead you are just adding another proxy in front of theirs. The origin should be set to the backend servers google uses to be effective, they of course don't publish these so you would need to figure this out by using cdn-scanner (really a modified version that looks for specific html strings) or some other means. It's also unlikely it would work in this case, I imagine google doesn't use a shared CDN, and if they did it's most likely GCP (but that's just a guess).
Anyways, setting up your own server will likely be the best way to demo this issue. Happy to help with the specifics of this if you want to ping me at @.*** @.***>.
Regarding the correct command on the latest version, it should just be:
cdn-proxy cloudfront --profile create
After that's complete the distribution should have instructions for routing to specific backends with curl on demand as well as work with cdn-proxy and the burp plugin for browsing various sites.
— Reply to this email directly, view it on GitHub https://github.com/RyanJarv/cdn-proxy/issues/3#issuecomment-1107675928, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIPJH7OKAXBXSRJTCZTOIG3VGSMB7ANCNFSM5T6ZDHKQ. You are receiving this because you authored the thread.
There's no need to specify your wordpress domain now. You can set up one distribution and it will work for every site. So the setup command should be:
cdn-proxy cloudfront --profile my_profile create
Just make sure to replace my_profile with your actual AWS profile (you can check this with aws configure list. If your credentials are the default profile you can remove the --profile my_profile part and it will just be:
cdn-proxy cloudfront --profile my_profile create
Once that is done you can browse to the site and there will be additional directions for accessing a specific backend. It's important to note that you will specify your server IP/hostname (let's say: 1.2.3.4) when you send the request, not when you create the distribution. So after the set up is done sending a request via curl will look something like:
curl -H 'Cdn-Proxy-Origin: 1.2.3.4' -H 'Cdn-Proxy-Host: mywordpress.com' XXXXXXXXXXXXX.cloudfront.net
Making sure to replace 1.2.3.4 with your server IP, mywordpress.com with the domain name it expects, and XXXXXXXXXXXXX.cloudfront.net with the cloudfront distribution name that the cdn-proxy command created (this will be in the output during creation but you can double check this with cdn-proxy cloudfront --profile my_profile status).
You can also browse to a specific backend in you browser by passing Cdn-Proxy-Origin and Cdn-Proxy-Host as query parameters. This would look like this:
XXXXXXXXXXXXX.cloudfront.net/?cdn-proxy-origin=1.2.3.4&cdn-proxy-host=mywordpress.com
Although you may run into the issue of links on your site redirecting away unless you are using the burp plugin.
I also just noticed an issue with creation when there is no CloudFront policies previously created in the account. I pushed a fix for it but I can't release an updated package to pypi right now. To workaround this you can try updating from github directly:
pip install -U git+https://github.com/RyanJarv/cdn-proxy.git@main
(Issue: https://github.com/RyanJarv/cdn-proxy/issues/4)
Facing similar challenge with cloudflare. Any brief insight on bypass seem to be new??
Sorry, I don't catch your meaning. I just want to achieve a demo like the video in your page. However, I can not solve the problem of redirection. I want to know if there are any details I have not noticed?
---Original--- From: @.> Date: Fri, Apr 29, 2022 20:17 PM To: @.>; Cc: @.@.>; Subject: Re: [RyanJarv/cdn-proxy] command (Issue #3)
Facing similar challenge with cloudflare. Any brief insight on bypass seem to be new??
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Redirection is happening because the URL’s from the backend are not replaced with your distribution URL.
The burp plugin is meant to work around this as long as you are using the built in browser (with the cdn-proxy plugin installed).
Admittedly this could be simpler though, a possible improvement might be to rewrite the URLs in a second Lambda@Edge function. I’m not sure if/when I’ll have time to look into that though.
So in the mean time you essentially need to use the burp plugin or something that doesn’t redirects automatically like curl or the cdn-scanner.
If you you used word press, one easy hack is to demo just the /wp-admin.php login page.
I believe this should work because that page will return relative URLs. (I can’t remember for sure though, so this is just kind of a guess).
Oh another thing is a redirect may occur if the host header to the backend is not set correctly.
The burp plugin also fixes that, for curl you’ll need to make sure you set the Cdn-Proxy-Host header correctly.
In the browser (without burp) you can temporary work around this by adding a cdn-proxy-host=realsite.name.com to the URL. Links may still redirect if you do this though. The first page should at least load correctly if it wasn’t before.
Let me know if this clarifies the redirection issue.
Hello! Follow your precious advice,I have do something: 1) Create WordPress website by use Amazon Lighjtsail (The temp ip is 13.54.135.145) 2) Create a distribution domain as d3kpogoaz6l30z.cloudfront.net http://3kpogoaz6l30z.cloudfront.net/. (Using this command: cdn-proxy cloudfront create) 3) Send a request via curl 4) Set the Burp Suite However, when I click the link in the page of WordPress, this site still redirect to 13.54.135.145. It’s seem that Burp Suite may not rewrite this page? My IP tables allows access from any IP.
2022年4月24日 下午5:25,chenxu @.***> 写道:
Hello~ Thank you for your reply!
I still need your help~Please confirm that you have released the latest can-proxy version. I use pip3 download the the cdn-proxy-0.1.8, however this command cdn-proxy cloudfront --profile create is still unavailable.
Follow your precious advice, I have built a wordpress websites. Then I set mywordpress.com http://mywordpress.com/ as origin domain and get a distribution domain.
I input cdn-proxy cloudfront --profile create mywordpress.com http://mywordpress.com/ mycloudfont.com http://mycloudfont.com/ The error message is Usage: cdn_proxy cloudfront [OPTIONS] COMMAND [ARGS]... Try 'cdn_proxy cloudfront -h' for help. Error: No such command ‘mywordpress.com http://mywordpress.com/’
2022年4月24日 上午8:58,Ryan Gerstenkorn @.*** @.***>> 写道:
Sorry for the delay. The reason why you are getting redirected to google.com http://google.com/ when you click anything is because the HTML is not modified by CloudFront when it is returned to you. The page google.com http://google.com/ returns has fully qualified URLs using their own domain name, so clicking on any of them will send you to google rather than your cloudfront domain.
Normally, when you are using cdn-proxy you can fix this issue by using the Burp extension https://github.com/RyanJarv/cdn-proxy#burp-suite-extension which rewrites all the links in the HTML to point to your distribution. However, I think there is something else going on here as well, I'll have to look into what's going on there.
In the mean time I'd recommend using something else as an example. Using a website you set up your self is likely the best option, in my demo I used wordpress on AWS Lightsail which was fairly simple to set up. I then configured IP tables to only allow access from the CloudFront IP ranges https://d7uri8nf7uskq.cloudfront.net/tools/list-cloudfront-ips.
I'm assuming for the distribution you set up the origin is configured to use google.com http://google.com/? If this is the case it's not really demoing the issue because you are still being routed through Google's intended CDN, instead you are just adding another proxy in front of theirs. The origin should be set to the backend servers google uses to be effective, they of course don't publish these so you would need to figure this out by using cdn-scanner (really a modified version that looks for specific html strings) or some other means. It's also unlikely it would work in this case, I imagine google doesn't use a shared CDN, and if they did it's most likely GCP (but that's just a guess).
Anyways, setting up your own server will likely be the best way to demo this issue. Happy to help with the specifics of this if you want to ping me at @.*** @.***>.
Regarding the correct command on the latest version, it should just be:
cdn-proxy cloudfront --profile create
After that's complete the distribution should have instructions for routing to specific backends with curl on demand as well as work with cdn-proxy and the burp plugin for browsing various sites.
— Reply to this email directly, view it on GitHub https://github.com/RyanJarv/cdn-proxy/issues/3#issuecomment-1107675928, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIPJH7OKAXBXSRJTCZTOIG3VGSMB7ANCNFSM5T6ZDHKQ. You are receiving this because you authored the thread.
Looking at the burp plugin again it looks like we are not rewriting the links in the response body currently. So what you're describing makes sense, sorry for the confusion.
This should be possible though by doing a search and replace on the response body somewhere around here: https://github.com/RyanJarv/cdn-proxy/blob/main/burp_extension/cdn_proxy_burp_ext.py#L43. I likely won't be able to implement this right now but if you're interested in fixing the issue that's what I'd look in to.