Location: PHPKode > projects > YASeMI > yasemi_0.1/settings.php
<?php

	// INCLUDE VARIOUS SCRIPTS
	include 'gs/dbc.php';
	include 'gs/page.php';
	
	session_start();
	
	if (!isset($_SESSION["error"])) $_SESSION["error"] = null;
	
?>

<html>
<head>
<title>Settings - YASeMI</title>

<? showmain('pics/','gs/','css_styles/','reports/',''); ?>

<div class="maindiv">
<span style="font-size: 30px;">Settings</span><br><br>
<div style="background:#AFBDFC;border:1px dotted #8C90CC;padding:10px;">
<span style="text-decoration:underline;font-size: 16px;"><strong>Subnets & Hosts</strong></span><br><br>
<strong>Subnets:</strong><br>

<?php

	// CONNECT TO THE DATABASE
	$link_id = db_connect();
	
	// SELECT THE STORED SUBNETS
	$query = "SELECT settings_subnet, settings_id FROM settings WHERE settings_subnet <> ''";
	
	// EXECUTES THE QUERY
	$result = mysql_query($query) or die(mysql_error().'<br> SQL:'.$query);
	
	echo '<table>';	
	while ($row = mysql_fetch_row($result)) 
		echo '<form name="delsubnet" method="post" action="gs/delete_subnet.php?settings_id='.$row[1].'">
			  <tr><td style="width:100px;">'.$row[0].'</td><td><input name="submit" type="submit" value="Delete"></td></tr>
			  </form>';
	echo '</table>';
?>

<br>
<strong>Number of Hosts:</strong>

<?php

	// SELECT THE STORED NUMBER OF HOSTS
	$query = "SELECT settings_nohosts FROM settings WHERE settings_id = 1";
	
	// EXECUTES THE QUERY
	$result = mysql_query($query) or die(mysql_error().'<br> SQL:'.$query);

	$row = mysql_fetch_row($result);

	echo '<table>
		  <form name="counthosts" method="post" action="gs/host_count.php"><tr><td style="width:100px;">'.$row[0].'</td><td>
		  <input name="submit" type="submit" value="Count Hosts"></td></tr>
		  </form>
		  </table>
		  <br>Remember to recount your hosts after inserting a new subnet
		  <br><br>';
?>
		  <form name="subnet" method="post" action="gs/insert_subnet.php">
			<strong>Insert Subnet</strong><br>
			Type the subnet you want to insert. The subnet must be one in the range of 192.168.x, 10.x.x and 172.16.x to 172.31.x<br>
			At this point the subnets are assumed to have a network mask of 255.255.255.0<br>
			When you declare the subnet give only the network part of the IP address as given in the example above<br><br>
			<?php echo $_SESSION["error"];$_SESSION["error"] = ''; ?>
			<input name="subnet" type="text" size="14" maxlength="11"><br>
			<input name="submit" type="submit" value="Insert">
		  </form>
		  </div><br>
	
	
<?php	
	
	// SELECT THE STORED THRESHOLD FOR PORT SCANS AND TOP N
	$query = "SELECT settings_vps_intrv, settings_vps_thres, settings_hps_intrv, settings_hps_thres, settings_topns_percentage, settings_topnd_percentage, settings_graph_intrv
				FROM settings WHERE settings_id = 1";
	
	// EXECUTES THE QUERY
	$result = mysql_query($query) or die(mysql_error().'<br> SQL:'.$query);

	$row = mysql_fetch_row($result);
	echo '<div style="background:#AFBDFC;border:1px dotted #8C90CC;padding:10px;">';
	echo '<span style="text-decoration:underline;font-size: 16px;"><strong>Port Scans</strong></span><br><br>';
	echo '<br><strong>Horizontal Port Scan:</strong><br>';
	echo 'Threshold: <strong>'.$row[3].'</strong> Netflows per <strong>'.$row[2].'</strong> seconds<br>';

	echo '<br><strong>Vertical Port Scan:</strong><br>';
	echo 'Threshold: <strong>'.$row[1].'</strong> Netflows per <strong>'.$row[0].'</strong> seconds<br><br>';
