home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 2002 November / SGI IRIX 6.5 Applications 2002 November.iso / dist / gateway.idb / usr / WebFace / Tasks / security-fourth.cgi.z / security-fourth.cgi
Encoding:
Text File  |  2002-06-12  |  4.8 KB  |  150 lines

  1. #!/usr/bin/perl5
  2. #
  3. # security-fourth.cgi
  4. #
  5. # Copyright 1988-1996 Silicon Graphics, Inc.
  6. # All rights reserved.
  7. #
  8. # This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  9. # the contents of this file may not be disclosed to fourth parties, copied or
  10. # duplicated in any form, in whole or in part, without the prior written
  11. # permission of Silicon Graphics, Inc.
  12. #
  13. # RESTRICTED RIGHTS LEGEND:
  14. # Use, duplication or disclosure by the Government is subject to restrictions
  15. # as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  16. # and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  17. # successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  18. # rights reserved under the Copyright Laws of the United States.
  19. #
  20.  
  21. require "/usr/OnRamp/lib/OnRamp.pm";
  22.  
  23. if (!$ARGV[0]) { printf("Location: %s%c%c","/tasks/Tasks.security-start.cgi",10,10); exit; }
  24.  
  25. $temp = "task.tmp4";
  26. $action = "security-fourth.cgi?loop";
  27. $go = "/tasks/security-end.cgi?f";
  28.  
  29. $it = "<td><font size=5><i>";
  30. $ni = "</i></font></td>";
  31.  
  32. &get_fields;
  33.  
  34. if ($ARGV[0] eq loop) {
  35.         &writeFile;
  36.  
  37.         # printf("Location: %s%c%c",$go,10,10);
  38.         print "Content-type: text/html\n\n";
  39.         print "<HTML><HEAD>";
  40.         print "<META HTTP-EQUIV=\"refresh\" CONTENT=\"0; URL=$go\">";
  41.         print "</HEAD><BODY></BODY></HTML>";
  42.         exit 0;
  43. }
  44.  
  45. &generic;
  46.  
  47. sub writeFile {
  48.     open(OUT, "> $temp");
  49.  
  50.     if ($fld{'get'}) { print OUT "get:yes\n"; }
  51.     else { print OUT "get:no\n"; }
  52.  
  53.     if ($fld{'set'}) { print OUT "set:yes\n"; }       
  54.         else { print OUT "set:no\n"; }       
  55.     
  56.     if ($fld{'daemon'}) { print OUT "daemon:yes\n"; }       
  57.         else { print OUT "daemon:no\n"; }       
  58.     
  59.         close(OUT);
  60. }
  61.  
  62. sub generic {
  63.     print "Content-type: text/html\n\n";
  64.     print "<html><title>Security Setup (continued)</title>\n";
  65.  
  66.     print "<script language=\"JavaScript\">\n<!--\n";
  67.  
  68.     # JavaScript
  69. print "function Next()  {
  70.     form = document.page4;
  71.     setTimeout('form.submit()',0);
  72.     return;
  73. }
  74. function Previous()  {
  75.     setTimeout('window.location=\"/tasks/security-third.cgi?f\"',0);
  76.     return;
  77. }
  78. ";
  79.  
  80.     print "//-->\n";
  81.     print "</script></head>\n\n";
  82.  
  83.     print "<body bgcolor=\'a7b4ce\' background=/tasks/security-task.bg.gif>\n";
  84.  
  85.     print "<table width=100%>",
  86.           "<tr><th align=left><h1>Security Setup (continued)</h1></th>\n",
  87.           "<th align=right><a href=\"/newsplash.shtml\">",
  88.           "<img height=55 width=57 border=0 src=/tasks/home.gif></a>\n",
  89.           "  <a href=\"Tasks.shtml\">",
  90.           "<img height=55 width=57 border=0 src=/tasks/back.gif></a>",
  91.           "</tr></table>\n";
  92.  
  93.     printf("\n<form name=\"page4\" action=\"%s\" method=post>\n", $action);
  94.     
  95.     print "<center><table width=620>\n";
  96.  
  97.     print "<tr>$it Network management: <br>$ni</tr>\n";
  98.     print "<tr><td>
  99.         The Simple Network Management Protocol (SNMP) allows a system
  100.         administrator on a remote machine to obtain information about
  101.         your server and local network.  In some cases it may also be 
  102.         possible to set configuration parameters.  
  103.  
  104.         By default, your server allows unlimited read access through the
  105.         SNMP protocol.  However, this creates a security risk to the 
  106.         Internet Gateway server.   You can protect your server by 
  107.         disallowing all SNMP privileges and/or disabling the SNMP daemon.",
  108.         
  109.         "</td></tr></table>\n\n";
  110.  
  111.     print "<table width=620>\n";
  112.     print "<tr><td> 
  113.          Select the security protection items below to enable or disable
  114.          them. A red check mark indicates that protection is enabled.",
  115.          "</td></tr></table>\n\n"; 
  116.     
  117.     print "<table width=320>\n";
  118.  
  119.     print "<tr><td align=center><input type=checkbox name=set checked ",
  120.           "value=1></td><td colspan=2><strong>Disallow SNMP write privileges</strong></td>",
  121.           "</tr>\n"; 
  122.  
  123.     print "<tr><td align=center><input type=checkbox name=get ",
  124.           "value=1></td><td colspan=2><strong>Disallow SNMP read privileges</strong></td>",
  125.           "</tr>\n"; 
  126.  
  127.     print "<tr><td align=center><input type=checkbox name=daemon ",
  128.           "value=1></td><td colspan=2><strong>Disable SNMP daemon</strong></td>",
  129.           "</tr>\n"; 
  130.  
  131.     print "</table></center>\n\n";
  132.  
  133.    print '<MAP NAME="js_map1">',
  134.     '    <AREA SHAPE="rect" COORDS="0,0,59,52" HREF="javascript:Previous()"
  135.     onMouseOver="window.status=\'\';return true">',
  136.     '</MAP>';
  137.     print "\n";
  138.     print '<MAP NAME="js_map2">',
  139.     '    <AREA SHAPE="rect" COORDS="0,0,59,52" HREF="javascript:Next()"
  140.     onMouseOver="window.status=\'\';return true">',
  141.     '</MAP>';
  142.     print "\n";
  143.     print '<IMG SRC="/tasks/rightarrow.gif" BORDER=0 USEMAP="#js_map2" align="right">';
  144.     print "\n";
  145.     print '<IMG SRC="/tasks/leftarrow.gif" BORDER=0 USEMAP="#js_map1" align="right">';
  146.  
  147.     print "\n</form></body></html>";
  148. }
  149.  
  150.