js redirect with spoofed referrer

madbobo

Newbie
Joined
Jan 6, 2008
Messages
18
Reaction score
0
Hi,
I am trying to make a redirect with JS that will do same that PHP CURL options can do - set the referrer so that on the target page a referrer will be spoofed and not the actual url triggered the redirect.

Can anyone share ideas.
I am not strong in JS so please describe in details

Thanks
 
Hi madbobo,

Short answer - doing it on your end in an environment you control: possible, and easy! Doing it in your website visitors' browsers: not possible!

Long answer
The "Referer: ..." part of the HTTP Request is set by the software sending the packet. As you mentioned, if you're using cURL, you can set it to anything (or nothing). When it comes to doing it in a regular browser (assuming no plugins or other adulterances) it is possible to remove it only, and "spoofing" is not really possible (unless you loosen your definition of "spoof"). I'm assuming you are trying to do this in your website visitors' browsers because in your question you specifically mention JS.

Removing it is possible with the use of "Referrer-Policy" (be careful with the spelling).

Spoofing is sort of possible if you use one of those redirect services, this can be services like link shorteners or services specifically made to strip referer info (Google it, my post count is too low to link an example). So you can just set it to "WhateverYouWant.com".

Hope that helps.
 
Back
Top