]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/ids.cgi
Add urlfilter.cgi to core37.
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / ids.cgi
index 52ca549811addd9f077a2eebc5f629c8fb054173..011878381bcbfe611eb9e59a5dd6ae1adafb6da9 100644 (file)
@@ -64,7 +64,6 @@ $snortsettings{'GUARDIAN_ALERTFILE'} = '/var/log/snort/alert';
 $snortsettings{'GUARDIAN_IGNOREFILE'} = '/var/ipfire/guardian/guardian.ignore';
 $snortsettings{'GUARDIAN_TARGETFILE'} = '/var/ipfire/guardian/guardian.target';
 $snortsettings{'GUARDIAN_TIMELIMIT'} = '86400';
-$snortsettings{'GUARDIAN_IGNOREFILE_CONTENT'} = `cat $snortsettings{'GUARDIAN_IGNOREFILE'}`;
 $snortsettings{'ACTION'} = '';
 $snortsettings{'ACTION2'} = '';
 $snortsettings{'RULES'} = '';
@@ -105,7 +104,7 @@ if (-e "/etc/snort/snort.conf") {
     if ( $temp =~ /$_/ ){next;}
     else { push(@snortconfig,"#include \$RULE_PATH/".$_);}
        }
-       
+
        # Loop over each line
        foreach my $line (@snortconfig) {
                # Trim the line
@@ -226,7 +225,7 @@ if (-e "/etc/snort/snort.conf") {
                                if (!exists $snortsettings{"SNORT_RULE_$rule"}) {
                                        $line = "# $line";
                                }
-                               
+
                        }
 
                        # Check for rule state
@@ -264,7 +263,7 @@ if (-e "/etc/snort/snort.conf") {
 #######################  End added for snort rules control  #################################
 
 if ($snortsettings{'RULES'} eq 'subscripted') {
-       $url="http://dl.snort.org/reg-rules/snortrules-snapshot-2.8_s.tar.gz?oink_code=$snortsettings{'OINKCODE'}";
+       $url="http://dl.snort.org/sub-rules/snortrules-snapshot-2.8_s.tar.gz?oink_code=$snortsettings{'OINKCODE'}";
        #$url="http://www.snort.org/pub-bin/oinkmaster.cgi/$snortsettings{'OINKCODE'}/snortrules-snapshot-2.8_s.tar.gz";
 } elsif ($snortsettings{'RULES'} eq 'registered') {
        $url="http://dl.snort.org/reg-rules/snortrules-snapshot-2.8.tar.gz?oink_code=$snortsettings{'OINKCODE'}";
@@ -285,19 +284,19 @@ if ($snortsettings{'ACTION'} eq $Lang::tr{'save'} && $snortsettings{'ACTION2'} e
                system ('/usr/bin/touch', "${General::swroot}/snort/enable");
        } else {
                unlink "${General::swroot}/snort/enable";
-       } 
+       }
        if ($snortsettings{'ENABLE_SNORT_GREEN'} eq 'on')
        {
                system ('/usr/bin/touch', "${General::swroot}/snort/enable_green");
        } else {
                unlink "${General::swroot}/snort/enable_green";
-       } 
+       }
        if ($snortsettings{'ENABLE_SNORT_BLUE'} eq 'on')
        {
                system ('/usr/bin/touch', "${General::swroot}/snort/enable_blue");
        } else {
                unlink "${General::swroot}/snort/enable_blue";
-       } 
+       }
        if ($snortsettings{'ENABLE_SNORT_ORANGE'} eq 'on')
        {
                system ('/usr/bin/touch', "${General::swroot}/snort/enable_orange");
@@ -309,7 +308,7 @@ if ($snortsettings{'ACTION'} eq $Lang::tr{'save'} && $snortsettings{'ACTION2'} e
                system ('/usr/bin/touch', "${General::swroot}/snort/enable_preprocessor_http_inspect");
        } else {
                unlink "${General::swroot}/snort/enable_preprocessor_http_inspect";
-       }               
+       }
        if ($snortsettings{'ENABLE_GUARDIAN'} eq 'on')
        {
                system ('/usr/bin/touch', "${General::swroot}/guardian/enable");
@@ -321,7 +320,7 @@ if ($snortsettings{'ACTION'} eq $Lang::tr{'save'} && $snortsettings{'ACTION2'} e
 
 } elsif ($snortsettings{'ACTION'} eq $Lang::tr{'save'} && $snortsettings{'ACTION2'} eq "guardian" ){
                        open(IGNOREFILE, ">$snortsettings{'GUARDIAN_IGNOREFILE'}") or die "Unable to write guardian ignore file $snortsettings{'GUARDIAN_IGNOREFILE'}";
-                               print IGNOREFILE $snortsettings{'GUARDIAN_IGNOREFILE_CONTENT'};
+                               print IGNOREFILE $snortsettings{'IGNOREFILE_CONTENT'};
                        close(IGNOREFILE);
                        open(GUARDIAN, ">/var/ipfire/guardian/guardian.conf") or die "Unable to write guardian conf /var/ipfire/guardian/guardian.conf";
                                print GUARDIAN <<END
@@ -388,7 +387,7 @@ $selected{'RULES'}{$snortsettings{'RULES'}} = "selected='selected'";
 ####################### Added for snort rules control #################################
 print "<SCRIPT LANGUAGE='JavaScript' SRC='/include/snortupdateutility.js'></SCRIPT>";
 print <<END
-<STYLE TYPE="text/css">   
+<STYLE TYPE="text/css">
 <!--
 .section {
        border: groove;
@@ -456,9 +455,8 @@ print <<END
 </tr>
 <tr>
        <td><br />
-               $Lang::tr{'ids rules license'} <a href='http://www.snort.org/' target='_blank'>http://www.snort.org</a>.<br />
-               <br />
-               $Lang::tr{'ids rules license2'} <a href='http://www.snort.org/reg-bin/userprefs.cgi' target='_blank'>USER PREFERENCES</a>, $Lang::tr{'ids rules license3'}<br />
+               $Lang::tr{'ids rules license'} <a href='https://www.snort.org/signup' target='_blank'>www.snort.org</a>$Lang::tr{'ids rules license1'}<br /><br />
+               $Lang::tr{'ids rules license2'} <a href='https://www.snort.org/account/oinkcode' target='_blank'>Get an Oinkcode</a>, $Lang::tr{'ids rules license3'}
        </td>
 </tr>
 <tr>
@@ -529,7 +527,7 @@ if ( -e "${General::swroot}/snort/enable" || -e "${General::swroot}/snort/enable
        &Header::openbox('100%', 'LEFT', $Lang::tr{'intrusion detection system rules'});
                # Output display table for rule files
                print "<TABLE width='100%'><TR><TD VALIGN='TOP'><TABLE>";
-               
+
                print "<form method='post'>";
 
                # Local vars
@@ -641,7 +639,7 @@ if ( -e "${General::swroot}/snort/enable" || -e "${General::swroot}/snort/enable
                                        # Increment count
                                        $ruledefdisplaycnt++;
                                }
-       
+
                                # If do not have second rule for row, create empty cell
                                if (($ruledefdisplaycnt % 2) != 0) {
                                        print "<TD CLASS='base'></TD>";
@@ -700,10 +698,8 @@ sub getmd5 {
                syswrite ($fh, $md5buf->content);
                close($fh);
        }
-       
-       my @temp=split(/= /,$md5buf->content);
-       
-       return $temp[1];
+
+       return $md5buf->content;
 }
 sub downloadrulesfile {
        my $return = &geturl($url);