mitm-domainfronting
```markdown
What this skill does
```markdown
---
name: mitm-domainfronting
description: MITM proxy that receives unencrypted traffic locally then forwards it via Domain Fronting using Xray-core, enabling access to restricted services without a traditional proxy server.
triggers:
- set up MITM domain fronting
- configure xray domain fronting
- bypass censorship with domain fronting
- MITM proxy with self-signed certificate
- xray MITM configuration
- domain fronting without server
- access google services with domain fronting
- set up v2rayN domain fronting
---
# MITM-DomainFronting
> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
## What This Project Does
MITM-DomainFronting is a technique (not a traditional proxy server) that:
1. **Intercepts** unencrypted HTTPS traffic locally using a Man-in-the-Middle (MITM) setup with a self-signed certificate
2. **Re-sends** that traffic to the real destination using a fake/fronted SNI (Server Name Indication), bypassing censorship/firewalls
This works **without a remote proxy server** — it uses Xray-core's built-in MITM and Domain Fronting features. Currently enables access to Google services (Meet, Drive, etc.) from restricted regions.
**What it cannot do:**
- Fully replace a VPN or proxy for general internet access
- Access YouTube videos (separate service infrastructure)
- Access Gemini (Iran IPs are sanctioned)
---
## Architecture Overview
```
Browser (HTTPS) → [MITM: fake cert intercepts, decrypts] → [Domain Fronting: re-encrypts with fronted SNI] → Google Servers
```
- **MITM layer**: Xray acts as a TLS terminator using your self-signed certificate
- **Domain Fronting layer**: Xray re-establishes TLS to the real server using a CDN-friendly SNI
---
## Prerequisites
- **Windows**: v2rayN + Xray-core
- **Android**: v2rayNG with HEV TUN enabled
- **Linux/macOS**: Xray-core directly
- A self-signed certificate (`.crt` + `.key`)
---
## Step 1: Generate a Self-Signed Certificate (Windows)
Use the provided `certificate-generator.bat` in the `v2rayN-windows-64\bin` folder:
```bat
@echo off
REM certificate-generator.bat
REM Place this in v2rayN-windows-64\bin and run it there
openssl req -x509 -newkey rsa:4096 -keyout mycert.key -out mycert.crt -sha256 -days 3650 -nodes -subj "/C=US/ST=State/L=City/O=Org/CN=localhost"
echo Done! mycert.crt and mycert.key created.
pause
```
> ⚠️ **Security Warning**: Never share your `mycert.key` (private key) with anyone. Never use someone else's `mycert.crt`. Always generate your own.
**Alternative (online generator for Android)**:
Use https://regery.com/en/security/ssl-tools/self-signed-certificate-generator — download both files and rename them to `mycert.crt` and `mycert.key`.
---
## Step 2: Install the Certificate as Trusted Root
### Windows (System-wide)
1. Right-click `mycert.crt` → **Install Certificate**
2. Select **Local Machine**
3. Choose **Place all certificates in the following store**
4. Select **Trusted Root Certification Authorities**
5. Confirm
### Windows (Chrome only)
```
Settings → Privacy and security → Security → Manage certificates →
Manage imported certificates from Windows → Trusted Root Certification Authorities →
Import → Select mycert.crt → Place all certificates in the following store →
Select "Trusted Root Certification Authorities"
```
### Android (Non-root)
```
Settings → Security and privacy → More security settings →
Install from device storage → CA Certificate → Install anyway →
Select mycert.crt
```
Verify installation:
```
Settings → Security and privacy → More security settings →
View security certificates → User
```
### Android Firefox (additional step)
```
firefox → Settings → About Firefox → Tap logo 5 times →
Settings → Secret Settings → Toggle "Use third party CA certificates"
```
---
## Step 3: Core Configuration File
The main config file `MITM-DomainFronting.json` for Xray-core:
```json
{
"log": {
"loglevel": "warning"
},
"inbounds": [
{
"tag": "http-in",
"port": 10809,
"protocol": "http",
"settings": {
"allowTransparent": true
},
"sniffing": {
"enabled": true,
"destOverride": ["http", "tls"]
}
}
],
"outbounds": [
{
"tag": "mitm-out",
"protocol": "freedom",
"settings": {}
}
],
"policy": {
"levels": {
"0": {
"handshakeMitm": true
}
}
},
"mitm": {
"enabled": true,
"listenPort": 10810,
"certFile": "mycert.crt",
"keyFile": "mycert.key",
"domainFronting": {
"enabled": true,
"frontDomain": "www.googleapis.com",
"targetDomain": "www.google.com"
}
}
}
```
> **Note**: File paths for `certFile` and `keyFile` are relative to the Xray binary location (i.e., `v2rayN-windows-64\bin\`).
---
## Step 4: v2rayN Setup (Windows)
1. Download latest [v2rayN](https://github.com/2dust/v2rayN/releases) (`v2rayN-windows-64.zip`)
2. Extract it
3. Copy `certificate-generator.bat`, `mycert.crt`, `mycert.key`, and `MITM-DomainFronting.json` into `v2rayN-windows-64\bin\`
4. Open v2rayN → **Configuration** → **Add a custom configuration**
5. Set:
- **Name**: anything descriptive
- **Config file**: `MITM-DomainFronting.json`
- **Core type**: `xray`
- **Socks port**: leave empty
6. Select the config → **Set system proxy**
---
## Step 5: v2rayNG Setup (Android)
1. Install latest [v2rayNG](https://github.com/2dust/v2rayNG/releases)
2. Go to **Asset files** → Import both `mycert.crt` and `mycert.key`
3. Import `MITM-DomainFronting.json` via **Import from locally**
4. Enable **HEV TUN FEATURE** in v2rayNG settings
5. Connect
> ⚠️ On non-rooted Android, only browser-based access works. Standalone apps (Google Meet app, Drive app) won't use this tunnel — use the browser versions instead.
---
## Running Xray Directly (Linux/macOS)
```bash
# Place mycert.crt, mycert.key, and MITM-DomainFronting.json in the same directory as xray binary
# Download xray
wget https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-64.zip
unzip Xray-linux-64.zip -d xray-bin
cd xray-bin
# Copy your cert files here
cp /path/to/mycert.crt .
cp /path/to/mycert.key .
cp /path/to/MITM-DomainFronting.json .
# Run
./xray run -config MITM-DomainFronting.json
```
Set system proxy to `http://127.0.0.1:10809` in your OS network settings.
---
## Common Patterns
### Verify the certificate is trusted
```bash
# Linux/macOS
openssl verify -CAfile mycert.crt mycert.crt
# Should output: mycert.crt: OK
```
### Check Xray is running and listening
```bash
# Check port is open
netstat -an | grep 10809
# or
ss -tlnp | grep 10809
```
### Test connectivity through the proxy
```bash
# Set proxy and test Google
curl -x http://127.0.0.1:10809 https://www.google.com -v
```
### Generate cert with specific domain SANs (advanced)
```bat
REM certificate-generator-advanced.bat
openssl req -x509 -newkey rsa:4096 ^
-keyout mycert.key ^
-out mycert.crt ^
-sha256 -days 3650 -nodes ^
-subj "/CN=*.google.com" ^
-addext "subjectAltName=DNS:*.google.com,DNS:*.googleapis.com,DNS:*.gstatic.com"
```
---
## Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
| Browser shows certificate error | Certificate not installed as trusted root | Re-do Step 2; verify in cert manager |
| Google Meet/Drive won't load | Wrong fronting domain | Check `frontDomain` in config matches a CDN endpoint |
| Android apps don't work | Non-root limitation | Use browser instead of native apps |
| `mycert.crt not found` error | Wrong working directory | Ensure cert files are in same folder as xray binary |
| Connection refused on port 10809 | Xray not running | Check xray process; check for port conflicts |
| YouTube videos don't work | Separate CDN infrastructure | Not supported by this method |
| Gemini doesn't work | IP sanctions | Not supported from Iran IPs |
### Enable debug logging
```json
{
"log": {
"loglevel": "debug",
"access": "access.log",
"error": "errorRelated in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.