PoC: Special character escape attempt

This commit is contained in:
Illia Chub 2022-01-11 10:14:22 +02:00
parent 2f282b1fd0
commit 2100dbf786

View file

@ -28,17 +28,13 @@ steps:
from_secret: DOMAIN from_secret: DOMAIN
ZONE_ID: ZONE_ID:
from_secret: ZONE_ID from_secret: ZONE_ID
machineip: >
curl -s \
-H "Authorization: Bearer $PASSWORD" \
'https://api.hetzner.cloud/v1/servers' > .machine.json \
for i in {0..24}; do jq 'if .servers['$i'].name == "ci-sibling" then .servers['$i'].public_net.ipv4.ip else null end' .machine.json; done | grep -v null | sed 's/"//' | sed 's/"//'
commands: commands:
- >
curl -s
-H "Authorization: Bearer $PASSWORD"
'https://api.hetzner.cloud/v1/servers' > .machine.json
- >
export machineip=$( for i in {0..24}; do jq 'if .servers['$i'].name == "ci-sibling" then .servers['$i'].public_net.ipv4.ip else null end' .machine.json; done | grep -v null | sed 's/"//' | sed 's/"//' )
- >
echo $DOMAIN
- >
echo $machineip
- > - >
curl -s -X GET "https://api.cloudflare.com/client/v4/zones?name=$DOMAIN" curl -s -X GET "https://api.cloudflare.com/client/v4/zones?name=$DOMAIN"
-H "Authorization: Bearer $CLOUDFLARE_TOKEN" -H "Authorization: Bearer $CLOUDFLARE_TOKEN"
@ -47,7 +43,7 @@ steps:
curl -s -X POST "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records" curl -s -X POST "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records"
-H "Authorization: Bearer $CLOUDFLARE_TOKEN" -H "Authorization: Bearer $CLOUDFLARE_TOKEN"
-H "Content-Type: application/json" -H "Content-Type: application/json"
--data '{"type":"A","name":"$DOMAIN","content":"'$machineip'","ttl":3600,"priority":10,"proxied":false}' --data '{"type":"A","name":"$DOMAIN","content":"'"$machineip"'","ttl":3600,"priority":10,"proxied":false}'
- > - >
curl -s -X POST "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records" curl -s -X POST "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records"
-H "Authorization: Bearer $CLOUDFLARE_TOKEN" -H "Authorization: Bearer $CLOUDFLARE_TOKEN"