timwu

OSX BASH 漏洞修复指南

  •  2
     
  •   timwu · Sep 25, 2014 · 5796 views
    This topic created in 4247 days ago, the information mentioned may be changed or developed.
    以下from stackexchange,实测有效,链接: http://apple.stackexchange.com/questions/146849/how-do-i-recompile-bash-to-avoid-the-remote-exploit-cve-2014-6271-and-cve-2014-7

    以下为搬砖:

    1.用homebrew bash的童鞋

    brew update
    brew upgrade bash

    2.用苹果自带bash的童鞋

    mkdir bash-fix
    cd bash-fix
    curl https://opensource.apple.com/tarballs/bash/bash-92.tar.gz | tar zxf -
    cd bash-92/bash-3.2
    curl https://ftp.gnu.org/pub/gnu/bash/bash-3.2-patches/bash32-052 | patch -p0
    cd ..
    xcodebuild
    sudo cp /bin/bash /bin/bash.old
    sudo cp /bin/sh /bin/sh.old
    build/Release/bash --version # GNU bash, version 3.2.52(1)-release
    build/Release/sh --version # GNU bash, version 3.2.52(1)-release
    sudo cp build/Release/bash /bin
    sudo cp build/Release/sh /bin

    验证是否成功
    输入
    bash -version
    输出
    GNU bash, version 3.2.52(1)-release (x86_64-apple-darwin13)
    则说明升级成功

    输入
    env x='() { :;}; echo vulnerable' bash -c 'echo hello'
    只输出
    hello
    则说明升级成功

    若输出了
    vulnerable
    hello

    就赶紧滚去修复吧~
    8 replies    2014-09-28 11:11:03 +08:00
    hjc4869
        1
    hjc4869  
       Sep 25, 2014
    不是说现有修复方法可以轻松绕过吗。。→_→
    timwu
        2
    timwu  
    OP
       Sep 25, 2014
    @hjc4869 恩。。env X='() { (a)=>\' sh -c "echo date"; cat echo 输出日期也挂 坐等新的release版修复
    zdf
        3
    zdf  
       Sep 25, 2014
    这样的漏洞苹果应该要出个补丁吧?
    Showfom
        4
    Showfom  
    PRO
       Sep 25, 2014
    curl https://opensource.apple.com/tarballs/bash/bash-92.tar.gz | tar zxf -

    这一步的时候提示

    curl: (60) SSL certificate problem: Invalid certificate chain
    More details here: http://curl.haxx.se/docs/sslcerts.html
    Tink
        5
    Tink  
    PRO
       Sep 26, 2014 via iPhone
    @Showfom 把no check cer加上
    inferjay
        6
    inferjay  
       Sep 26, 2014
    已补
    diguage
        7
    diguage  
       Sep 28, 2014
    使用HomeBrew,这个最新版的Bash的修复可以被绕过去?
    diguage
        8
    diguage  
       Sep 28, 2014
    再问:为啥苹果官网没有出修改方式呢?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4296 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 63ms · UTC 00:08 · PVG 08:08 · LAX 17:08 · JFK 20:08
    ♥ Do have faith in what you're doing.