Location: PHPKode > projects > Ptk-forensics > ptk/lib/get_command_output.php
<?
/*
PTK  - DFLabs
Copyright (C) 2008 - DFLabs srl - All rights reserved
hide@address.com
*/
include("check_session.php");
include("lib_commands.php");
//include("loggerClass.php");
if (isset($_SESSION['user'])){	
	$id = sanitize($_GET['id'],INT);
	/*
	0 = image filesystem when adding new images
	1 = folder browsing when adding new images
	2 = file type during analysis
	3 = timeline indexing
	4 = filetype indexing
	5 = md5+sha1+keyword indexing
	*/
	
	switch($id){
		case '0':
			if (strcmp($_SESSION['user'],"admin")==0){
				$arg1 = $_GET['arg1'];
				$arg1 = preg_replace("/\s/", "\ ", $arg1);
				$arg1 = preg_replace("/\..+$/", ".*", $arg1);
				echo get_image_filesystem($arg1);
				break;
			}			
		case '1':
			if (strcmp($_SESSION['user'],"admin")==0){
				$arg1 = $_GET['arg1'];
				$arg2 = $_GET['arg2'];
				$arg3 = $_GET['arg3'];
				echo get_folder_browsing($arg1, $arg2, $arg3);
				break;		
			}
		case '2':
			$arg1 = $_GET['arg1'];
			$arg2 = $_GET['arg2'];
			$arg3 = $_GET['arg3'];
			echo get_file_type($arg1, $arg2, $arg3);
			break;		
			
		case '3':
			if (strcmp($_SESSION['user'],"admin")==0){
				$arg1 = $_GET['arg1'];
				$arg2 = $_GET['arg2'];
				$arg3 = $_GET['arg3'];
				$arg4 = $_GET['arg4'];
				echo indx_timeline($arg1, $arg2, $arg3,$arg4);
				break;		
			}
		case '4':
			if (strcmp($_SESSION['user'],"admin")==0){
				$arg1 = $_GET['arg1'];
				$arg2 = $_GET['arg2'];
				$arg3 = $_GET['arg3'];
				echo indx_filetype($arg1, $arg2, $arg3);
				break;		
			}	
		case '5':
			if (strcmp($_SESSION['user'],"admin")==0){
				$arg1 = $_GET['arg1'];
				$arg2 = $_GET['arg2'];
				$arg3 = $_GET['arg3'];
				$options = $_GET['arg4'];
				echo indx_multi($arg1, $arg2, $arg3,$options);
				break;		
			}		
		case '8':
			$arg1 = $_GET['arg1'];
			echo get_ram_info($arg1);
			break;		
	
		case '9':
			$arg1 = $_GET['arg1'];
			$arg2 = $_GET['arg2'];
			$arg3 = $_GET['arg3'];
			$arg4 = $_GET['arg4'];
			$arg5 = $_GET['arg5'];
			$arg6 = $_GET['arg6'];
			$arg7 = $_GET['arg7'];
			$arg8 = $_GET['arg8'];
			echo get_ram_analysis($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7, $arg8);
			break;		
	}
}else{
	new AuditLog('Unauthorized access to get_command_output ');
        header("location: goto_home.php");
}
?>
Return current item: Ptk-forensics