ShellShock (Bash 漏洞) CVE-2014-6271 來龍去脈

Bash Bug  CVE-2014-6271 來龍去脈

ID-10079246

Linux 比較不會中毒或是受駭客攻擊嗎?

這次2014最具威脅性的安全漏洞就是針對 Linux 的漏洞

http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-6271

透過 Linux Sell Script 的安全漏洞

駭客可以設定特別的環境變數之後,入侵電腦,執行任何的指令

或是透過 Apache HTTP Server 執行任何指令

只要在 http request 內容作一些特別的手腳,

送到 Linux Appache server,也能夠執行任何的指令,

因此這個漏洞讓許多的 Apache/Linux 架設的網站,都暴露於被駭客攻擊的風險,駭客可以透過 http、telnet 、或是其他方法攻擊該主機,執行駭客想要的程式碼

 

哪些環境會受到這個弱點的攻擊呢?

  • 使用mod_cgi or mod_cgid的Apache Web Server
  • 使用OpenSSH sshd

 

 

如何透過 Web Request 攻擊?

駭客會組出一定的字元,測試該網站主機 (Apache/linux)是否受到這個弱點的影響,

進而執行相關的程式碼,例如

http-user-agent = BugSell_Scan 
http-header[Cookie] = () { :; }; ping -c 3 201.12.210.1
http-header[Host] = () { :; }; ping -c 3 201.12.210.1
http-header[Referer] = () { :; }; ping -c 3 201.12.210.1
說明
將這些特別組的字元() { :; };  傳送到 Linux/Apache Web Server
若該主機有Bash Bug 弱點,就會執行 之後的指令
ping -c 3 201.12.210.1

系統管理如何驗證

對於系統管理者來說,如何驗證系統是否受到這樣的威脅呢?
設定環境變數如下:
$ env x=‘() { :;}; echo vulnerable’ bash -c “echo code executed due to the bug bash”
如果該環境有 Bash Bug 的風險則印出:
vulnerable code executed due to the bug bash
如果該環境沒有風險,則印出:
warning: x: ignoring function definition attempt bash: error importing function definition for `x’ this is a test

系統管理如何修復更新?

只要將 Linux Bash 更新最新版即可
# yum update bash

Windows 會受到影響嗎?

由於這個 bash bug 主要的影響對象為 Linux Bash,
目前對於 Windows 的影響尚未有具體的 case

如何驗證我的網站是否已經受到攻擊?

由於駭客會透過下列的 http request攻擊
http-user-agent = BugSell_Scan 
http-header[Cookie] = () { :; }; ping -c 3 201.12.210.1
http-header[Host] = () { :; }; ping -c 3 201.12.210.1
http-header[Referer] = () { :; }; ping -c 3 201.12.210.1
因此可以用關鍵字 “() { :; }” 搜尋相關的 Apache log 是否有這樣的存取記錄
例如
200.10.1.1 – – [25/Sep/2014:08:00:00 +0000] “GET / HTTP/1.0″ 404 311 “() { :; }; ping -c 3 201.12.210.1 ; copy files….;”

Shellshock 漏洞免費檢測工具

http://www.trendmicro.tw/tw/security/shellshock-bash-bug-exploit/index.html

 

最後建議:

這次Bash Bug  CVE-2014-6271 影響的層面遠遠勝過之前的 openSSL 心在流血,幾乎所有的 Linux / Apache 都會受到影響,而且可以讓駭客任意執行任何指令,建議採與下列行動:

1. 更新 Linux Bash 版本
2. 設定 FireWall 阻擋特定關鍵字 “() { :; }
3. 檢查 Apache Log 搜尋特定關鍵字 “() { :; }” ,看看該網站是否已經受到攻擊

Leave a Reply

Your email address will not be published. Required fields are marked *