Skip to main content
NEW · APP STORE Now on iOS · macOS · iPad Android & Windows soon GET IT
Prompts GoPhish Python Phishing Campaign Automation

agent security skill risk: medium

GoPhish Python Phishing Campaign Automation

Instructs on automating GoPhish phishing simulation campaigns using the Python gophish library, including creating email templates, configuring SMTP profiles, importing target grou…

  • Policy sensitive
  • Human review
  • External action: medium

SKILL 4 files · 2 folders

SKILL.md
---
name: performing-red-team-phishing-with-gophish
description: "Automate GoPhish phishing simulation campaigns using the Python gophish library. Creates email templates with"
---
## When to Use

- When conducting security assessments that involve performing red team phishing with gophish
- When following incident response procedures for related security events
- When performing scheduled security testing or auditing activities
- When validating security controls through hands-on testing

## Prerequisites

- Familiarity with security operations concepts and tools
- Access to a test or lab environment for safe execution
- Python 3.8+ with required dependencies installed
- Appropriate authorization for any testing activities

## Instructions

1. Install dependencies: `pip install gophish requests`
2. Deploy GoPhish server and obtain an API key from Settings.
3. Use the Python gophish library to automate campaign setup:
   - Create email templates with HTML body and tracking
   - Configure SMTP sending profiles
   - Import target groups from CSV
   - Create landing pages for credential capture
   - Launch and monitor campaigns
4. Analyze campaign results: opens, clicks, submitted data, reported.

```bash
# For authorized penetration testing and lab environments only
python scripts/agent.py --gophish-url https://localhost:3333 --api-key <key> --campaign-name "Q1 Awareness" --output phishing_report.json
```

## Examples

### Create Campaign via API
```python
from gophish import Gophish
from gophish.models import Campaign, Template, Group, SMTP, Page
api = Gophish("api_key", host="https://localhost:3333", verify=False)  # Self-signed cert on localhost lab
campaign = Campaign(name="Q1 Test", groups=[Group(name="Sales Team")],
    template=Template(name="IT Password Reset"), smtp=SMTP(name="Internal SMTP"),
    page=Page(name="Credential Page"))
api.campaigns.post(campaign)
```

REQUIRED CONTEXT

  • GoPhish server URL
  • API key
  • authorization for testing

OPTIONAL CONTEXT

  • campaign name
  • target CSV

EXPECTED OUTPUT

Format
markdown
Constraints
  • include installation steps
  • include Python code examples
  • include bash command example

EXAMPLES

Includes one Python code example demonstrating campaign creation via the gophish library.

CAVEATS

Dependencies
  • Python 3.8+ with required dependencies installed
  • GoPhish server and API key
  • Appropriate authorization for testing activities
  • Test or lab environment
Missing context
  • Full working code for CSV import, landing page creation, and result analysis
  • Error handling and verification steps for the API calls
Ambiguities
  • Description is truncated: "Creates email templates with"
  • "Analyze campaign results: opens, clicks, submitted data, reported." is incomplete

QUALITY

OVERALL
0.58
CLARITY
0.65
SPECIFICITY
0.50
REUSABILITY
0.60
COMPLETENESS
0.55

IMPROVEMENT SUGGESTIONS

  • Complete the truncated description sentence in the YAML header.
  • Expand the numbered instructions into concrete, copy-pasteable code snippets for each bullet.

USAGE

Copy the prompt above and paste it into your AI of choice — Claude, ChatGPT, Gemini, or anywhere else you're working. Replace any placeholder sections with your own context, then ask for the output.

MORE FOR AGENT