shell bypass 403

GrazzMean Shell

: /proc/self/root/bin/ [ dr-xr-xr-x ]
Uname: Linux yisu-647059427c03a 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64
Software: nginx/1.22.1
PHP version: 7.3.31 [ PHP INFO ] PHP os: Linux
Server Ip: 103.146.158.90
Your Ip: 216.73.216.141
User: www (1000) | Group: www (1000)
Safe Mode: OFF
Disable Function:
passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv

name : cloudMonitor.sh
# chkconfig: - 85 15
# description: xxxx is a xxxxx server. It is used to serve
#!/bin/bash


DAEMONPATH=/usr/bin
#SERVICE=node_linux
NUM=`getconf LONG_BIT`

getPid(){
    #将命令结果变为数组
	#echo "$SERVICE"
    var=($(ps aux | grep $SERVICE_BAK | grep -v  grep | awk  '{print $2,$11}'))
	#获取数组长度
    #echo ${#var[@]}
    for i in $(seq ${#var[@]} -1 1)
    do 
        if [ $(($i % 2)) = 0 ]
            then
			    #找到对应的pid号
                cmd=$( expr ${var[$(($i - 1 ))]} : "^\(/usr.*$SERVICE_BAK\)$" )
				if [[ $cmd = $DAEMONPATH/$SERVICE_BAK ]]
				then 
					echo ${var[$(($i - 2 ))]}
                    exit 0
				fi  
        fi
    done
	exit 1
}


start() {
	pid=$( getPid )
    if [ -z "$pid"  ];then
	    $DAEMONPATH/$SERVICE_BAK &
		pid=$( getPid )
        if [ -z "$pid"  ];then
            echo "$SERVICE start error"
            exit 2
        else
		    echo "$SERVICE start success"
            exit 0
        fi
    else
	    echo "$SERVICE is running(pid :$pid)"
        exit 0
    fi
    exit 0
}

stop() {
	pid=$( getPid )
    if [ -z "$pid"  ];then
	    echo "$SERVICE  is aleady stop"
		exit 0
	    
    else
	    kill -9 $pid
		pid=$( getPid )
        if [ -z "$pid"  ];then
            echo "$SERVICE stop success"
            exit 0
        else
		    echo "$SERVICE stop error"
			exit 2
            
        fi
    fi
    exit 2
}


restart() {
	pid=$( getPid )
    if [ -z "$pid"  ];then
	    echo "$SERVICE  is stop"
		echo "try to start $SERVICE"
		start
	    
    else
	    echo "$SERVICE is running(pid :$pid)"
		kill -9 $pid
		pid=$( getPid )
        if [ -z "$pid"  ];then
            echo "$SERVICE stop success"
        else
		    echo "$SERVICE stop error"
			exit 2
            
        fi
		
		start
    fi
    exit 0
}


status(){
    pid=$( getPid )
    if [ -z "$pid"  ];then
	    echo "$SERVICE  is stop"
		exit 1
		
    else
	    echo "$SERVICE is  running(pid :$pid)"
		exit 0
    fi
    exit 1
}


SERVICE=$1
SERVICE_BAK=`echo "$SERVICE-amd$NUM"`
case "$1" in
cloudmonitor)
  case "$2" in
	start)
	  start
	  ;;
	stop)
	  stop
	  ;;
	restart)
	  restart
	  ;;
	status)
	  status
	  ;;
	*)
	  echo "Usage:service $1 {start|stop|restart|status}"
	  exit 2
	  ;;
	esac
	;;
cloudmonitor_daemon)
  case "$2" in
	start)
	  start
	  ;;
	stop)
	  stop
	  ;;
	restart)
	  restart
	  ;;
	status)
	  status
	  ;;
	*)
	  echo "Usage:service $1 {start|stop|restart|status}"
	  exit 2
	  ;;
	esac
	;;
*)
  echo "Usage:service service_name{cloudmonitor_daemon|cloudmonitor}"
  exit 2
  ;;
esac

© 2026 GrazzMean