X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Fids.cgi;h=011878381bcbfe611eb9e59a5dd6ae1adafb6da9;hp=362e7b38c62dffd4b076bc799a08cd9e4a8d1829;hb=0b09e72214df3d4d62c1a061f1e8866020877017;hpb=f31d3c1f23a4973ace55135d1a2838fe63e8e8d2 diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index 362e7b38c6..011878381b 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -56,7 +56,6 @@ $snortsettings{'ENABLE_SNORT'} = 'off'; $snortsettings{'ENABLE_SNORT_GREEN'} = 'off'; $snortsettings{'ENABLE_SNORT_BLUE'} = 'off'; $snortsettings{'ENABLE_SNORT_ORANGE'} = 'off'; -$snortsettings{'ENABLE_PREPROCESSOR_HTTP_INSPECT'} = 'off'; $snortsettings{'ENABLE_GUARDIAN'} = 'off'; $snortsettings{'GUARDIAN_INTERFACE'} = `cat /var/ipfire/red/iface`; $snortsettings{'GUARDIAN_HOSTGATEWAYBYTE'} = '1'; @@ -65,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'} = ''; @@ -106,23 +104,12 @@ 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 chomp $line; - if ($snortsettings{'ACTION'} eq $Lang::tr{'save'}) { - # Check for preprocessor settings - if ($line =~ /preprocessor http_inspect/) { - # Strip out leading # from rule line - $line =~ s/\# ?//i; - if (($snortsettings{'ENABLE_PREPROCESSOR_HTTP_INSPECT'} eq 'off')) { - $line = "# $line"; - } - } - } - # Check for a line with .rules if ($line =~ /\.rules$/) { # Parse out rule file name @@ -238,7 +225,7 @@ if (-e "/etc/snort/snort.conf") { if (!exists $snortsettings{"SNORT_RULE_$rule"}) { $line = "# $line"; } - + } # Check for rule state @@ -276,9 +263,11 @@ if (-e "/etc/snort/snort.conf") { ####################### End added for snort rules control ################################# if ($snortsettings{'RULES'} eq 'subscripted') { - $url="http://www.snort.org/pub-bin/oinkmaster.cgi/$snortsettings{'OINKCODE'}/snortrules-snapshot-2.6_s.tar.gz"; + $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://www.snort.org/pub-bin/oinkmaster.cgi/$snortsettings{'OINKCODE'}/snortrules-snapshot-2.6.tar.gz"; + $url="http://dl.snort.org/reg-rules/snortrules-snapshot-2.8.tar.gz?oink_code=$snortsettings{'OINKCODE'}"; + #$url="http://www.snort.org/pub-bin/oinkmaster.cgi/$snortsettings{'OINKCODE'}/snortrules-snapshot-2.8.tar.gz"; } else { $url="http://www.snort.org/pub-bin/downloads.cgi/Download/comm_rules/Community-Rules-CURRENT.tar.gz"; } @@ -295,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"); @@ -319,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"); @@ -331,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 <&1`; @@ -384,9 +373,6 @@ $checked{'ENABLE_SNORT_BLUE'}{$snortsettings{'ENABLE_SNORT_BLUE'}} = "checked='c $checked{'ENABLE_SNORT_ORANGE'}{'off'} = ''; $checked{'ENABLE_SNORT_ORANGE'}{'on'} = ''; $checked{'ENABLE_SNORT_ORANGE'}{$snortsettings{'ENABLE_SNORT_ORANGE'}} = "checked='checked'"; -$checked{'ENABLE_PREPROCESSOR_HTTP_INSPECT'}{'off'} = ''; -$checked{'ENABLE_PREPROCESSOR_HTTP_INSPECT'}{'on'} = ''; -$checked{'ENABLE_PREPROCESSOR_HTTP_INSPECT'}{$snortsettings{'ENABLE_PREPROCESSOR_HTTP_INSPECT'}} = "checked='checked'"; $checked{'ENABLE_GUARDIAN'}{'off'} = ''; $checked{'ENABLE_GUARDIAN'}{'on'} = ''; $checked{'ENABLE_GUARDIAN'}{$snortsettings{'ENABLE_GUARDIAN'}} = "checked='checked'"; @@ -401,7 +387,7 @@ $selected{'RULES'}{$snortsettings{'RULES'}} = "selected='selected'"; ####################### Added for snort rules control ################################# print ""; print < +