Print-ready version Back to the article
HMMNM Security
hmmnm.com

Security

Phish Your Own Staff Legally: GoPhish Campaigns, Pixel Tracking and Awareness Metrics Lab

By Prabhu Kalyan Samal | Published 1 December 2026 | 10 min read

https://hmmnm.com/phish-your-own-staff-legally-gophish-campaigns-pixel-tracking-and-awareness-metrics-lab/

10 min read · 1,953 words

TL;DR: You Can Phish Your Own Staff Legally—Here’s How to Do It Safely with GoPhish

Yes—phishing your own employees is legal when you have written authorization, a defined scope, and a purpose of improving security awareness. GoPhish, the open-source phishing simulation framework, lets you run controlled campaigns that measure click rates and report rates against your own staff—without breaking the law. This guide walks you through the full setup: installation, sending profiles, templates, tracking pixels, credential-capture landing pages, and the metrics that actually matter to executives.

Let’s get the uncomfortable truth out of the way first: the same email that gets you a pat on the back as a security awareness lead can get you fired—or prosecuted—without a signature on a document. In the United States, the Computer Fraud and Abuse Act (CFAA) criminalizes unauthorized access to protected computers; in the UK, the Computer Misuse Act 1990 does the same. Social engineering that tricks a user into “authorizing” an action can constitute unauthorized access. Phishing simulations are legal precisely because the organization authorizes them—it’s the authorization that draws the line between a security program and a crime.

Before you build anything in GoPhish, get these in writing:

CISA’s guidance on phishing simulation programs emphasizes transparency and a non-punitive culture—punishing clickers drives reporting underground, which is the opposite of what you want. Traditional penetration testing has a well-established scoping playbook; awareness simulations need the same rigor, just with HR in the room.

GoPhish Lab Setup: Installation and Initial Configuration

GoPhish (current release line: v0.12.1) is a single Go binary with an embedded SQLite database. For a lab, run it on an isolated VM or in Docker—never on a system shared with production credentials.

Binary install is trivial:

wget https://github.com/gophish/gophish/releases/download/v0.12.1/gophish-v0.12.1-linux-64bit.zip
unzip gophish-v0.12.1-linux-64bit.zip -d gophish
cd gophish && chmod +x gophish
./gophish

On first launch, GoPhish generates a random admin password and prints it to the console. The admin interface listens on https://localhost:3333; edit config.json to change listen_url if you need remote access (and use a strong password and TLS if you do). Phishing pages and mail sending run on ports 80/443 and 25 respectively—keep them free.

Change the default admin credentials immediately. A GoPhish instance exposed to the internet is itself a target; there’s no reason your simulation framework should ever be.

Creating Sending Profiles: SMTP, Gmail Relay, and Test Sends

Navigate to Sending Profiles → New Profile. You’ll configure:

Use the Send Test Email button before every campaign—it validates authentication and shows you exactly how headers render. For deliverability, the basics still apply: your sending domain needs valid SPF records authorizing your relay, DKIM signing if you’re going through a provider, and DMARC alignment if you want to demonstrate best practice to your own team. OWASP’s email spoofing guidance is the reference here. For a local lab, skip all of it—MailHog catches everything and teaches you the tool mechanics without touching a real mailbox.

Building Email Templates with Variables and Tracking Pixels

GoPhish templates use Go’s text/template syntax. Recipient fields are injected per-send:

Subject: {{.FirstName}}, your mailbox is at 95% capacity

Hi {{.FirstName}},

Your quota is nearly full. Verify your mailbox to avoid suspension:
{{.URL}}

— IT Service Desk

Available variables include {{.FirstName}}, {{.LastName}}, {{.Email}}, {{.Position}}, {{.TrackingURL}}, and {{.Tracker}}. That last one is the interesting bit for this tutorial: GoPhish’s tracking pixel works by injecting a 1×1 transparent image served from a unique URL—your GoPhish server’s /track endpoint combined with the recipient’s Result ID. When the mail client renders the image, the HTTP GET hits your server, which correlates the request to the specific recipient and logs an Email Opened event. No JavaScript, no cookies—just an image beacon, the same mechanism commercial trackers have used for decades.

Caveat: image proxying by Gmail and Outlook can fire the pixel before a human ever sees the message, inflating open rates. Treat opens as directional, not gospel—clicks and reports are the metrics you defend in a boardroom.

Crafting a Landing Page with Credential Capture

Under Landing Pages → New Page, you can paste HTML or use Import Site to clone a page by URL (this fetches the HTML and rewrites forms to point at GoPhish). Then decide what to capture:

Here’s the professional standard: never store real passwords. Capture flags alone are usually sufficient to prove the click-and-submit event; if you enable password capture for demonstration purposes, encrypt the database, purge it after the campaign window, and document the purge. An awareness program that creates a credential-hoard liability has failed its own risk assessment.

Setting Up Users and Groups

