技能 编程开发 使用GoPhish自动化钓鱼模拟

使用GoPhish自动化钓鱼模拟

v20260601
performing-red-team-phishing-with-gophish
本技能提供了一套完整的自动化解决方案,用于使用Python gophish库执行红队钓鱼模拟。它简化了整个活动周期,包括创建带跟踪像素的邮件模板、配置SMTP、导入目标用户组、发起定向攻击,并生成关于打开率、点击率和凭证提交统计数据的详细报告,从而支持全面的安全意识评估。
获取技能
173 次下载
概览

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.
# 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

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)
信息
Category 编程开发
Name performing-red-team-phishing-with-gophish
版本 v20260601
大小 8.73KB
更新时间 2026-06-03
语言