前兩天收到一個 bash 漏洞警示,提醒要趕快更新 bash ,來解決透過環境變數的代碼注入攻擊。新的 bash 版本,確保命令結束後面,無法再執行一個 bash 函數。
測試方式:
env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
如果畫面上顯示
vulnerable
this is a test
這表示,您的作業系統需要更新 bash 。
更新方式:
1. CentOS, RedHat, Fedora
yum -y update bash2. Debian, Ubuntu
sudo apt-get update && sudo apt-get install --only-upgrade bash更新完後,請重新測試,如畫面顯示如下 bash: warning: x: ignoring function definition attempt bash: error importing function definition for `x' this is a test 即表示漏洞以修補完成。 參考來源: shellshocker.net
文章標籤
全站熱搜
