Class NetworkProbeExecutor
- Namespace
- Kuestenlogik.Bowire.Security.Scanner
- Assembly
- Kuestenlogik.Bowire.Security.Scanner.dll
Runs a translated Nuclei network: / tcp: template (#491,
#35 Phase 2g): open a socket, write the payloads, read the reply, match
over it. The shape behind unauthenticated-Redis, exposed-Memcached and
banner-grab templates.
public static class NetworkProbeExecutor
- Inheritance
-
NetworkProbeExecutor
- Inherited Members
Methods
DecodePayload(string)
Turn one converter-written message into bytes. hex: marks a
hex-encoded payload (Nuclei's type: hex); everything else is text
carrying Go-style escapes.
public static byte[] DecodePayload(string message)
Parameters
messagestring
Returns
- byte[]
DecodeResponse(ReadOnlySpan<byte>)
Render the reply as text for the matchers. Latin-1 rather than UTF-8:
a binary banner is not valid UTF-8, and the replacement characters that
decoding would produce destroy exactly the byte sequences a
word matcher is hunting for. Latin-1 is lossless byte-to-char.
public static string DecodeResponse(ReadOnlySpan<byte> bytes)
Parameters
bytesReadOnlySpan<byte>
Returns
ExecuteAsync(BowireRecordingStep, int, CancellationToken)
Connect, send, read. probe carries the address in
Service, the payloads in
Messages and the read budget in
Metadata["read-size"], as written by the converter.
public static Task<AttackProbeResponse> ExecuteAsync(BowireRecordingStep probe, int timeoutSeconds = 10, CancellationToken ct = default)
Parameters
probeBowireRecordingStepThe recording step to run.
timeoutSecondsintConnect + read budget.
ctCancellationTokenCancels the probe.
Returns
ParseAddress(string)
Split host:port. A bare host is refused rather than guessed:
{{Hostname}} resolves without a port on 80/443, and picking one
silently would probe a service the template never named.
public static (string Host, int Port) ParseAddress(string address)
Parameters
addressstring
Returns
Unescape(string)
Expand the escapes Nuclei templates write literally in YAML. Without
this a PING\r\n goes out as the eight characters P I N G \ r \ n
and no Redis answers it — the probe would report "not vulnerable" for a
wide-open server.
public static string Unescape(string value)
Parameters
valuestring