In what cases will HTTP_REFERER be empty

后端 未结 5 1343
不知归路
不知归路 2020-11-22 05:29

I know it\'s possible to get an empty HTTP_REFERER. Under what circumstances does this happen? If I get an empty one, does it always mean that the user changed it? Is gettin

5条回答
  •  眼角桃花
    2020-11-22 06:01

    HTTP_REFERER - sent by the browser, stating the last page the browser viewed!

    If you trusting [HTTP_REFERER] for any reason that is important, you should not, since it can be faked easily:

    1. Some browsers limit access to not allow HTTP_REFERER to be passed
    2. Type a address in the address bar will not pass the HTTP_REFERER
    3. open a new browser window will not pass the HTTP_REFERER, because HTTP_REFERER = NULL
    4. has some browser addon that blocks it for privacy reasons. Some firewalls and AVs do to.

    Try this firefox extension, you'll be able to set any headers you want:

    @Master of Celebration:

    Firefox:

    extensions: refspoof, refontrol, modify headers, no-referer

    Completely disable: the option is available in about:config under "network.http.sendRefererHeader" and you want to set this to 0 to disable referer passing.

    Google chrome / Chromium:

    extensions: noref, spoofy, external noreferrer

    Completely disable: Chnage ~/.config/google-chrome/Default/Preferences or ~/.config/chromium/Default/Preferences and set this:

    {
       ...
       "enable_referrers": false,
       ...
    }
    

    Or simply add --no-referrers to shortcut or in cli:

    google-chrome --no-referrers
    

    Opera:

    Completely disable: Settings > Preferences > Advanced > Network, and uncheck "Send referrer information"

    Spoofing web service:

    http://referer.us/

    Standalone filtering proxy (spoof any header):

    Privoxy

    Spoofing http_referer when using wget

    ‘--referer=url’

    Spoofing http_referer when using curl

    -e, --referer

    Spoofing http_referer wth telnet

    telnet www.yoursite.com 80 (press return)
    GET /index.html HTTP/1.0 (press return)
    Referer: http://www.hah-hah.com (press return)
    (press return again)
    

提交回复
热议问题