|
To access the contents, click the chapter and section titles.
Platinum Edition Using HTML 4, XML, and Java 1.2
Using Others CGI ScriptsOn the Web, many helpful archives of CGI scripts are availableeach stuffed with dozens of useful, valuable programsall free for the taking. But before you start haphazardly downloading all these gems and blindly installing them on your server, you should pause and consider a few things:
If the answer to either question is no, you could be opening yourself up to a huge con game, doing the hackers work for him by installing a potentially dangerous CGI program on your own server. Its like bringing a bomb into your house because you thought it was a blender. These Trojan horse scriptsso named because they contain hidden dangersmight be wonderful time savers, doing exactly what you need and functioning perfectly, until a certain time is reached or a certain signal is received. Then, they will spin out of your control and execute planned behavior that can range from the silly to the disastrous. Examining External Source CodeBefore installing a CGI program that you didnt write, you should take care to examine it closely for any potential dangers. If you dont know the language of the script or if its style is confusing, you might be better off looking for a different solution. Look, for example, at this Perl fragment: system(cat /etc/passwd) if ($ENV{PATH_INFO} eq /send/passwd); This single line of code can be hidden among thousands of others, waiting for its author or any surfer to enter the secret words that cause it to send him your password file. If your knowledge of Perl is shaky, if you didnt take the time to completely review the script before installing it, or if a friend assured you that hes running the script with no problems, you can accidentally open your site to a huge security breachone that you may not know about. The most dangerous Trojan horses wont even let you know that theyve gone about their work. They will continue to work correctly, silently sabotaging all your sites security. Guarding Against Precompiled C CGI ScriptsOccasionally, you may find precompiled C CGI scripts on the Web. These are even more dangerous than prewritten programs that include the source. Because precompiled programs dont give you any way of discovering whats actually going on, their payload can be much more complex and much more dangerous. A precompiled program, for instance, might take the effort not only to lie in wait for some hidden trigger, but also to inform the hackercumauthor where you installed it! A cleverly written CGI program might mail its author information about your machine and its users every time the script is run, and you would never know because all that complexity is safely out of sight behind the precompiled executable. Reviewing CGI Library ScriptsFull-blown CGI scripts arent the only code that can be dangerous when downloaded off the Web. Dozens of handy CGI libraries are available as well, and they pose the same risks as full programs. If you never bother to look at what each library function does, you might end up writing the program that breaks your sites security. All a hacker needs is for you to execute one line of code that he wrote, and youve allowed him entry. You should reviewand be sure that you understandevery line of code that will execute on your server as a CGI script. Remember, always look a gift horse in the mouth!
|
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement. |