LLM & AI Penetration Testing
00. Architecture Mental Model
+---------------------------------------------------------------------------------------+
| LLM Application Data Flow |
+---------------------------------------------------------------------------------------+
| [Attack Surfaces] |
| Chat / Ticket / Email / PDF / Web Page / Repo / Image / Audio / MCP Tool Output |
| | |
| v |
| System Prompt + Developer Prompt + Memory + Retrieved Context + User Input |
| | |
| v |
| LLM / Guardrail / Router / Agent Planner |
| | | | |
| v v v |
| RAG / VectorDB Tools/APIs Code Exec / Browser / Shell |
| Knowledge Base MCP Servers Plugins / Webhooks |
| | | | |
| +------+-------+--------------+ |
| v |
| Final Output / DB Write / Email / Webhook / Ticket / File / Command |
+---------------------------------------------------------------------------------------+
HIGH IMPACT REQUIRES ANY OF:
- LLM has access to private/sensitive data (RAG, memory, tool reads)
- LLM can call tools / APIs / send emails / modify state
- LLM output is rendered or executed by another system
- LLM can persist memory across users/sessions
- LLM consumes attacker-controlled external content (indirect injection)00.1 Severity / CVSS Rating Guide
00.2 Master Payload Reference
01. Recon & Enumeration
01.1 Discover AI Endpoints
01.2 Model & Provider Fingerprinting
01.3 Tool Inventory Probes
02. Direct Prompt Injection
02.1 Basic Override Payloads
02.2 Instruction Hierarchy Confusion
02.3 Format Smuggling
02.4 Multi-Turn Crescendo Attack
03. System Prompt Leakage (LLM07)
03.1 Direct Extraction Payloads
03.2 Indirect / Covert Extraction
03.3 PLeak / Reconstruction Technique
04. Indirect Prompt Injection (LLM01 - Priority Attack)
04.1 Web Page Injection
04.2 Document / RAG Injection
04.3 Email / Ticket Injection
04.4 Invisible Unicode Tag Injection
04.5 Full Attack Chain: Indirect Injection to Data Exfil
05. Jailbreaking
05.1 Classic Templates
05.2 Skeleton Key (Microsoft, June 2024)
05.3 Many-Shot Jailbreaking (Anthropic, April 2024)
05.4 Payload Encoding / Obfuscation Bypass
05.5 Automated / Optimization-Based Jailbreaks
06. Agentic & Tool Abuse (LLM06 / LLM05)
06.0 Tool Access Mental Model
06.1 Tool Inventory & Parameter Fuzzing
06.2 Tool Parameter Injection (SQLi / CMDi / SSRF)
06.3 Code Interpreter
07. MCP (Model Context Protocol) Security
08. RAG & Vector / Embedding Attacks (LLM08 / LLM04)
08.0 RAG Architecture Checklist
08.1 Cross-Tenant Retrieval
08.2 RAG Poisoning (PoisonedRAG)
08.3 Embedding Inversion / Membership Inference
08.4 Improper Output Handling (LLM05)
XSS via LLM Output
SQL Injection via Tool Parameters
Command Injection via Tool Parameters
09. Sensitive Information Disclosure (LLM02)
10. Supply Chain Security (LLM03)
11. Unbounded Consumption / Cost DoS (LLM10)
12. Automated Testing Tooling
12.1 garak (NVIDIA) - Broad Vulnerability Scanner
12.2 PyRIT (Microsoft) Multi-Turn Campaign Framework
12.3 promptfoo - CI/CD Regression Testing
12.4 Giskard
13. Others
13.1 Inference Framework RCE CVEs
14. Attack Paths
Path 1 | Direct Injection to System Prompt Leak
Path 2 | Injection to Unauthorized Tool Access (BOLA/BFLA)
Path 3 | Indirect Injection via RAG to Agent Behavior
Path 4 | Indirect Injection via Web Page to Tool Callback
Path 5 | LLM Output to Stored XSS
Path 6 | Agent SSRF via Fetch/Browse Tool
Path 7 | Coding Agent Repo Prompt Injection
Path 8 | Memory Poisoning for Persistence
Path 9 | Cross-Agent Privilege Escalation
15. Remediation Checklist
Last updated