惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
WordPress大学
WordPress大学
S
SegmentFault 最新的问题
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
The Cloudflare Blog
L
LangChain Blog
博客园 - 司徒正美
G
Google Developers Blog
博客园 - 【当耐特】
GbyAI
GbyAI
月光博客
月光博客
人人都是产品经理
人人都是产品经理
D
DataBreaches.Net
大猫的无限游戏
大猫的无限游戏
A
About on SuperTechFans
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
D
Docker
MongoDB | Blog
MongoDB | Blog
Vercel News
Vercel News
Stack Overflow Blog
Stack Overflow Blog
Jina AI
Jina AI
博客园 - 聂微东

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Evaluating Open-Weight LLMs for Phishing Simulation and R...
Jeff J. Bowi · 2026-04-23 · via DEV Community

Jeff J. Bowie

Disclaimer: This content is for educational and authorized security testing in controlled environments only. Do not use any techniques described here against systems you do not own or lack explicit permission to test. Unauthorized use is strictly prohibited.

Introduction

Scenario: You're tasked with performing an ad-hoc phishing engagement by your CISO, for a client with over 1,000+ users...

It's easy to hypothesize creating inbound e-mail filtering logic: 'If more than 10 e-mails with the exact same body are sent to X users within X seconds, flag the e-mail as malicious, and notify the SIEM!'.

During a phishing engagement, we want to cover a large surface area, while simultaneously blending in with routine traffic. Large language models provide polymorphic phishing lures.

It's impossible to know exactly what occurs in the environment on the other side of an engagement, but we can use open-source and human (HUMINT) intelligence gathering to improve our odds.

Organizations often rely on a combination of one or more of the following services: AWS, Microsoft Azure, Google Cloud Platform (GCP), Dropbox, or Slack. Crafting your lure guided by the design, phrasing, and timing of legitimate messages from a major provider is often an easy in.

Seasoned developers using frontier labs' LLMs reported experienced instances of the model suddenly 'playing stupid', or 'throttling'. For consistency and reproducibility, open-weight models are preferable in red team workflows.

We will be working with open-weights models. Open-weights models are those for which the trained model parameters (weights) are publicly released and available for download. Although our output is non-deterministic, the underlying weights remain fixed for a given version.

Configuration

At the time of this writing, artificial intelligence models have a plethora of modalities, yet typically classify as either Generative or Agentic. For our purposes, let's head over to HuggingFace to find a Text Generation model.

As you can see, there are over 352,721 models for generating text. Examining the model card will allow you to find various quantizations, which are reduced-precision models for use on devices with less compute power.

Let's download llama.cpp and a quantized 0.6B parameter version of Qwen3, Qwen3-0.6B-Q6_K.gguf (495mb) saving the file to your local workspace.

Once you've installed llama.cpp and downloaded the GGUF, initiate a CLI session with the following command:
./llama-cli --model Qwen3-0.6B-Q6_K.gguf.

Ah! We've successfully created our lure. Only issue, is we have over 1,000+ users to target, and a limited time window for attack. Let's use a while loop in Python3, to continually prompt the model to generate our lures.

Note: Since Qwen3 is a Reasoning model, we will need to instruct our script to omit the content of <think> tags, while looping over the same prompt to generate unique variations of our lure:

Utilization

from llama_cpp import Llama
import re

# Create a Llama instance, disabling verbosity.
llm = Llama(
    model_path = "./Qwen3-0.6B-Q6_K.gguf",
    verbose = False
)

# Our templates' template. 
prompt = "Write a friendly, convincing e-mail template using descriptive words, about an issue with an account lock-out, and advise the recipient to take action immediately by clicking on a link."

# Create 10 uniquely-worded phishing lures.
for i in range(0, 10):
    response = llm.create_chat_completion(
        messages=[
            # Disable 'thinking' mode.
            {"role": "system", "content": "/no_think"},

            {"role": "user", "content": prompt},
        ],
        # A parameter that controls the randomness, creativitiy, and predictability of generated text. Lower temperatures (0.0 - 0.3) are more conservative and deterministic, while high temperatures (0.7-1.0+) generate more varied, creative, or chaotic output.  
        temperature=0.9,
    )

    content = response['choices'][0]['message']['content'].strip()
    cleaned = re.sub(r"</?think>", "", content)

    print(cleaned, "\n")
    print("-" * 40)

Enter fullscreen mode Exit fullscreen mode

Note: While I'm using a Regular Expression to clean the output here, in a production pipeline you'd want to use stop sequences like ['</think>'] to save on inference costs. Artificial Intelligence requires effective resource management to generate a solid ROI.

At this junction, we can choose to write generated lures to a text file with open(), store them in a MySQL database, or my personal favorite - automatic template creation for GoPhish!

© 2026 Cybersecurity & DFIR: An Adversarial Simulation Perspective