Skip to content

tcp

The tcp identity: raw bytes over a TCP connection. Every field and what is required.

tcp speaks raw bytes over a TCP connection. The session persists across steps, so a solution can stage an exchange in one step and continue it in the next. The target is host:port. Send and receive raw bytes as hex; a send may also be written as readable text with hex "text".

Fields

send field

Required. The bytes to send, written as hex, or as readable text with hex "text": the quoted text, with the \r, \n, \t, \", \\, and \xHH escapes, is hex-encoded for you, so hex "HELO x\r\n" is the same bytes as 48454c4f20780d0a. It may be empty when a step only reads, for example a banner grab.

recv field

Optional. How many bytes to read at most.

recv_until field

Optional. Stop reading once this hex marker appears.

timeout field

Optional. How long to wait, in seconds. Example: 5.

close field

Optional. When true, end the session after this step.

capture field

Optional. Pulls a value out of the received hex for later steps. The pattern runs over the hex and group 1 is hex-decoded before storing.

tcp negotiate
  send: 010203...
  capture port: "(....)"
  assert: contains "..."

Later steps reference {port}. This is how a solution follows a server-assigned value such as an ocelot port id.

Example

tcp banner
  meaning: read the service banner
  recv: 4096
  timeout: 5
  assert: regex "..."

The step sends nothing; it only reads, so there is no send line.

Write attacks down. Verify them.

Download the binary, point it at a target you own, and get a verified result. The corpus is open and the format is plain text.