Results 1 to 10 of 10

Thread: Fake a HTTP referrer

  1. #1
    j2k
    Guest

    Fake a HTTP referrer

    Hi,

    Is it possible to send a form as normal, but fake it's referrer URL?

    I have a script, however it must be called from a specific server. Is there a way to overcome this? If I submit the form via the file on my hard drive, as the HTTP referrer doesn't match, an error is produced.

    I was thinking maybe use JavaScript or something?

    TIA.

  2. #2
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    i don't think that you can altar it. that would probably get a lot of people mad, because just about any website could steal their scripts.

    perhaps what you could do, is store what the referrer is in a text file, and then include it. that way you can easily change it when you move it from your HD to your site.

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  3. #3
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Yes, you can fake the referrer, cookies, user agent, or anything. Just use telnet to connect to a server and manually type the HTTP commands.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  4. #4
    j2k
    Guest
    Hmm. Thanks for that JoshT. Do you have any source, perhaps in Visual Basic to do that? As in connect to a server, and post a form, faking the referrer?

    Thanks.

  5. #5
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    I don't have any decent code handy, but use your favorite language to content to a webserver and send the following (note newlines, and my HTTP might be a little off).

    Code:
    POST /somepage.cgi HTTP/1.0
    Referer: http://www.microsoft.com/penguin.html
    Content-length: (length of form data goes here)
    
    field1=value1&field2=value2
    And referer is supposed to be misspelled.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  6. #6
    j2k
    Guest
    JoshT,

    I tried it your way, but I get 'Bad Request'. If I spell it 'referrer', there is no error, but the script does not work.

    Please help

  7. #7
    j2k
    Guest
    EDIT: Now it works with 'referer' but it still doesn't execute.

  8. #8
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Hmm. Try a simpler request and see if you have any problems:
    Code:
    HEAD / HTTP/1.0
    (then 2 newlines / enters)
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  9. #9
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Also, whatever number you put for Content-length, the server won't send a response until you've sent it that much data.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  10. #10
    j2k
    Guest
    JoshT!

    The Content-length wasn't right!! It now works! THANKS!

Posting Permissions

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



Click Here to Expand Forum to Full Width