Users & Groups is where you manage targets. CSV import accepts First Name, Last Name, Email, Position, Department. Tag groups by cohort—engineering-q1, finance-newhires—because segmentation is what turns raw click data into insight. A finance team hit with a fake invoice lure tells you something an org-wide blended rate never will. Keep pilot populations separate from campaign populations so your first clumsy run doesn’t poison your baseline.

Launching Your First Campaign and Launch Schedule

Campaigns → New Campaign pulls it together: name, SMTP profile, template, landing page, target group, URL (the link recipients click, pointing at your GoPhish host), and launch date. GoPhish supports scheduled launches and throttles sending so you don’t dump 2,000 emails into a mail gateway in three seconds and get the whole domain flagged. Launch it and watch the real-time dashboard: Email Sent, Opened, Clicked, Submitted, Reported events stream in live. For a first run, keep it small—20 to 50 targets, a benign lure, immediate redirect to a training page.

Measuring What Matters: Click Rate vs Report Rate

Every recipient generates a Result with a lifecycle of events. The four rates you’ll compute:

Click rate tells you how many people fell for it. Report rate tells you how many people noticed. A user who clicks and then reports it has done exactly what modern training asks: suspicious, engaged anyway, escalated anyway. The ratio that should headline your dashboard is reports ÷ (reports + clicks)—of all suspect interactions, how many did your staff catch without your simulation’s help?

Building a Reporting Awareness Metric That Executives Understand

One campaign tells you almost nothing. Trend lines across four or more campaigns tell a story: click rate declining quarter over quarter, report rate climbing, submission rate approaching zero. That trajectory is your maturity signal. The click-to-report ratio falling over time means detection is shifting from “someone in IT noticed” to “everyone noticed.” Pair this with external framing—CISA’s phishing guidance and the SANS security awareness maturity models give you vocabulary executives already trust.

Avoid vanity metrics ruthlessly. “97% of staff completed training” means nothing if the click rate didn’t move. Completion is an input; behavior change is the output.

Hands-On Lab: Full Command Walkthrough with Docker

docker pull gophish/gophish
docker run -d --name gophish -p 3333:3333 -p 80:80 -p 25:25 gophish/gophish
docker logs gophish 2>&1 | grep "Please login"

Expected output on first boot:

[INFO] Please login with the credentials admin / <random-16-char-password>

Grab campaign results via the API (create an API key under Settings):

curl -sk -H "Authorization: Bearer $GOPHISH_API_KEY" 
  https://localhost:3333/api/campaigns/1/results

Expected response shape:

{
  "first_name": "Dana",
  "last_name": "Reyes",
  "email": "d.reyes@corp.local",
  "status": "Clicked",
  "reported": false,
  "send_date": "2025-01-14T09:00:00Z",
  "results": [{"label": "Clicked", "time": "2025-01-14T09:04:12Z"}]
}

Pull that JSON per campaign, and your awareness dashboard is a 40-line Python script away.

Common Pitfalls, Ethics, and Next Steps

Three failure modes sink awareness programs:

For deepening your red-team skills beyond awareness sims, CTF-style practice ranges and hands-on labs in adjacent domains—like our XSS and server-side template injection walkthroughs—sharpen the same email-to-web attack chain thinking that phishing exploits.

Phish your own staff. Do it legally, do it kindly, measure what matters—and let the report rate, not the click rate, tell you whether the program is working.

Frequently Asked Questions

Yes, with explicit written authorization from leadership and a defined scope covering populations, scenarios, and data handling. Without that authorization, the same activity may violate computer misuse laws such as the CFAA in the US or the Computer Misuse Act 1990 in the UK. Get legal and HR sign-off before your first send.

Does GoPhish store passwords entered on fake landing pages?

Only if you enable Capture Passwords on the landing page. Capture Submitted Data flags alone are usually sufficient evidence of a failed simulation. If you do capture passwords, encrypt the database, restrict access, and purge the data immediately after the campaign—never reuse or log captured credentials anywhere.

How does the GoPhish tracking pixel work?

GoPhish injects a 1×1 transparent image into every email, served from the recipient’s unique tracking URL (the {{.Tracker}} variable). When the mail client renders the image, the HTTP request hits GoPhish’s tracking endpoint, which correlates the Result ID and records an Email Opened event. Because image proxies can preload pixels, treat open rates as directional.

What is a good report rate for phishing simulations?

Trends matter more than absolutes. A rising report rate paired with a falling click rate across successive campaigns indicates improving awareness, regardless of the starting number. Compare cohorts against their own baselines rather than industry benchmarks, and track the click-to-report ratio as your headline maturity metric.

Can I run GoPhish campaigns from Gmail?

Yes—create an SMTP sending profile pointing at smtp.gmail.com:587 with an app password. But Gmail imposes volume limits and will not let you spoof arbitrary sender domains, which limits scenario realism. Local SMTP through MailHog or your own mail server is better for labs and controlled internal tests.

HMMNM Security · Independent security research and education · hmmnm.com
Printed from https://hmmnm.com/phish-your-own-staff-legally-gophish-campaigns-pixel-tracking-and-awareness-metrics-lab/
© 2026 HMMNM Security. For personal and internal team use. Please link to the original article when sharing.