AnNyung Official Homepage Home > White Paper [ Kernel-uselib ]  

HOME
What is AnNyung
Documents
Packages System
White Paper
  . 2.0 Pkg Catalog
  . PHP Guide
  . AnNyung Tuning
  . A.P.M Setting
  . migration to 1.3
  . autoupdate
  . Oracle Ready
  . Quota Doc
  . CheckRootKit
  . Multibyte DNS
  . Sendamil STARTTLS
  . MySQL 4.1 Update
  . Time Server
  . Domain Key
  . VPN with PPTPd
  . VPN with OpenVPN
Download
Update
FAQ
Hardware
RoadMap
Gallery

  Go oops.org
  AnNyung banner 88x31

  AnNyung 1 banner 80x15
  AnNyung 2 banner 80x15
  AnNyung 3 banner 80x15
  AnNyung banner 80x15
  AnNyung banner 80x15



Kernel 2.4/2.6 uselib() privilege elevation, corrected
  커널 2.4.28, 2.6.9 를 포함한 이하 버전에 uselib() 함수의 보안 취약성을 통한 로컬 expolit
  이 발표 되었습니다. uselib() 함수의 보안 취약성을 공격하는 exploit 은 BOF 를 이용한 공
  격으로 안녕의 커널은 stack overflow patch 가 되어 있어 해당 사항이 없습니다. 다만 안녕
  리눅스에서 바닐라 커널이나, 다른 배포본의 커널을 사용하는 경우에는 꼭 패치를 해 주셔야
  합니다.  이 경우는 http://annyung.oops.org/tmp/uselib-2.4.28.patch 를 참고 해서 커널을
  재빌드 하신 후에 리부팅을 하십시오.

  해당 공격이 허용되는 커널에서 exploit 을 실행한 결과는 다음과 같습니다.


 Hanterm - ./elflbl -f

 [oops@main tmp]$ ./elflbl -f
   [+] SLAB cleanup
   child 1 VMAs 65527
   child 2 VMAs 65527
   child 3 VMAs 65527
   ...
   child 18 VMAs 63322
   [+] moved stack bfffb000, task_size=0xc0000000, map_base=0xbf800000
   [+] vmalloc area 0xdf800000 - 0xfedbb000
   Wait... \
   [+] race won maps=49205
   expanded VMA (0xbfffc000-0xffffe000)
   [!] try to exploit 0xe2d25000
   [+] gate modified ( 0xffec903c 0x0804ec00 )
   [+] exploited, uid=0

 sh-2.05b# id
   uid=0(root) gid=0(root) 



  안녕의 커널에서의 테스트 결과는 다음과 같습니다.


 Hanterm - ./elflbl -f

 [oops@build tmp]$ ./elflbl -f

   [+] SLAB cleanup
       child 1 VMAs 65526
       child 2 VMAs 65526
       child 3 VMAs 65526
       child 4 VMAs 65526
       child 5 VMAs 65526
       child 6 VMAs 65526
       child 7 VMAs 65526
       child 8 VMAs 65140
   [+] moved stack bfffe000, task_size=0xc0000000, map_base=0xbf800000
   [+] vmalloc area 0xf8400000 - 0xffffd000
       Wait... -
   [-] FAILED: try again (-f switch) and again

   [1]+  Stopped                 ./elflbl -f
 [oops@build tmp]$ id
   uid=500(oops) gid=500(oops) groups=500(oops),10(wheel)
 [oops@build tmp]$ exit
   logout
   There are stopped jobs.
 [oops@build tmp]$ id
   uid=500(oops) gid=500(oops) groups=500(oops),10(wheel)
 [oops@build tmp]$ ./elflbl -f

       child 1 VMAs 0
   [+] moved stack bfffe000, task_size=0xc0000000, map_base=0xbf800000
   [+] vmalloc area 0xf8400000 - 0xffffd000

   [-] FAILED: try again (-f switch) and again (Cannot allocate memory)

   [2]+  Stopped                 ./elflbl -f
 [oops@build tmp]$ id
   uid=500(oops) gid=500(oops) groups=500(oops),10(wheel)
 [oops@build tmp]$ exit
   logout
   There are stopped jobs.
 [oops@build tmp]$ id
   uid=500(oops) gid=500(oops) groups=500(oops),10(wheel)
 [oops@build tmp]$



  위의 결과와 같이 안녕의 커널에서는 root 의 권한을 못 얻고 있으니, 일단 root 를 획득당할
  위험 요소는 배제해도 될 듯 싶습니다.

  다만, 테스트 하실 때 주의할 점은, 위이 결과와 같이 sub shell 하나는 뜨기 때문에, 이 sub
  shell 상태에서 계속 exploit 을 실행할 경우, DOS 와 같이 system 이 먹통이 되는 경우가 있
  습니다. 그러니 반복 테스트를 할 경우에는 꼭 sub shell 을 죽이시고 하시기 바랍니다.

  일단, 이 경우를 위해서 patch 된 커널을 릴리즈를 할 예정이기는 합니다. :-)


  참고:
    http://www.securityfocus.com/archive/1/386436/2005-01-07/2005-01-13/0


    



 Home > White Paper [ Kernel-uselib ]

Copyright 2025 OOPS Development Organization 
LAST MODIFIED: 2012/08/28