Location: PHPKode > projects > Scriobai CMS > Scriobai1.6.4/scriobaicms/cms/security.php
<?php

require_once('functions.php');

is_login();

csrf_attemp();

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<link rel="stylesheet" type="text/css" href="../style.css">
	<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
	<title>Scriobai / Security Panel</title>
	<style type="text/css">
	<!--
	table
	{
	border-collapse:collapse;
	}
	table,th, td
	{
	border: 1px solid black;
	}
	-->
	</style>
</head>

<body>

<table bgcolor="#f57900" width="100%">
	<tbody>
	<tr>
		<td>
			<div align="left"><a href="manage.php" style="text-decoration: none;"><img style="width: 34px; height: 33px;" border="0" src="img_functions/arrow_left.png" alt="<==="></a></div>
		</td>
		<td>
			<div align="center"><font color="#4b4b4b"><?php $time = date("H:i:s"); $date = date("d/m/Y"); echo "<b>Today</b>: $date <b>time</b>: $time"; ?></font></div>
		</td>
		<td>
			<div align="right"><img style="width: 34px; height: 33px;" src="../img/yacumana.png" alt="../img/yacumana.png"></div>
		</td>
	</tr>
	</tbody>
</table>

<br>

<div style="background-color: rgb(51, 0, 204);">
<table width="100%">
	<tbody>
    <tr>
		<td>
			<img src="img_functions/security.png">&nbsp;<font color="white"><big>Security Panel</big></font>
		</td>
    </tr>
    <tr>
		<td>
			<?php
			
			//---from comments form ---//
			
			$sec_log_dir = "security_logger/comments_logger_*.html";
			$sec_log_dir = glob($sec_log_dir);
			
			if ($sec_log_dir != 0) {
				$path = "security_logger/";

				$dir_handle = @opendir($path);

				echo "<font color=\"white\">This is all security logger</font><br/><br>";

				while ($file = readdir($dir_handle))
				{
					if($file!="." && $file!="..")
					echo "<a href='$path$file' target=\"_blank\">$file</a><br/><br/><br/>";
				}
				closedir($dir_handle);
			}
			elseif ($sec_log_dir == 0) {
				echo "<br /><table><tr><td><font color=\"red\">Nobody tried to break in this blog from comments form</font></td></tr></table>";
			}
			
			//---from search---//
			
			$security_path = 'security_logger/logger.php';
			
			$f = file($security_path);
			$i = 0;
			
			foreach ($f as $v) {
				if (count($f) > 1) {
					if ($i == 0) { $i = 1; continue; }
					$p = explode("|", $v);
					echo "<br /><br /><font color=\"white\">Hacking attempts by: <font color=\"red\">$p[0]</font>, on: <font color=\"red\">$p[1]</font>, referrer: <font color=\"red\">$p[2]</font>, url: <font color=\"red\">$p[3]</font>, keyword: <font color=\"red\">$p[4]</font>, user agent: <font color=\"red\">$p[5]</font><hr>";
				} else { echo "<table><tr><td><font color=\"red\">Nobody tried to break in this blog from search form</font></td></tr></table>"; }
			}
			
			?>
			<form method="POST" action="security.php">
			<?php echo "<input name='sid' type='hidden' value='$_COOKIE[sid]'>"; ?>
			  <font color="white">Download a all security loggers in a zip archive<br><br>
			  <select name="choice">
					<option value="1">Download security log</option>
					<option value="2">Delete the zip log</option>
					<option value="3">Delete the security logs</option>
			  </select>
			  <input type="submit" value="Submit"></font></form><br>
		</td>
	</tr>
	</tbody>
</table>

<?php

$time         = time();
$choice       = $_POST['choice'];
$dir_backup   = "backup/";
$dir_sec_log  = "security_logger/logger.php";
$security_dir = "security_logger/";

if (!empty( $_POST['choice'] ))
{
	switch( $choice )
	{
		case 1:
		
		require_once("zip.inc.php");

		$zipfile = new zipfile();
		$dir     = "security_logger/";
		$file    = "backup/security_archive_$time.zip";

		@zippa( $dir );

		$f = fopen( $file, "w" );
		fwrite( $f, $zipfile->file() );
		fclose( $f );

		echo "<script>window.location='backup/security_archive_$time.zip'</script>";

		break;
		
		case 2:

		@remove_dir_obj( $dir_backup );
		@mkdir( $dir_backup );
		
		echo "<font color=\"white\">The archives was successfully deleted</font>";
		break;
		
		case 3:
		
		@remove_dir_obj( $security_dir );
		@mkdir( $security_dir );
		
		$fh = fopen( $dir_sec_log, "w" );fclose($fh);
		
		$filehandle = fopen( $dir_sec_log, "a+" );
		
		fwrite($filehandle, "<?php die(); ?>\n");
		fclose($filehandle);
		
		echo "<font color=\"white\">The zip logs were successfully deleted</font>";
		break;
	}
}
?>

</div>

<br>

<div align="center"><font color="yellow"><i>Scriobai CMS is Free software under the GNU/GPL license</i></font></div>
<br>

</body>
</html>
Return current item: Scriobai CMS