
블랙박스 방식의 쿠버네티스 공격 표면 탐지 도구로, 서명 기반 스캐닝을 통해 보안이 설정되지 않은 클러스터, 노출된 대시보드, 잘못된 구성을 찾아냅니다.
KubeStalk은 블랙박스 관점에서 Kubernetes 및 관련 인프라의 공격 표면을 발견하는 도구입니다. 이 도구는 Project Resonance - Wave 9 동안 인터넷에서 보안되지 않은 Kubernetes 클러스터를 탐색하는 데 사용된 도구의 커뮤니티 버전입니다.
아래 GIF는 도구 사용법을 보여줍니다:

KubeStalk은 Python으로 작성되었으며 requests 라이브러리가 필요합니다.
도구를 설치하려면 저장소를 원하는 디렉토리에 클론하면 됩니다:
git clone https://github.com/redhuntlabs/kubestalk
클론한 후에는 python3 -m pip install requests를 사용하여 requests 라이브러리를 설치하거나:
python3 -m pip install -r requirements.txt
모든 설정이 완료되었으며 도구를 바로 사용할 수 있습니다.
도구에서 지원하는 명령줄 인자 목록은 -h 플래그를 사용하여 확인할 수 있습니다.
$ python3 kubestalk.py -h
+---------------------+
| K U B E S T A L K |
+---------------------+ v0.1
[!] KubeStalk by RedHunt Labs - A Modern Attack Surface (ASM) Management Company
[!] Author: 0xInfection (RHL Research Team)
[!] Continuously Track Your Attack Surface using https://redhuntlabs.com/nvadr.
usage: ./kubestalk.py <url(s)>/<cidr>
Required Arguments:
urls List of hosts to scan
Optional Arguments:
-o OUTPUT, --output OUTPUT
Output path to write the CSV file to
-f SIG_FILE, --sig-dir SIG_FILE
Signature directory path to load
-t TIMEOUT, --timeout TIMEOUT
HTTP timeout value in seconds
-ua USER_AGENT, --user-agent USER_AGENT
User agent header to set in HTTP requests
--concurrency CONCURRENCY
No. of hosts to process simultaneously
--verify-ssl Verify SSL certificates
--version Display the version of KubeStalk and exit.
도구를 사용하려면 스크립트에 하나 이상의 호스트를 전달하면 됩니다. 도구에 전달되는 모든 대상은 RFC 3986을 준수해야 합니다. 즉, 스키마와 호스트명(필요 시 포트)을 포함해야 합니다.
기본 사용법은 아래와 같습니다:
$ python3 kubestalk.py https://███.██.██.███:10250
+---------------------+
| K U B E S T A L K |
+---------------------+ v0.1
[!] KubeStalk by RedHunt Labs - A Modern Attack Surface (ASM) Management Company
[!] Author: 0xInfection (RHL Research Team)
[!] Continuously Track Your Attack Surface using https://redhuntlabs.com/nvadr.
[+] Loaded 10 signatures to scan.
[*] Processing host: https://███.██.██.██:10250
[!] Found potential issue on https://███.██.██.██:10250: Kubernetes Pod List Exposure
[*] Writing results to output file.
[+] Done.
HTTP 요청은 -t(HTTP 타임아웃 설정), -ua(사용자 정의 User-Agent 지정), --verify-ssl(요청 시 SSL 인증서 검증) 플래그를 사용하여 세부 조정할 수 있습니다.
--concurrency 플래그를 사용하여 동시에 스캔할 호스트 수를 제어할 수 있습니다. 기본값은 5로 설정되어 있습니다.
출력은 CSV 파일로 작성되며 --output 플래그로 제어할 수 있습니다.
CSV 출력을 마크다운으로 렌더링한 샘플은 다음과 같습니다:
이 도구는 BSD 3-Clause License에 따라 라이선스가 부여되며 현재 v0.1입니다.
| host | path | issue | type | severity |
|---|
https://█.█.█.█:10250 | /pods | Kubernetes Pod List Exposure | core-component | vulnerability/misconfiguration |
https://█.█.█.█:443 | /api/v1/pods | Kubernetes Pod List Exposure | core-component | vulnerability/misconfiguration |
http://█.█.██.█:80 | / | etcd Viewer Dashboard Exposure | add-on | vulnerability/exposure |
http://██.██.█.█:80 | / | cAdvisor Metrics Web UI Dashboard Exposure | add-on | vulnerability/exposure |