Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
P is for Practical
 
PerlMonks  

HTTP_REFERER "control"

by freak (Initiate)
on May 09, 2004 at 11:08 UTC ( [id://351842]=perlquestion: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.

freak has asked for the wisdom of the Perl Monks concerning the following question:

when i connect to a website, can i "control" the HTTP_REFERER ? by that i mean - if can i send the website i connect to some specific HTTP_REFERER message (so that the website will see as if i entered it through another website) ? and if i can do that, please tell me how.

Replies are listed 'Best First'.
Re: HTTP_REFERER "control"
by jeffa (Bishop) on May 09, 2004 at 11:20 UTC

    Hello freak. The word "on the street" is that you are trying to write code that will do BAD THINGS. Such as using a bot to submit to a website to produce bogus "hits".

    Before we answer any more of your questions, would you mind answering one of mine? What exactly are you trying to do? And by that i don't mean repeat your question. I mean "what are you building and what is it going to do?"

    Thank you.

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
      i want to build a bot that will "earn" on popups. and now can somebody please answer my question.

        Care to tell us for which advertising site and which site you are using this for? I'm sure I'm not the only one who would like to alert the advertising company of what you are doing. It's called fraud. Stop it. "Earn" your popups the proper way or don't earn at all. And don't post any more questions about this. I wish people would stop submitting proper answers to you. I wish even more that your nodes would start to be reaped.

Re: HTTP_REFERER "control"
by AltBlue (Chaplain) on May 09, 2004 at 11:21 UTC
    "Referer" is just another HTTP Request header :)
    Just add this header with the value you want to your request and that's all.

    UPDATE: jeffa requested to drop the example code as freak's history here isn't good at all ;)
    Anyway, I'm sure googling for lwp referer would be (too) easy to get the answer he wants :(

Re: HTTP_REFERER "control"
by b10m (Vicar) on May 09, 2004 at 11:22 UTC

    Yet another question which shows you really need to read up on LWP and HTTP headers in general. It's all there ;-) But ok, a quick'n'dirty example:

    use LWP::UserAgent; my $ua = LWP::UserAgent->new(); my $req = HTTP::Request->new( GET => $url ); $req->header(REFERER => "http://faked.referer.invalid"); $ua->request($req);
    --
    b10m

    All code is usually tested, but rarely trusted.
      but will it show ME that i've connected from a "referer", or will it tell the web-server that i've connected to it fron a "referer" ?

        Like I stated (many times before). Please read up on HTTP requests (headers) and the usage of LWP. If you want people to write scripts for you, post your requests at some other website like http://jobs.perl.org/. People there could help you out.

        --
        b10m

        All code is usually tested, but rarely trusted.
Re: HTTP_REFERER "control"
by blue_cowdawg (Monsignor) on May 09, 2004 at 11:30 UTC

        when i connect to a website, can i "control" the HTTP_REFERER ?

    Could you possibly be any more blatant? At face value your own words would indicate you are attempting to commit fraud. I'm sorry... if you aren't knowledgeable enough to do it on your own I am not going to help you commit fraud.

    I guess you like downvotes freak, eh?

      Although I don't trust freak's intentions, commiting "fraud" can be rather fun too.

      http://www.goto.com/ used to have links that would cost the webpage owner money for each "click". It even had the amount of dollars listed. Now how fun is it to "click" on those links that would bring you to spammer related software? *serpent grin*. LWP is/was perfect for that. Fraudulent, but very nice IMHO.

      --
      b10m

      All code is usually tested, but rarely trusted.

            commiting "fraud" can be rather fun too.

        There is fraud and then there is "screwing with somebody". While the former gets my "Irish up" the latter can be a fine way to spend some quality time. As long as it does not take on criminal dimensions.

      i was just kidding on the popup subject, i'm just testing my website. so i just want to know if the early code on this page will show ME that i've connected from a "referer", or will it tell the web-server that i've connected to it fron a "referer" ?

        No, you are not kidding. We all know that. Give it up already. What use could you possibly have to just want to know if the early code on this page will show ME that i've connected from a "referer"? I don't believe you. Convince me and a few dozen others around here that you're telling the truth. All evidence so far points to the fact that you were telling the truth about the bot.

        If you're testing with your own website, why not just try it, and find out ? .. The best way to learn how things work, is to try them!

        C.

      You are attempting to commit fraud.
      That's quite a serious allegation. In some jurisdictions, such an allegation could be seen as slander. For something to be fraud, you must break a law. I don't know of any jurisdiction that says anything about the content of HTTP headers. I guess you think that anyone who uses LWP::UserAgent, and have it send requests with a User-Agent header that contains "Mozilla" or "MSIE" commits fraud as well? Perhaps Gisle Aas is a terrorist for making software available which makes it easy to falsify User-Agent or Referer headers?

      Abigail

        I find it sickly amusing that in the same breath you can defend the freedom to earn money by lying (which is, regardless of your opinion, fraudulent) and try to threaten somebody (implicitly, if not explicitly) for speaking an obvious truth. Especially delicious that you try to paint blue_cowdawg as the repressive restricter of speech freedoms for... speaking.

        I would ask what jurisdiction could possibly take blue_cowdawg's statement of opinion as libelous, if only to make sure I never moved there, but I've wasted enough time on this post already.



        If God had meant us to fly, he would *never* have given us the railroads.
            --Michael Flanders

Re: HTTP_REFERER "control"
by perrin (Chancellor) on May 09, 2004 at 12:32 UTC
    freak, the bottom line is, you will be traceable. If someone really wants to find out who has been ripping them off on their popup ads, and is willing to put some effort into it, they will be able to trace it to you, no matter what you do. You could make it somewhat difficult for them, but that would require you to actually make an effort to learn some things about the Internet, HTTP, TCP/IP, and various security systems, which you seem to be totally unwilling to do. If you attempt to rip off some site with your current level of knowledge, you might as well just mail your name and address to the FBI.
Re: HTTP_REFERER "control"
by Juerd (Abbot) on May 09, 2004 at 16:00 UTC

    If you have to ask, the answer is: no, you cannot.

    Please become a real hacker instead of the pathetic kind you're trying to be. Note that I'm talking about "a person who enjoys exploring the details of programmable systems and how to stretch their capabilities, as opposed to most users, who prefer to learn only the minimum necessary," not about "someone who plays golf poorly" :).

    You want to learn only the minimum necessary, and you want to learn the little that you do for the wrong reasons.

Mr. Webster if you will be so kind...
by Mr. Muskrat (Canon) on May 09, 2004 at 16:17 UTC

    earn
          2. To acquire by labor, service, or performance; to deserve
          and receive as compensation or wages; as, to earn a good
          living; to earn honors or laurels.

    fraud
          2. (Law) An intentional perversion of truth for the purpose
          of obtaining some valuable thing or promise from another.

    Source: Webster's Revised Unabridged Dictionary (1913)

Re: HTTP_REFERER "control"
by flyingmoose (Priest) on May 10, 2004 at 12:06 UTC
    freak, you are screwing up dude. You don't mean "earn popups", you mean "3@R|\| popups" or perhaps "0WNZZ0R popups". Read the script kiddie book again, and come back in 2 weeks.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://351842]
Approved by castaway
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.