본문 바로가기

30./35. Exploit

[Local Exploit] Local Privilege Escalation

[Local Exploit] Local Privilege Escalation 


CVE-2010-4258

쓰레드가 CLONE_CHILD_CLEARIED 플레그를 이용하여 Clone(2)를 통해 생성 된경우, NULL 단어는 사용자가 지정한 포인터에 쓰레드 종료를 기록한다. 해당 기록은 put_user()를 사용하여 종료되며, access_ok() 함수를 통해 호출하여 유효한 사용자 공간에 있는 제공 대상자에 확인된다. 하지만, Nelson은 커널이 주소 제한 오버라이트 set_fs(KERNEL_DS)와 OOPSes(via BUG, page fault, etc.), 해당 종료 경로가 put_user() 호출로 복귀되기 전에 사용자를 허용하는 임의의 커널 주소 NULL로 재 작성한다.

This is the interesting one, and the reason I wrote this exploit.  If a thread is created via clone(2) using the CLONE_CHILD_CLEARTID flag, a NULL word will be written to a user-specified pointer when that thread exits. This write is done using put_user(), which ensures the provided destination resides in valid userspace by invoking access_ok().

However, Nelson discovered that when the kernel performs an address limit override via set_fs(KERNEL_DS) and the thread subsequently OOPSes (via BUG, page fault, etc.), this override is not reverted before calling put_user() in the exit path, allowing a user to write a NULL word to an arbitrary kernel address. Note that this issue requires an additional vulnerability to trigger.



exploit란?

취약점 공격 또는 익스플로잇(exploit)이란 컴퓨터의 소프트웨어나 하드웨어 및 컴퓨터 관련 전자 제품의 버그, 보안 취약점 등 설계상 결함을 이용해 공격자의 의도된 동작을 수행하도록 만들어진 절차나 일련의 명령, 스크립트, 프로그램 또는 특정한 데이터 조각을 말하며, 이러한 것들을 사용한 공격 행위를 이르기도 한다. 

- 위키백과



excution


사용한 OS : Ubuntu 10.04

Kernel 버전 : 2.6.32-21

취약점 버전 : CVE-2010-4258


Ubuntu 실행한다.




~ $ uname -a

Linux ubuntu 2.6.32-21-generic

공격할 exploit의 경우 Linux Kernel 2.6.37 이하 버전에서 발생한다.



~ $ id

현재 로그인한 사용자 계정 권한 확인한다. 일반사용자로 생성한 계정이며 uid 1000을 사용한다.


www.exploit-db.com에서 exploit source 다운로드한다.

http://www.exploit-db.com/exploits/15704/



Source






ubuntu 해당 소스코드를 다운받고 gcc를 이용하여 컴파일 한다.

~ $ gcc -o CVE2010-4258 CVE2010-4258.c




~ $ ./CVE2010-4258

exploit 실행하여 root 권한 획득을 확인한다.


uid 0 획득



'30. > 35. Exploit' 카테고리의 다른 글

SandWorm exploit MS파워포인트(PPT)  (0) 2014.10.28
[Exploit] Stack Overflow / Heap Overflow / Heap Spray  (0) 2014.06.21