?>	
	
	<form name="portscan" method="post" action="gs/update_hportscan.php">
		<strong>Update Horizontal Portscan</strong><br>
		Threshold: <input name="thres" type="text" size="5" maxlength="5"> Netflows<br>
		Interval:&nbsp;&nbsp;&nbsp;&nbsp;<input name="intrv" type="text" size="5" maxlength="5"> Seconds<br>
		<input name="submit" type="submit" value="Update">
	</form>

	<form name="portscan" method="post" action="gs/update_vportscan.php">
		<strong>Update Vertical Portscan</strong><br>
		Threshold: <input name="thres" type="text" size="5" maxlength="5"> Netflows<br>
		Interval:&nbsp;&nbsp;&nbsp;&nbsp;<input name="intrv" type="text" size="5" maxlength="5"> Seconds<br>
		<input name="submit" type="submit" value="Update">
	</form>
	5min = 300sec, 20min = 1200sec, 45min = 2700sec, 1hour = 3600sec, 1day = 86400sec.<br><br>
	
<?php
	echo '</div><br>';

	echo '<div style="background:#AFBDFC;border:1px dotted #8C90CC;padding:10px;">';
	echo '<span style="text-decoration:underline;font-size: 16px;"><strong>Top N</strong></span><br><br>';
	echo '<br><strong>Top N Sessions Thershold Percenatge:</strong><br>';
	echo 'Threshold: <strong>'.($row[4]*100).'</strong>%<br>';

	echo '<br><strong>Top N Data Thershold Percenatge:</strong><br>';
	echo 'Threshold: <strong>'.($row[5]*100).'</strong>%<br><br>';
?>	

<form name="topn" method="post" action="gs/update_topnsessions.php">
	<strong>Top N Threshold</strong><br>
	Threshold Formula: ((max-min)*percentage)+min)<br><br>
	<strong>Update Top N Sessions Thershold Percenatge</strong><br>
	Percentage: <select name="percentage">
      				<option value="0.05">5</option>
      				<option value="0.25" selected >25</option>
      				<option value="0.50">50</option>
      				<option value="0.60">60</option>
      				<option value="0.75">75</option>
     				<option value="0.9">90</option>
      				<option value="0.95">95</option>
    			</select> %<br>
	<input name="submit" type="submit" value="Update">
</form>
<form name="topn" method="post" action="gs/update_topndata.php">
	<strong>Update Top N Data Thershold Percenatge</strong><br>
	Percentage: <select name="percentage">
      				<option value="0.05">5</option>
      				<option value="0.25" selected >25</option>
      				<option value="0.50">50</option>
      				<option value="0.60">60</option>
      				<option value="0.75">75</option>
     				<option value="0.9">90</option>
      				<option value="0.95">95</option>
    			</select> %<br>
	<input name="submit" type="submit" value="Update">
</form>
	
<?php
	echo '</div><br>';

	echo '<div style="background:#AFBDFC;border:1px dotted #8C90CC;padding:10px;">';
	echo '<span style="text-decoration:underline;font-size: 16px;"><strong>Graphs</strong></span><br><br>';
	echo '<br><strong>Time Interval For The Graphs:</strong><br>';
	echo 'Time Interval: <strong>'.($row[6]/60).'</strong> minutes<br>&nbsp;';
?>

<form name="graph" method="post" action="gs/update_graph_intrv.php">
	<strong>Update Time Interval For The Graphs</strong><br>
	TIme Interval: <select name="minutes">
      				<option value="600" selected>10</option>
      				<option value="1800">30</option>
      				<option value="3600">60</option>
      				<option value="5400">90</option>
    			</select> minutes<br>
	<input name="submit" type="submit" value="Update">
</form>

<?php
	echo '</div><br>';
	
	// CLOSE THE DB CONNECTION
	mysql_close($link_id);
	
?>

	<? showbottom(); ?>

</div>


</body>
</html>
Return current item: YASeMI