Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base64 encode url to bypass some filters #141

Open
FadeFADev opened this issue May 17, 2020 · 7 comments
Open

Base64 encode url to bypass some filters #141

FadeFADev opened this issue May 17, 2020 · 7 comments

Comments

@FadeFADev
Copy link

Some filters will look for key words in the url this can be bypassed by encoding the part of the url.

ex:
before: http://cord-spell.glitch.me/get/http://test/
after: http://cord-spell.glitch.me/get/aHR0cDovL3Rlc3Qv

@nfriedly
Copy link
Owner

Yea, a couple of folks have asked about this before. It's not a bad idea, just a fair amount of effort, and it will somewhat reduce the functionality of the proxy because relative URLs and javascript-generated URLs won't work as reliably. It's on my todo list, though - https://github.com/nfriedly/node-unblocker/wiki/Todo#base64

@wapfalls
Copy link

Any plans on implementing this feature? will be a great addon to bypass most filters :)

@wapfalls
Copy link

Am wondering what proxy script this website uses, (freevideoproxy . com), they somehow managed to encode urls

@nfriedly
Copy link
Owner

Probably not any time soon :(

If you want to, though, you can give it a shot.

@wapfalls
Copy link

Probably not any time soon :(

If you want to, though, you can give it a shot.

Can you give some pointers at high level, on what changes to be made in what files, so I will have a look.

Thanks

@nfriedly
Copy link
Owner

Sure.

You'll probably use the atob() and btoa() methods that are built-in to JavaScript to do the encoding and decoding: https://developer.mozilla.org/en-US/docs/Glossary/Base64

First you'll want to base-64 encode the url on the home page form. If you're using the nodeunblocker.com codebase, that'd be here: https://github.com/nfriedly/nodeunblocker.com/blob/master/public/index.html#L112

And, then decode it on the server here: https://github.com/nfriedly/node-unblocker/blob/master/lib/get-real-url.js

And, finally, when re-writing URLs, you'll want to encode them here: https://github.com/nfriedly/node-unblocker/blob/master/lib/url-prefixer.js#L35

That should cover the basics, but I imagine there are going to be a lot of edge cases, such as the aforementioned ones with relative URLs and javascript-generated URLS. So you'll probably have to make the getRealUrl() method able to handle it both ways. I'm not sure what else will come up, but there may be some other issues. You can let me know if you get stuck.

You'll also want to make it configurable and off by default so that the tests don't all start failing. (And, then add new tests where it's turned on to make it continue to work.)

@wapfalls
Copy link

@nfriedly Thanks for detailing the steps, Will give it a try and let you know if I get stuck somewhere :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants