Jump to content

Recommended Posts

Im tring to get java script to spoof a referer via the XMLHTTP object but i cannot get it working properly. 

here is an example that wont work
yahoo is the target and google is the fake referere this is the location of the script http://thisfileshost/spoof2.php


<script type="text/javascript">
var x = new ActiveXObject("Microsoft.XMLHTTP");
x.open("GET\thttp://www.yahoo.com\tHTTP/1.0\r\nHost:\twww.yahoo.com\r\nReferer:\thttp://www.google.com\r\n\r\nGET\thttp://nosuchhost/\tHTTP/1.0\r\nFoobar:","http://thisfileshost/spoof2.php",false);
x.send();
alert(x.responseText);
</script>

not sure what im missing here i get a file not found error 404 

Thanks guys
Link to comment
https://forums.phpfreaks.com/topic/14639-java-script-question/
Share on other sites

Found a much easier solution to spoof a referer via activex althought it does require you to enable the intilize and script control that are marked not safe option in ie settings. Don't know much about active x controls so if you guys know how to convert this small script to a control the user can install so they don't have to enable this option that would be great otherwise i guess i will spend a few hours reading. thanks below is the source. forgive the spelling to lazy to fix.

<SCRIPT language="Javascript">
function spoofit()
{
var target;
var referer;

target = document.getElementById('url').value;
referer = document.getElementById('ref').value;

var header = "Referer: " + referer + "\n\r";
var objIE = new ActiveXObject("InternetExplorer.Application");
objIE.Visible = true;
objIE.Navigate(target, 2, "", "", header);
}
</SCRIPT>
Link to comment
https://forums.phpfreaks.com/topic/14639-java-script-question/#findComment-59035
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.