SnortCenter is a PHP based tool for aggregating many snort sensors into one place to make it easy to keep rules and configurations synchronized. A vulnerability causes temporary files to created by the program to be completely predictable, allowing local users to compromise the SnortCenter server.
Credit:
The information has been provided by Clint Byrum.
Vulnerable systems:
* SnortCenter version 0.9.5 and prior
Immune systems:
* SnortCenter version 0.9.6
Upon choosing to "push" the rules out to a particular sensor, a file is created in the temp directory with the same name as the sensor. So, if your sensor is named "hal" and you push the rules out to it, on the web server, a file is created /tmp/hal. With permissions 777. This means that *anyone* with access to the SnortCenter server's /tmp directory could read the sensor configuration files, among other fun /tmp games. Interesting bits in these files include the usernames/passwords/addresses of the alert database servers.
Fix:
Version 0.9.6 has been recently released, and should be upgraded to. Additionally Clint has attached a patch for 0.9.5 that uses a more random name (not sure of the security of php4's tempnam() function), and secure permissions on the file. You can get version 0.9.6 at SnortCenter's home page.
Patch:
--- snortcenter.orig/sensor.inc.php Sat Aug 24 06:26:14 2002
+++ snortcenter/sensor.inc.php Tue Oct 1 13:48:44 2002
@@ -19,6 +19,9 @@
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+
+global $senstmpfnam;
+
function find_interface_pid($id,$db) {
$result = $db->acidExecute("select cmd_line, interface from sensor where id ='$id'");
$myrow = $result->acidFetchRow();
@@ -135,7 +138,7 @@
}
function create_config($sensor_export, $sensor_id, $db) {
-
+global $senstmpfnam;
sync_group($sensor_id,$db);
global $snortcenter_ver;
@@ -145,7 +148,9 @@
$result = $db->acidExecute("select sensor_name from sensor where id='$sensor_id'");
$myrow = $result->acidFetchRow();
$sensor_name = $myrow[0];
- echo "<FONT size=1>";
+ if($sensor_export != 'download') {
+ echo "<FONT size=1>";
+ }
$result_id = $db->acidExecute("SELECT sid from rulechange where sensor_id='$sensor_id'");
while ($myrow = $result_id->acidFetchRow())
{
@@ -155,10 +160,12 @@