Browser Referer Header
Results 1 to 6 of 6

Thread: Browser Referer Header

  1. #1

    Browser Referer Header

    Heres the situation:

    I'm writing a script in PHP that pulls the referer from the browsers request and compares it with other data. However, FF is doing something unexpected and I was hoping someone else can confirm something for me...

    http://www.google.com/url?sa=U&start...ers.php&e=7629

    This link goes to google, then immediately jumps to a site that views headers (this way the referer should be set)

    Do this in IE and FF, and FF won't send the referer header. I've been all over google trying to find some reason for this to no avail.

    So basically what I need is someone to tell me I'm not crazy and FF doesn't send referer headers, or any workarounds to get to that referer.

    Here's the way I'm getting the header in PHP:
    PHP Code:
    <?php

    echo $_SERVER['HTTP_REFERER']; 

    ?&
    gt
    Thanks!

  2. #2
    Senior Member
    Join Date
    Mar 2004
    Posts
    557
    Hi Soda

    I suggest you to take a look at burpproxy[1], which is an interactive HTTP[S] proxy.
    By capturing all incoming/outgoing 80/443 packets, you can check which header
    information is sent by your test browser[s].

    This gives you a first layer for debugging.

    Cheers

    P.s. the link you provided tells me antionline.com/... as referer, using FF 1.0.

    [1] http://osx.freshmeat.net/projects/burpproxy/

    /edit: to be consistent with moxnix (which is quite interesting: look at the
    version of FF by moxnix and mine).

    FF 1.0

    Code:
    Host:  	pgl.yoyo.org
    Referer: 	http://www.antionline.com/showthread...hreadid=265350
    User-Agent: 	Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
    and

    Code:
    Host:  	pgl.yoyo.org
    Referer: http://www.antionline.com/showthread...hreadid=265350 
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
    using some version of IE6 ...

    If the only tool you have is a hammer, you tend to see every problem as a nail.
    (Abraham Maslow, Psychologist, 1908-70)

  3. #3
    Macht Nicht Aus moxnix's Avatar
    Join Date
    May 2002
    Location
    Huson Mt.
    Posts
    1,752
    Soda,
    This is what I am getting using Firefox ver 1.0
    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Accept-Encoding: gzip, deflate
    Accept-Language: en-us,en;q=0.5
    Host: pgl.yoyo.org
    Referer: http://pgl.yoyo.org/http/browser-headers.php
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
    Now let me jump over to IE6:
    Accept: */*
    Accept-Encoding: gzip, deflate
    Accept-Language: en-us
    Connection: Keep-Alive
    Host: pgl.yoyo.org
    Referer: http://www.antionline.com/showthread...hreadid=265350
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
    Hope that helps you.
    \"Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body, but rather to skid in sideways, Champagne in one hand - strawberries in the other, body thoroughly used up, totally worn out and screaming WOO HOO - What a Ride!\"
    Author Unknown

  4. #4
    Senior Member
    Join Date
    Nov 2001
    Posts
    1,255
    Just so you know, automatic forwards will not set a referrer, you MUST click a link off a site in order for the referrer to be set. This is why FF wouldn't do it for you when you went manually, but works fine when you click the link. Try it yourselves:
    Clicked on link:
    Code:
    Accept:  	text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    Accept-Charset: 	ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Accept-Encoding: 	gzip,deflate
    Accept-Language: 	en-us,en;q=0.5
    Connection: 	keep-alive
    Host: 	pgl.yoyo.org
    Keep-Alive: 	300
    Referer: 	http://www.antionline.com/showthread...hreadid=265350
    User-Agent: 	Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
    Copy and pasted link:
    Code:
    Accept:  	text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    Accept-Charset: 	ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Accept-Encoding: 	gzip,deflate
    Accept-Language: 	en-us,en;q=0.5
    Connection: 	keep-alive
    Host: 	pgl.yoyo.org
    Keep-Alive: 	300
    User-Agent: 	Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
    Chris Shepherd
    The Nelson-Shepherd cutoff: The point at which you realise someone is an idiot while trying to help them.
    \"Well as far as the spelling, I speak fluently both your native languages. Do you even can try spell mine ?\" -- Failed Insult
    Is your whole family retarded, or did they just catch it from you?

  5. #5
    Right, when I click the link in my first post while in Firefox, I get this:
    HTTP headers supplied by your browser ():
    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Accept-Encoding: gzip,deflate
    Accept-Language: en-us,en;q=0.5
    Connection: keep-alive
    Host: pgl.yoyo.org
    Keep-Alive: 300
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
    So it looks like I'm crazy. Or I have some obscure setting enabled which I can't seem to find. I didn't use a proxy, but I did sniff the traffic when I made the request, no referer there either.

  6. #6
    Banned
    Join Date
    Sep 2004
    Posts
    305
    Hmm, clicking the link:
    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Accept-Encoding: gzip,deflate
    Accept-Language: en-us,en;q=0.5
    Connection: keep-alive
    Host: pgl.yoyo.org
    Keep-Alive: 300
    Referer: http://www.antionline.com/showthread...&postid=817700
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
    '
    Copy/Paste the link:
    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Accept-Encoding: gzip,deflate
    Accept-Language: en-us,en;q=0.5
    Connection: keep-alive
    Host: pgl.yoyo.org
    Keep-Alive: 300
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •