
커널 권한 상승 열거 및 익스플로잇 프레임워크
kernelpop은 다음 운영 체제에서 자동화된 커널 취약점 열거 및 익스플로잇을 수행하기 위한 프레임워크입니다:
Linux
Mac
python 버전에 구애받지 않도록 설계되어 python2와 python3 모두에서 작동해야 합니다.

$ git clone https://github.com/spencerdodd/kernelpop
$ cd kernelpop
$ python kernelpop.py || python3 kernelpop.py
$ git clone https://github.com/spencerdodd/kernelpop
$ cd kernelpop
$ ./create_executable.sh
$ ./kernelpop
pyinstaller 설치 (단계는 빌드 시스템에 따라 다름)$ pyinstaller kernelpop.py --onefile$ cp dist/kernelpop .두 바이너리 빌드 단계 모두 프로젝트 루트에 kernelpop 바이너리를 생성해야 합니다.
user@debian:~/Desktop/kernelpop$ python3 kernelpop.py
##########################
# welcome to kernelpop #
# #
# let's pop some kernels #
##########################
[*] grabbing distro version and release from underlying OS (linuxdebian7)
[*] grabbing kernel version from 'uname -a'
[+] kernel (Linux debian 3.2.0-4-686-pae #1 SMP Debian 3.2.41-2 i686 GNU/Linux) identified as:
[base]
type: linux
distro: linuxdebian7
version: 3.2.0-4
architecture: i686
[specific]
type: linux
distro: linuxdebian7
version: 3.2.41-2
architecture: i686
[*] matching kernel to known exploits
[+] discovered 11 possible exploits !
[[ distro kernel matched exploit available ]]
CVE20165195_32 Dirty COW race condition root priv esc for 32 bit
[[ distro kernel version vulnerable ]]
CVE20144699 Exploitable race condition in linux before 3.15.4
CVE20143153 `futex_requeue` vulnerability before 3.14.6 allows for priv esc
CVE20162384 Double free vulnerability in the `snd_usbmidi_create` (requires physical proximity)
CVE20140196 `n_tty_write` vuln before 3.14.4 allows priv esc to root
CVE20132094_semtex perf_swevent_init Local root exploit (32 bit)
CVE20176074 `dccp_rcv_state_process` in net/dccp/input.c mishandles structs and can lead to local root
CVE20132094_32 perf_swevent_init Local root exploit (32 bit)
[[ base linux kernel vulnerable ]]
CVE20144014 `chmod` restriction bypass allows users to get root before 3.14.8
CVE20177308 `packet_set_ring` in net/packet/af_packet.c can gain privileges via crafted system calls.
CVE20171000112 ip_ufo_append_data() memory corruption flaw can be exploited to gain root privileges.
출력에는 몇 가지 카테고리가 있습니다. 각각의 의미는 다음과 같습니다.
[[ distro kernel matched exploit available ]]
[[ distro kernel version vulnerable ]]
[[ base linux kernel vulnerable ]]
python2 또는 python3
pyinstaller (바이너리를 빌드하려는 경우)
run modes:
(default) python3 kernelpop.py
(exploit-mode) python3 kernelpop.py -e {exploit name}
(dump-source) python3 kernelpop.py -e {exploit name} -d
(uname-mode) python3 kernelpop.py -u {uname -a output}
(interactive-mode) python3 kernelpop.py -i # LEGACY option (same as uname-mode)
other:
(playground path) -p {new path}
(json output file) --digest json
default 모드는 호스트 커널에 대한 정보를 처리하고 프로그램에 알려진 커널 익스플로잇과 비교합니다. 그런 다음 잠재적으로 유용한 취약점 및 첨부된 익스플로잇 목록을 출력합니다.
-e {exploit name}
exploit 모드는 프로그램 내에서 stdio 상호작용과 함께 익스플로잇 소스 코드를 동적으로 컴파일하고 실행합니다. 또한 조기 종료 시도로 인한 인터럽트를 포착할 수 있습니다. default 모드의 초기 kernelpop 열거 실행에서 나타나는 익스플로잇 이름을 사용하십시오.
dump-source (옵션) -d
exploit 모드의 수정자입니다. 주어진 익스플로잇의 소스 파일을 PLAYGROUND_PATH (기본값 /tmp)의 해당 파일로 덤프합니다. 이는 박스에서 익스플로잇 소스를 수정하거나 수동 상호작용 또는 값의 하드코딩이 필요한 익스플로잇 작업 시 유용합니다. 바이너리에서 실행할 때 특히 유용합니다. 바이너리에서는 프로젝트 소스 코드(즉, 익스플로잇 소스)에 접근할 수 없기 때문입니다.-u {uname -a output}
이 옵션을 사용하면 uname -a 명령의 출력을 프로그램에 인라인으로 전달할 수 있으므로 자동화된 스크립트에 통합하거나 다른 예상 가능한 이유로 사용할 수 있습니다. interactive mode의 대체 기능입니다.
uname 출력에 필요]-i {uname -a output}
interactive 모드는 uname -a 명령의 출력만으로 열거를 수행할 수 있게 하여 호스트 측 전용 열거 도구로 유용합니다. kernelpop을 -i 플래그로 시작한 후 요청 시 uname -a의 출력을 전달하여 실행됩니다. 이는 레거시 기능이며 uname mode로 대체되었지만, -u가 Mac 열거를 지원하지 않으므로 계속 지원됩니다.
PLAYGROUND 경로-p {new PLAYGROUND_PATH dir}
-p 옵션은 전역 변수 PLAYGROUND_PATH의 값을 설정합니다. 이는 모든 익스플로잇 소스 파일이 기록되고 익스플로잇이 컴파일되는 위치입니다. 기본값은 /tmp입니다. 그러나 /tmp에 쓰기 권한이 없는 경우 이 수정자를 사용하여 임의의 디렉토리로 설정할 수 있습니다.
--digest json
이 옵션을 사용하면 kernelpop 실행 결과를 나중에 처리할 수 있도록 읽기 쉬운 json 파일로 덤프할 수 있습니다. 지금은 json 덤프만 구현했지만, 요청이 있으면 XML 버전도 작업할 예정입니다.
더 많은 익스플로잇 추가! (src/to_add - 누군가 이 중 몇 가지를 작업하고 싶다면 환영합니다!)
취약한 범위 비교에 패치 수준 포함
잘못된 파싱이나 적대적 설정이 있을 경우 감지된 설정을 재정의하는 방법 추가
google: CVE-XXXX-XXXX "ubuntu"
canonical 링크 클릭 (https://people.canonical.com/~ubuntu-security/cve/2016/CVE-XXXX-XXXX.html)
usn.ubuntu.com의 모든 연결된 권고를 클릭하고 정보 파싱
버전별 취약점 윈도우를 채우기 위한 패치 버전 수집
google: CVE-XXXX-XXXX "debian"
security-tracker.debian.org 링크 (https://security-tracker.debian.org/tracker/CVE-XXXX-XXXX)
google: CVE-XXXX-XXXX "mitre"
CVE-2017-1000379
CVE-2017-1000373
CVE-2017-1000372
CVE-2017-1000371
CVE-2017-1000370
CVE-2017-1000367
CVE-2017-1000112
CVE-2017-7308
CVE-2017-6074
CVE-2017-5123
CVE-2016-5195
CVE-2016-2384
CVE-2016-0728
https://github.com/SecWiki/linux-kernel-exploits
http://exploit-db.com/
https://github.com/lucyoa/kernel-exploits
https://github.com/SecWiki/windows-kernel-exploits
Debian
CVE-2015-1328
CVE-2014-4699
CVE-2014-4014
CVE-2014-3153
CVE-2014-0196
CVE-2014-0038
CVE-2013-2094
CVE-2010-4347
CVE-2010-2959
CVE-2009-1185