For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > February 2006 > Preventing unauthorized use of a CGI script









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Preventing unauthorized use of a CGI script
David Gilden

2006-02-08, 8:53 am

Greetings,

Just wanted hear opinions on how effective this is, as way of preventing em=
ail relaying stoping=20
unauthorized use my script.

This from a script that connects a <form> page to sendmail....

#!/usr/bin/perl=20

use CGI qw/:standard/;

#..snip..

my $referer =3D referer; # what page called the script, check the domain
exit if $referer =3D ($referer !~ /www\.mydomain\.com/i);

#..more code below etc...


If somebody from a foreign domain trys to invoke my script it should exit w=
ith out a trace.
Yes?

Thanks,

Dave Gilden


Visit my schedule page for up to the minute performance info:
<http://www.coraconnection.com/cgi-bin/schedule.pl>

Endorsing Artist for the Moog Music:
<http://www.moogmusic.com/artists.html?cat_id=3D25>

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D
Cora Connection: Your West African Music Source
Resources, Recordings, Instruments & More!
<http://www.coraconnection.com/>=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com