|
| 1 | +--- |
| 2 | +title: 'Installation & Getting Started' |
| 3 | +description: 'Set up your gRPC Goat lab environment and run your first vulnerability test' |
| 4 | +order: 3 |
| 5 | +--- |
| 6 | + |
| 7 | +import { Aside } from 'astro-pure/user' |
| 8 | + |
| 9 | +# Installation & Getting Started |
| 10 | + |
| 11 | +Welcome to gRPC Goat! This guide will help you set up your lab environment and run your first vulnerability test. |
| 12 | + |
| 13 | +<Aside type="tip"> |
| 14 | +**Quick Start**: If you're familiar with Docker, jump to the [Quick Commands](#quick-commands) section to get started immediately. |
| 15 | +</Aside> |
| 16 | + |
| 17 | +## Prerequisites |
| 18 | + |
| 19 | +Before you begin, ensure you have the following tools installed on your system: |
| 20 | + |
| 21 | +### Required Tools |
| 22 | + |
| 23 | +1. **Docker & Docker Compose** |
| 24 | + - Docker Engine 20.10+ or Docker Desktop |
| 25 | + - Docker Compose V2 (comes with Docker Desktop) |
| 26 | + - [Download Docker](https://docs.docker.com/get-docker/) |
| 27 | + |
| 28 | +2. **grpcurl** (for testing gRPC services) |
| 29 | + ```bash |
| 30 | + # Install via Go |
| 31 | + go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest |
| 32 | + |
| 33 | + # Or via Homebrew (macOS) |
| 34 | + brew install grpcurl |
| 35 | + |
| 36 | + # Or via package manager (Ubuntu/Debian) |
| 37 | + sudo apt-get install grpcurl |
| 38 | + |
| 39 | + # Or download binary from GitHub releases |
| 40 | + # https://github.com/fullstorydev/grpcurl/releases |
| 41 | + ``` |
| 42 | + |
| 43 | +### Additional gRPC Testing Tools |
| 44 | + |
| 45 | +**Command Line Tools:** |
| 46 | +- **grpcurl** - Command-line tool for interacting with gRPC services |
| 47 | +- **ghz** - gRPC benchmarking and load testing tool |
| 48 | +- **evans** - Interactive gRPC client with REPL interface |
| 49 | + |
| 50 | +**GUI Applications:** |
| 51 | +- **Postman** - Popular API client with gRPC support (v8.5.0+) |
| 52 | +- **BloomRPC** - Cross-platform gRPC client with GUI interface |
| 53 | +- **Kreya** - Modern gRPC and REST API client |
| 54 | +- **Insomnia** - API client with gRPC support |
| 55 | + |
| 56 | +### Optional Tools |
| 57 | + |
| 58 | +- **Go 1.21+** (if you want to build from source) |
| 59 | +- **Git** (for cloning the repository) |
| 60 | + |
| 61 | +## Installation |
| 62 | + |
| 63 | +### Option 1: Clone from GitHub (Recommended) |
| 64 | + |
| 65 | +```bash |
| 66 | +# Clone the repository |
| 67 | +git clone https://github.com/rootxjs/grpc-goat.git |
| 68 | +cd grpc-goat |
| 69 | + |
| 70 | +# Verify the setup |
| 71 | +ls labs/ # Should show 9 lab directories |
| 72 | +``` |
| 73 | + |
| 74 | +### Option 2: Download Release |
| 75 | + |
| 76 | +Download the latest release from the [GitHub releases page](https://github.com/rootxjs/grpc-goat/releases) and extract it. |
| 77 | + |
| 78 | +## Quick Commands |
| 79 | + |
| 80 | +### Start All Labs at Once |
| 81 | + |
| 82 | +```bash |
| 83 | +# Start all 9 vulnerable services |
| 84 | +docker compose up --build |
| 85 | + |
| 86 | +# Run in background (detached mode) |
| 87 | +docker compose up --build -d |
| 88 | + |
| 89 | +# View logs |
| 90 | +docker compose logs -f |
| 91 | +``` |
| 92 | + |
| 93 | +### Start Individual Labs |
| 94 | + |
| 95 | +```bash |
| 96 | +# Example: Start only Lab 001 (gRPC Reflection) |
| 97 | +cd labs/grpc-001-reflection-enabled |
| 98 | +docker build -t grpc-001 . |
| 99 | +docker run -p 8001:8001 grpc-001 |
| 100 | +``` |
| 101 | + |
| 102 | +## Service Endpoints |
| 103 | + |
| 104 | +Once running, the labs will be available on the following ports: |
| 105 | + |
| 106 | +| Lab | Service | Port | Description | |
| 107 | +|-----|---------|------|-------------| |
| 108 | +| **001** | Service Discovery | `localhost:8001` | gRPC Reflection vulnerability | |
| 109 | +| **002** | Auth Service | `localhost:8002` | Plaintext gRPC communications | |
| 110 | +| **003** | Billing Service | `localhost:8003` | Insecure TLS implementation | |
| 111 | +| **004** | Partner API | `localhost:8004` | Arbitrary mTLS acceptance | |
| 112 | +| **005** | Partner API v2 | `localhost:8005` | mTLS with subject validation bypass | |
| 113 | +| **006** | Admin Service | `grpc-006 container` | Unix socket with world permissions | |
| 114 | +| **007** | User Directory | `localhost:8007` | SQL injection vulnerability | |
| 115 | +| **008** | File Processor | `localhost:8008` | Command injection vulnerability | |
| 116 | +| **009** | Image Preview | `localhost:8009` | Server-Side Request Forgery (SSRF) | |
| 117 | + |
| 118 | +## Your First Lab: Lab 001 - gRPC Reflection |
| 119 | + |
| 120 | +Let's walk through your first vulnerability test to ensure everything is working correctly. |
| 121 | + |
| 122 | +### Step 1: Start Lab 001 |
| 123 | + |
| 124 | +```bash |
| 125 | +# Start Lab 001 specifically |
| 126 | +docker compose up grpc-001 --build |
| 127 | +``` |
| 128 | + |
| 129 | +Wait for the message: `gRPC server listening on :8001` |
| 130 | + |
| 131 | +### Step 2: Test the Service |
| 132 | + |
| 133 | +```bash |
| 134 | +# Discover available services (this is the vulnerability!) |
| 135 | +grpcurl -plaintext localhost:8001 list |
| 136 | + |
| 137 | +# Expected output: |
| 138 | +# grpc.reflection.v1alpha.ServerReflection |
| 139 | +# servicediscovery.ServiceDiscovery |
| 140 | +``` |
| 141 | + |
| 142 | +### Step 3: Exploit the Vulnerability |
| 143 | + |
| 144 | +```bash |
| 145 | +# List methods in the service |
| 146 | +grpcurl -plaintext localhost:8001 list servicediscovery.ServiceDiscovery |
| 147 | + |
| 148 | +# Expected output: |
| 149 | +# servicediscovery.ServiceDiscovery.AdminListAllServices |
| 150 | +# servicediscovery.ServiceDiscovery.ListServices |
| 151 | +``` |
| 152 | + |
| 153 | +### Step 4: Capture Your First Flag |
| 154 | + |
| 155 | +```bash |
| 156 | +# Call the hidden admin method |
| 157 | +grpcurl -plaintext -d '{"admin_token": "fake"}' \ |
| 158 | + localhost:8001 servicediscovery.ServiceDiscovery/AdminListAllServices |
| 159 | +``` |
| 160 | + |
| 161 | +**Congratulations!** You should see a response containing your first flag: `GRPC_GOAT{reflection_enabled_service_discovery}` |
| 162 | + |
| 163 | +## Next Steps |
| 164 | + |
| 165 | +Now that you have your environment set up and have captured your first flag: |
| 166 | + |
| 167 | +1. **Learn gRPC Fundamentals**: If you're new to gRPC, check out the [gRPC Basics](/docs/grpc_goat_docs/grpc-basics) guide |
| 168 | +2. **Explore More Labs**: Check out the [Labs Overview](/docs/grpc_goat_docs/labs) to see all 9 vulnerabilities |
| 169 | +3. **Follow the Walkthrough**: Use the [Walkthrough Guide](/docs/grpc_goat_docs/walkthrough) for step-by-step exploitation instructions |
| 170 | +4. **Learn the Mitigations**: Each lab includes security best practices to prevent these vulnerabilities |
| 171 | +5. **Practice with Different Tools**: Try using Postman, BloomRPC, or other gRPC clients to interact with the services |
| 172 | + |
| 173 | +<Aside type="note"> |
| 174 | +**CTF-Style Learning**: Each lab contains a unique flag that you can capture by successfully exploiting the vulnerability. This gamified approach makes learning gRPC security both engaging and practical. |
| 175 | +</Aside> |
| 176 | + |
| 177 | +Ready to dive deeper? Head to the [Walkthrough Guide](/docs/grpc_goat_docs/walkthrough) to learn how to exploit all 9 vulnerabilities! |
0 commit comments