A small Go utility (with an optional HTTP server) to decode URLs rewritten by Proofpoint's URL Defense. Supports v1, v2, and v3 formats.
- CLI mode: Decode one or more URLs passed on the command line
- Server mode: Run an HTTP server with a web interface
- Mobile-optimized: Automatic mobile detection with responsive design
- JSON API: RESTful endpoint for programmatic access
- Dark mode: Toggle between light and dark themes
- Copy to clipboard: Click decoded URLs to copy them
- Supports Proofpoint URL Defense versions v1, v2, and v3
- Automatically handles HTML and URL escaping
- Go 1.21+
github.com/akamensky/argparse- (Optional) Any modern web browser for server mode
- (Optional) Docker for containerized deployment
git clone https://github.com/nhdewitt/proofpoint-url-decoder.git
cd proofpoint-url-decoder
go build -o proofpoint-decoderThis will produce the proofpoint-decoder binary in the current directory.
Build the Docker image:
docker build -t proofpoint-decoder .Decode a single URL:
./proofpoint-decoder -u "https://urldefense.proofpoint.com/v1/url?u=https%3A%2F%2Fexample.com%2F&k=ABC123"Output:
https://example.com/
Decode multiple URLs:
./proofpoint-decoder -u "<url1>" -u "<url2>" -u "<url3>"Start the HTTP server (default port 8089):
./proofpoint-decoder -sThe server will use the port specified in config.json if present, or default to 8089.
Run the server in a Docker container:
# Run once
docker run -p 8089:8089 proofpoint-decoder
# Run in background
docker run -d -p 8089:8089 proofpoint-decoder
# Run with auto-restart on boot
docker run -d --name proofpoint-decoder --restart=unless-stopped -p 8089:8089 proofpoint-decoderCreate a docker-compose.yml file:
version: '3.8'
services:
proofpoint-decoder:
image: proofpoint-decoder
container_name: proofpoint-decoder
restart: unless-stopped
ports:
- "8089:8089"
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8089"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40sThen run:
docker-compose up -dThe web interface provides:
- Desktop view: Multi-URL form with results display at http://localhost:8089
- Mobile view: Optimized single-URL interface (auto-detected or at
/m) - Dark mode: Toggle in the top-right corner
- Copy functionality: Click any decoded URL to copy it to clipboard
The server also provides a REST API endpoint:
curl -X POST http://localhost:8089/api/decode \
-H "Content-Type: application/json" \
-d '{
"urls": [
"https://urldefense.proofpoint.com/v1/url?u=https%3A%2F%2Fexample.com%2F&k=ABC123",
"https://urldefense.proofpoint.com/v2/url?u=https-3A__example.org&d=..."
]
}'Response:
{
"results": ["https://example.com/", "https://example.org"],
"errors": ["", ""]
}You can also use the Docker container in CLI mode:
docker run --rm proofpoint-decoder ./proofpoint-decoder -u "your-encoded-url-here"The server reads configuration from config.json if present:
{
"port": "8089"
}If no config file is found, it defaults to port 8089.
URLs matching /v1/u=<url-encoded>&k=...
URLs matching /v2/u=<modified‑base64>&[d|c]=...
(uses - → %, _ → /)
URLs matching /v3/__<url>__;...!
with embedded Base64‑URL‑encoded token bytes
To automatically start the Docker container on system boot:
docker run -d --name proofpoint-decoder --restart=unless-stopped -p 8089:8089 proofpoint-decoderThe --restart=unless-stopped policy will:
- Restart the container if it crashes
- Restart the container when the system reboots
- Not restart if you manually stop it with
docker stop
├── main.go # CLI entry point
├── server.go # HTTP server setup
├── handlers.go # HTTP handlers
├── url-defense-decoder.go # Core decoding logic
├── config.json # Server configuration
├── templates/ # HTML templates
│ ├── form.html # Desktop form
│ ├── result.html # Desktop results
│ ├── mobile_form.html # Mobile form
│ └── mobile_result.html # Mobile results
├── static/ # Static assets
│ ├── css/ # Stylesheets
│ └── js/ # JavaScript
└── internal/config/ # Configuration loading
go test ./...# Linux
GOOS=linux GOARCH=amd64 go build -o proofpoint-decoder-linux
# Windows
GOOS=windows GOARCH=amd64 go build -o proofpoint-decoder.exe
# macOS
GOOS=darwin GOARCH=amd64 go build -o proofpoint-decoder-macosThis tool is based on urldecoder.py by Eric Van Cleve, licensed under GPLv3.
This project is licensed under the GNU General Public License v3.0.