Kubernetes Based Penetration Testing Lab
stateDiagram-v2
state "<pre><code>
,----,
,----.. ,----, .' .`|
/ / \ .' .' \ .' .' ;
| : : ,----,' |,---, ' .'
. | ;. / | : . ;| : ./
. ; /--` ; |.' / ; | .' /
; | ; `----'/ ; `---' / ;
| : | / ; / / ; /
. | '___ ; / /-, ; / /--,
' ; : .'| / / /.`| / / / .`|
' | '/ :./__; :./__; :
| : / | : .' | : .'
\ \ .' ; | .' ; | .'
`---` `---' `---'
</pre></code>" as c2z
style c2z fill:#c4f452, color: #000, width: 100vw, font-weight: bold
- Helm Repository : https://s2n0n.github.io/c2z/
c2z is an automated penetration testing lab that operates in a Kubernetes-native environment. It is designed to enable security researchers and learners to quickly and easily deploy and practice realistic attack/defense scenarios.
- Rapid Deployment: Container-based environment setup in seconds
- Resource Efficiency: Significantly lower resource consumption compared to virtual machines
- One-Click Installation: Easy setup through Helm and automated scripts
- Scenario-Based: Provides various scenarios including Web vulnerabilities, Container Escape, Network Attack, and more
- Monitoring Integration: Real-time observability through Prometheus, Grafana, and Loki
- For detailed guide, please read
/guide.mdx
- Linux: Ubuntu/Debian recommended
- macOS: Docker Desktop installation required (uses
k3d) - Minimum 16GB RAM, 4 vCPU, 50GB Disk
curl,python3installation required
Running the installation script from the project root will automatically install K3s, Helm, and the c2z base environment.
chmod +x install.sh
./install.shYou can manage scenarios using the c2z-cli tool.
pip install -r requirements.txt-
List scenarios
./c2z-cli list
-
Deploy scenario
./c2z-cli deploy web-vuln
-
Delete scenario
./c2z-cli delete web-vuln
-
Check status
./c2z-cli status
c2z/
├── charts/ # Helm Charts directory
│ └── c2z/ # Main c2z chart
│ ├── templates/ # Kubernetes Manifest templates
│ │ ├── attacker-zone/ # Attacker (Kali) environment resources
│ │ ├── monitoring/ # Monitoring stack (Prometheus, Grafana, etc.)
│ │ ├── scenarios/ # Scenario definitions
│ │ │ └── web-vuln/ # Web vulnerability scenario (DVWA, JuiceShop)
│ │ ├── namespaces.yaml # Namespace definitions
│ │ ├── network-policies.yaml # Network isolation policies
│ │ └── resource-quotas.yaml # Resource limit policies
│ ├── Chart.yaml # Chart metadata
│ └── values.yaml # Default configuration values (images, resources, etc.)
├── install.sh # One-click installation script
├── c2z-cli # CLI management tool (Python)
├── plan.md # Project planning and design document
├── requirements.txt # CLI Python dependencies
└── README.md # Project documentation
- Target: DVWA, OWASP Juice Shop
- Learning Content: Web security fundamentals including SQL Injection, XSS, CSRF, etc.
- Target: Privileged Pod, Docker Socket Mount
- Learning Content: Container escape techniques practice (implementation planned)
- Target: Legacy Services (Telnet, FTP)
- Learning Content: ARP Spoofing, MITM, Denial of Service attacks (implementation planned)
c2z는 Kubernetes 네이티브 환경에서 동작하는 자동화된 침투 테스트 랩입니다. 보안 연구자와 학습자가 실전적인 공격/방어 시나리오를 빠르고 쉽게 배포하고 실습할 수 있도록 설계되었습니다.
- 빠른 배포: 컨테이너 기반으로 수 초 내에 실습 환경 구축
- 리소스 효율성: 가상머신 대비 현저히 낮은 리소스 점유
- 원클릭 설치: Helm 및 자동화 스크립트를 통한 간편한 설정
- 시나리오 기반: Web 취약점, Container Escape, Network Attack 등 다양한 시나리오 제공
- 모니터링 통합: Prometheus, Grafana, Loki를 통한 실시간 관측 가능
- Linux: Ubuntu/Debian 권장
- macOS: Docker Desktop 설치 필수 (
k3d사용) - 최소 16GB RAM, 4 vCPU, 50GB Disk
curl,python3설치 필요
프로젝트 루트에서 설치 스크립트를 실행하면 K3s, Helm, 그리고 c2z 기본 환경이 자동으로 설치됩니다.
chmod +x install.sh
./install.shc2z-cli 도구를 사용하여 시나리오를 관리할 수 있습니다.
pip install -r requirements.txt-
시나리오 목록 확인
./c2z-cli list
-
시나리오 배포
./c2z-cli deploy web-vuln
-
시나리오 삭제
./c2z-cli delete web-vuln
-
상태 확인
./c2z-cli status
c2z/
├── charts/ # Helm Charts 디렉토리
│ └── c2z/ # 메인 c2z 차트
│ ├── templates/ # Kubernetes Manifest 템플릿
│ │ ├── attacker-zone/ # 공격자(Kali) 환경 리소스
│ │ ├── monitoring/ # 모니터링 스택 (Prometheus, Grafana 등)
│ │ ├── scenarios/ # 시나리오 정의
│ │ │ └── web-vuln/ # Web 취약점 시나리오 (DVWA, JuiceShop)
│ │ ├── namespaces.yaml # 네임스페이스 정의
│ │ ├── network-policies.yaml # 네트워크 격리 정책
│ │ └── resource-quotas.yaml # 리소스 제한 정책
│ ├── Chart.yaml # 차트 메타데이터
│ └── values.yaml # 기본 설정 값 (이미지, 리소스 등)
├── install.sh # 원클릭 설치 스크립트
├── c2z-cli # CLI 관리 도구 (Python)
├── plan.md # 프로젝트 기획 및 설계 문서
├── requirements.txt # CLI Python 의존성
└── README.md # 프로젝트 문서
- 대상: DVWA, OWASP Juice Shop
- 학습 내용: SQL Injection, XSS, CSRF 등 웹보안 기초
- Target: Privileged Pod, Docker Socket Mount
- 학습 내용: 컨테이너 탈출 기법 실습 (구현 예정)
- Target: Legacy Services (Telnet, FTP)
- 학습 내용: ARP Spoofing, MITM, 서비스 거부 공격 (구현 예정)
License: Apache 2.0