Class NucleiVariableContext

Namespace
Kuestenlogik.Bowire.Security.Templates.Nuclei
Assembly
Kuestenlogik.Bowire.Security.Templates.Nuclei.dll

Carries the per-template values the resolver substitutes plus the random source for generated placeholders. Build with FromTarget(string, int?, Func<string>?) for a target URL; the random source defaults to seeded so a given context produces reproducible placeholders across invocations (essential for SARIF diff + CI dashboards).

public sealed class NucleiVariableContext
Inheritance
NucleiVariableContext
Inherited Members

Constructors

NucleiVariableContext(string, string, string, string, string, Random)

public NucleiVariableContext(string baseUrl, string hostname, string host, string port, string path, Random random)

Parameters

baseUrl string
hostname string
host string
port string
path string
random Random

Properties

AllocatedInteractshUrl

The callback host this context handed to {{interactsh-url}}, or null if the placeholder was never resolved. The scanner reads it back to correlate a recorded interaction to the template that planted it.

public string? AllocatedInteractshUrl { get; }

Property Value

string

BaseUrl

public string BaseUrl { get; }

Property Value

string

Host

public string Host { get; }

Property Value

string

Hostname

public string Hostname { get; }

Property Value

string

InteractshUrlFactory

Allocates an out-of-band callback host for {{interactsh-url}} (#35 Phase 2f). Null (the default) means no interaction server is configured and OAST templates cannot run.

public Func<string>? InteractshUrlFactory { get; init; }

Property Value

Func<string>

Remarks

Invoked at most once per context, and the value is memoised — a template referencing the placeholder twice must plant the SAME host, or the callback could not be attributed back to it. Give each template its own context so two templates never share a host, otherwise a callback cannot be pinned to the probe that caused it.

Path

public string Path { get; }

Property Value

string

Port

public string Port { get; }

Property Value

string

Methods

FromTarget(string, int?, Func<string>?)

Build a context from a fully-qualified target URL like https://api.example.com:8443/v2. The seed parameter feeds the random source so repeated runs of the same scan produce the same placeholder values — keeps SARIF diff + CI dashboards stable.

public static NucleiVariableContext FromTarget(string target, int? seed = null, Func<string>? interactshUrlFactory = null)

Parameters

target string
seed int?
interactshUrlFactory Func<string>

Returns

NucleiVariableContext