Files
phishtest/CLAUDE.md
2025-12-31 06:07:37 -06:00

1.6 KiB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Purpose

Phishtest is a phishing email testing tool for evaluating Proofpoint TAP (Targeted Attack Protection) systems. It sends test phishing emails via SMTP2GO API to assess email security controls.

Commands

# Activate virtual environment
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run CLI commands
python -m src.main list-templates
python -m src.main preview --template <name>
python -m src.main send --template <name> --to <email>
python -m src.main send --template <name> --csv <file.csv>

Architecture

src/
├── main.py           # Click CLI - entry point, command definitions
├── config.py         # Environment config loading via python-dotenv
├── template_loader.py # Jinja2 template loading/rendering from templates/
├── csv_loader.py     # CSV recipient parsing with email validation
└── email_sender.py   # SMTP2GO API wrapper using smtp2go library

Data flow: CLI → loads config → loads template → loads recipients → renders template per recipient → sends via smtp2go

Template System

Templates live in templates/<name>/ with:

  • metadata.json - subject, sender_name
  • template.html - Jinja2 HTML body
  • template.txt - Jinja2 plain text body

Variables: {{recipient_name}}, {{recipient_email}}, {{company_name}}, {{date}}

Key Dependencies

  • smtp2go - Official SMTP2GO Python library for email sending
  • click - CLI framework
  • jinja2 - Template rendering
  • python-dotenv - Environment variable loading