PHP安全性漏洞

來源:互聯網
上載者:User

標籤:

1 命令執行

   PHP中可以使用下列函數來執行外部的應用程式或函數

     system 、exec 、passthru、shell_exec、popen

   system函數原型

string system(string $command [, int &$return_var ] )
  參數:
   command

  要執行的命令。

    return_var

  如果提供 return_var 參數, 則外部命令執行後的返回狀態將會被設定到此變數中

傳回值:

  成功則返回命令輸出的最後一行, 失敗則返回 FALSE

  exec函數原型

    passthru函數原型

    shell_exec函數原型

    popen函數原型

system漏洞執行個體(Windows環境)

<?phpprint("Please specify the name of the dir to print");print("<p>");$dirname=$_GET[‘dirname‘];$rest=system("dir $dirname",$return_var);?>

請求:

http://127.0.0.1/syscommad.php?dirname=c:\

響應:

Please specify the name of the  dir to print?????? C ?е??û?б???? ???????к??? C038-3181 c:\ ???¼ 2016/06/23 16:41 1,024 .rnd 2015/12/03 01:39 burpsuitev1.6.24 2015/08/30 10:30 Drivers 2015/09/22 14:27 IDAPro6.6 2016/06/08 12:24 IDA_Pro_v6.8_Green 2016/04/21 18:07 java 2016/06/14 21:31 masm32 2016/06/27 15:55 metasploit 2009/07/14 11:20 

 

PHP安全性漏洞

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.