$input_errors[] = gettext("Only aliases are allowed for the FTP Protocol BOUNCE-TO ADDRESS option."); } if ($_POST['ftp_client_bounce_to_port'] && !is_alias($_POST['ftp_client_bounce_to_port'])) { $input_errors[] = gettext("Only aliases are allowed for the FTP Protocol BOUNCE-TO PORT option."); } if ($_POST['ftp_client_bounce_to_net'] && empty($_POST['ftp_client_bounce_to_port'])) { $input_errors[] = gettext("FTP Protocol BOUNCE-TO PORT cannot be empty when BOUNCE-TO ADDRESS is set."); } if ($_POST['ftp_client_bounce_to_port'] && empty($_POST['ftp_client_bounce_to_net'])) { $input_errors[] = gettext("FTP Protocol BOUNCE-TO ADDRESS cannot be empty when BOUNCE-TO PORT is set."); } // Validate the BOUNCE-TO Alias entries for correct format of their defined values. BOUNCE-TO ADDRESS must be // a valid single IP, and BOUNCE-TO PORT must be either a single port value or a port range value. Provide // detailed error messages for the user that explain any problems. if ($_POST['ftp_client_bounce_to_net'] && $_POST['ftp_client_bounce_to_port']) { if (!snort_is_single_addr_alias($_POST['ftp_client_bounce_to_net'])) { $net = trim(filter_expand_alias($_POST['ftp_client_bounce_to_net'])); $net = preg_replace('/\\s+/', ',', $net); $msg = gettext("The FTP Protocol BOUNCE-TO ADDRESS parameter must be a single IP network or address, "); $msg .= gettext("so the supplied Alias must be defined as a single address or network in CIDR form. "); $msg .= gettext("The Alias [ {$_POST['ftp_client_bounce_to_net']} ] is currently defined as [ {$net} ]."); $input_errors[] = $msg; } $port = trim(filter_expand_alias($_POST['ftp_client_bounce_to_port'])); $port = preg_replace('/\\s+/', ',', $port); if (!is_port($port) && !is_portrange($port)) { $msg = gettext("The FTP Protocol BOUNCE-TO PORT parameter must be a single port or port-range, "); $msg .= gettext("so the supplied Alias must be defined as a single port or port-range value. "); $msg .= gettext("The Alias [ {$_POST['ftp_client_bounce_to_port']} ] is currently defined as [ {$port} ]."); $input_errors[] = $msg; }
if ($v['bounce'] == "yes") { if (is_alias($v['bounce_to_net']) && is_alias($v['bounce_to_port'])) { $net = trim(filter_expand_alias($v['bounce_to_net'])); $port = trim(filter_expand_alias($v['bounce_to_port'])); if (!empty($net) && !empty($port) && snort_is_single_addr_alias($v['bounce_to_net']) && (is_port($port) || is_portrange($port))) { $port = preg_replace('/\\s+/', ',', $port); // Change port range delimiter to comma for ftp_telnet client preprocessor if (is_portrange($port)) { $port = str_replace(":", ",", $port); } $buffer .= "\tbounce yes \\\n"; $buffer .= "\tbounce_to { {$net},{$port} }\n"; } else { // One or both of the BOUNCE_TO alias values is not right, // so figure out which and log an appropriate error. if (empty($net) || !snort_is_single_addr_alias($v['bounce_to_net'])) { log_error("[snort] ERROR: illegal value for bounce_to Address Alias [{$v['bounce_to_net']}] for FTP client engine [{$v['name']}] ... omitting 'bounce_to' option for this client engine."); } if (empty($port) || !(is_port($port) || is_portrange($port))) { log_error("[snort] ERROR: illegal value for bounce_to Port Alias [{$v['bounce_to_port']}] for FTP client engine [{$v['name']}] ... omitting 'bounce_to' option for this client engine."); } $buffer .= "\tbounce yes\n"; } } else { $buffer .= "\tbounce yes\n"; } } else { $buffer .= "\tbounce no\n"; } // Add this FTP client engine to the master string $ftp_client_engine .= "{$buffer}\n";
</th> </tr> </thead> <tbody> <?php $i = 0; foreach ($a_aliases as $alias) { ?> <?php if ($alias['type'] != "host" && $alias['type'] != "network") { continue; } if (isset($used[$alias['name']])) { continue; } if (!$multi_ip && !snort_is_single_addr_alias($alias['name'])) { $textss = "<span class=\"gray\">"; $textse = "</span>"; $disable = true; $tooltip = gettext("Aliases resolving to multiple addresses cannot be used with the '{$eng}'."); } elseif (trim(filter_expand_alias($alias['name'])) == "") { $textss = "<span class=\"gray\">"; $textse = "</span>"; $disable = true; $tooltip = gettext("Aliases representing a FQDN host cannot be used in Snort preprocessor configurations."); } else { $textss = ""; $textse = ""; $disable = ""; $selectablealias = true; $tooltip = gettext("Selected entries will be imported. Click to toggle selection of this entry.");
<th class="listhdrr" axis="string"><?php echo gettext("Description"); ?> </th> </tr> </thead> <tbody> <?php $i = 0; foreach ($a_aliases as $alias) { ?> <?php if (!in_array($alias['type'], $a_types)) { continue; } if (($alias['type'] == "network" || $alias['type'] == "host") && $multi_ip != "yes" && !snort_is_single_addr_alias($alias['name'])) { $textss = "<span class=\"gray\">"; $textse = "</span>"; $disable = true; $tooltip = gettext("Aliases resolving to multiple address entries cannot be used with the destination target."); } elseif (($alias['type'] == "network" || $alias['type'] == "host") && trim(filter_expand_alias($alias['name'])) == "") { $textss = "<span class=\"gray\">"; $textse = "</span>"; $disable = true; $tooltip = gettext("Aliases representing a FQDN host cannot be used in Snort preprocessor configurations."); } else { $textss = ""; $textse = ""; $disable = ""; $selectablealias = true; $tooltip = gettext("Selected entry will be imported. Click to toggle selection.");
unset($_SESSION['org_referer']); unset($_SESSION['org_querystr']); unset($_SESSION['stream5_client_import']); session_write_close(); /* Grab all the POST values and save in new temp array */ $engine = array(); if ($_POST['stream5_name']) { $engine['name'] = trim($_POST['stream5_name']); } else { $engine['name'] = "default"; } /* Validate input values before saving */ if ($_POST['stream5_bind_to']) { if (is_alias($_POST['stream5_bind_to'])) { $engine['bind_to'] = $_POST['stream5_bind_to']; if (!snort_is_single_addr_alias($_POST['stream5_bind_to'])) { $input_errors[] = gettext("An Alias that evaluates to a single IP address or CIDR network is required for the 'Bind-To IP Address' value."); } } elseif (strtolower(trim($_POST['stream5_bind_to'])) == "all") { $engine['bind_to'] = "all"; } else { $input_errors[] = gettext("You must provide a valid Alias or the reserved keyword 'all' for the 'Bind-To IP Address' value."); } } else { $input_errors[] = gettext("The 'Bind-To IP Address' value cannot be blank. Provide a valid Alias or the reserved keyword 'all'."); } if ($_POST['stream5_ports_client']) { if (is_alias($_POST['stream5_ports_client'])) { $engine['ports_client'] = $_POST['stream5_ports_client']; } elseif (strtolower(trim($_POST['stream5_ports_client'])) == "default") { $engine['ports_client'] = "default";