redhat 破殼漏洞修補方法

來源:互聯網
上載者:User

標籤:redhat 破殼 cve-2014-6271 cve-2014-6277

   駭客利用該漏洞,可以執行任意代碼,甚至可以不需要經過認證,就能遠程取得系統的控制權,包括執行惡意程式,或在系統內植入木馬,或擷取敏感資訊。而且,Bash從Bash 1.14到Bash 4.3版本全部存在該漏洞。


檢測指令碼:

#!/bin/bashEXITCODE=0# CVE-2014-6271CVE20146271=$(env ‘x=() { :;}; echo vulnerable‘ ‘BASH_FUNC_x()=() { :;}; echo vulnerable‘ bash -c "echo test" 2>&1 | grep ‘vulnerable‘ | wc -l)echo -n "CVE-2014-6271 (original shellshock): "if [ $CVE20146271 -gt 0 ]; thenecho -e "\033[91mVULNERABLE\033[39m"EXITCODE=$((EXITCODE+1))elseecho -e "\033[92mnot vulnerable\033[39m"fi# CVE-2014-6277# it is fully mitigated by the environment function prefix passing avoidanceCVE20146277=$((shellshocker="() { x() { _;}; x() { _;} <<a; }" bash -c date 2>/dev/null || echo vulnerable) | grep ‘vulnerable‘ | wc -l)echo -n "CVE-2014-6277 (segfault): "if [ $CVE20146277 -gt 0 ]; thenecho -e "\033[91mVULNERABLE\033[39m"EXITCODE=$((EXITCODE+2))elseecho -e "\033[92mnot vulnerable\033[39m"fi# CVE-2014-6278CVE20146278=$(shellshocker=‘() { echo vulnerable; }‘ bash -c shellshocker 2>/dev/null | grep ‘vulnerable‘ | wc -l)echo -n "CVE-2014-6278 (Florian‘s patch): "if [ $CVE20146278 -gt 0 ]; thenecho -e "\033[91mVULNERABLE\033[39m"EXITCODE=$((EXITCODE+4))elseecho -e "\033[92mnot vulnerable\033[39m"fi# CVE-2014-7169CVE20147169=$((cd /tmp; rm -f /tmp/echo; env X=‘() { (a)=>\‘ bash -c "echo echo nonvuln" 2>/dev/null; [[ "$(cat echo 2> /dev/null)" == "nonvuln" ]] && echo "vulnerable" 2> /dev/null) | grep ‘vulnerable‘ | wc -l)echo -n "CVE-2014-7169 (taviso bug): "if [ $CVE20147169 -gt 0 ]; thenecho -e "\033[91mVULNERABLE\033[39m"EXITCODE=$((EXITCODE+8))elseecho -e "\033[92mnot vulnerable\033[39m"fi# CVE-2014-7186CVE20147186=$((bash -c ‘true <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF‘ 2>/dev/null || echo "vulnerable") | grep ‘vulnerable‘ | wc -l)echo -n "CVE-2014-7186 (redir_stack bug): "if [ $CVE20147186 -gt 0 ]; thenecho -e "\033[91mVULNERABLE\033[39m"EXITCODE=$((EXITCODE+16))elseecho -e "\033[92mnot vulnerable\033[39m"fi# CVE-2014-7187CVE20147187=$(((for x in {1..200}; do echo "for x$x in ; do :"; done; for x in {1..200}; do echo done; done) | bash || echo "vulnerable") | grep ‘vulnerable‘ | wc -l)echo -n "CVE-2014-7187 (nested loops off by one): "if [ $CVE20147187 -gt 0 ]; thenecho -e "\033[91mVULNERABLE\033[39m"EXITCODE=$((EXITCODE+32))elseecho -e "\033[92mnot vulnerable\033[39m"fi# CVE-2014-////CVE2014=$(env X=‘ () { }; echo vulnerable‘ bash -c ‘date‘ | grep ‘vulnerable‘ | wc -l)echo -n "CVE-2014-//// (exploit 3 on http://shellshocker.net/): "if [ $CVE2014 -gt 0 ]; thenecho -e "\033[91mVULNERABLE\033[39m"EXITCODE=$((EXITCODE+64))elseecho -e "\033[92mnot vulnerable\033[39m"fiexit $EXITCODE

執行代碼如果顯示如下結果,則說明該機器存在該漏洞。

650) this.width=650;" src="http://s4.51cto.com/wyfs02/M01/82/C4/wKioL1dgwbHTYeodAACyYUQ6kx4771.jpg-wh_500x0-wm_3-wmp_4-s_2270579027.jpg" title="QQ20160615104207.jpg" alt="wKioL1dgwbHTYeodAACyYUQ6kx4771.jpg-wh_50" />


解決辦法:

1、使用 yum update bash 更新升級 bash。

2、登入redhat官網,下載最新bash,編譯更新。


本文出自 “菜鳥的Linux曆程” 部落格,請務必保留此出處http://jackdady.blog.51cto.com/8965949/1789419

redhat 破殼漏洞修補方法

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.