
# Docker 기반 랩 환경: OURPHP <= 7.2.0의 CVE-2023-30212 크로스사이트 스크립팅(XSS) 취약점 악용 단계별 설정 및 악용 가이드를 제공하는 Docker 기반 랩 환경으로, OURPHP <= 7.2.0의 크로스사이트 스크립팅(XSS) 취약점인 CVE-2023-30212를 악용하기 위한 도구입니다.
Docker 환경 및 CVE-2023-30212 취약점 악용. CVE-2023-30212는 OURPHP 7.2.0 이하 버전에 영향을 미치는 보안 취약점입니다. 이 취약점은 XSS(Cross-Site Scripting) 공격을 허용합니다.
OURPHP <= 7.2.0은 /client/manage/ourphp_out.php를 통한 XSS(Cross Site Scripting)에 취약합니다.
dockerfile을 다운로드하고 압축을 해제합니다
https://down.chinaz.com/api/index/download?id=51308&type=code
CVE-2023-30212 악용 코드(exploit)를 다운로드합니다
dockerfile을 저장한 폴더에서 터미널을 엽니다
Docker 머신을 설치합니다
sudo apt update
sudo apt install docker.io
현재 디렉터리에 있는 Dockerfile을 기반으로 Docker 이미지를 빌드합니다
docker build -t < specifies the tag for the image>
docker build -t test .
이미지의 태그를 기반으로 Docker 컨테이너를 실행하고 호스트 머신의 포트를 컨테이너 내부 포트에 매핑하는 데 사용됩니다.
docker run -d -p < Docker image id>
docker run -d -p 8080:80 test
docker 이미지를 확인합니다
docker ps
새 컨테이너 ID를 가져옵니다
bb18debddccc test "docker-php-entrypoi…" 4 minutes ago Up 4 minutes 0.0.0.0:8080->80/tcp, :::8080->80/tcp angry_turing
실행 중인 Docker 컨테이너 내부에서 대화형 bash 세션을 실행합니다
docker exec -it bb18debddccc /bin/bash
Docker 셸을 얻습니다
root@bb18debddccc:/var/www/html#
MySQL 데이터베이스를 설정합니다
root@bb18debddccc:/var/www/html# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 38
Server version: 10.3.38-MariaDB-0+deb10u1 Debian 10
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
MySQL 또는 MariaDB에서 모든 권한을 부여합니다
GRANT ALL PRIVILEGES ON . TO ' user account'@'localhost' IDENTIFIED BY 'user password' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON . TO ' root'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
이는 MySQL 또는 MariaDB와 같은 데이터베이스 관리 시스템에서 'root' 사용자에게 현재 시스템의 모든 데이터베이스와 테이블에 대한 모든 권한을 부여하는 데 일반적으로 사용되는 SQL 명령입니다.
URL: http://localhost:8080/client/manage/ourphp_out.php?ourphp_admin=logout&out=
참고
*https://nvd.nist.gov/vuln/detail/CVE-2023-30212
*https://docs.docker.com/engine/install/
chatGpt