GFXVoid Graphic Design Forum

Remove Text Formatting
Loading...

» Online Users: 2,108

0 members and 2,108 guests
No Members online

» Site Navigation

 > FAQ

» Stats

Members: 35,442
Threads: 103,075
Posts: 826,688
Top Poster: cc.RadillacVIII (7,429)
Welcome to our newest member, Lekelindids
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2004
    Location
    Buffalo Grove, Illinois
    Posts
    350

    Default

    This tutorial will teach you how to create a simple and easy redirection script. An example of how to use this script would be Example.cgi?http://www.google.com which would redirect to http://www.google.com

    Code:
    #!/usr/bin/perl
    
    print "Location: $ENV{QUERY_STRING}\n\n";

  2. #2
    Join Date
    Jun 2005
    Posts
    2

    Default

    Do NOT use that code. CGIs are very dangerous if handled without hackers in mind.

    Printing the QUERY_STRING unmodified can trash your entire server or site depending on your permission schemes.

    This is why (do NOT play with this code unless you know what you're doing!):

    http://my-host.com/naive-redirect.cgi?%40%...%2F%60%20%5D%7D

    That will interpret to "@{[ `rm -rf /` ]}" and the "rm" command will be executed on the server your CGI is on. It could also be used for mischief like snooping passwords instead of outright destruction.

    In any CGI, no matter the language (PHP, Perl, Ruby, Java, anything) you must never print user input without checking it. Otherwise you flirt with disaster.

  3. #3
    Join Date
    Jan 2006
    Location
    NY
    Posts
    120

    Default

    seems complicated, what does the print function do anyway?
    -

Similar Threads

  1. i need an image upload script
    By Skyline in forum The Void
    Replies: 4
    Last Post: 02-20-2006, 05:17 PM
  2. Simple Slideshow Script
    By dmeister in forum Other Tutorials
    Replies: 3
    Last Post: 08-05-2005, 05:22 AM
  3. Simple Redirection
    By demo in forum Other Tutorials
    Replies: 3
    Last Post: 07-11-2005, 06:05 PM
  4. Perl: Random Quotes
    By demo in forum Other Tutorials
    Replies: 1
    Last Post: 06-16-2005, 08:37 PM
  5. Perl: Displaying Server Information
    By demo in forum Other Tutorials
    Replies: 1
    Last Post: 03-02-2005, 06:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBadvanced CMPS v4.1.1