Protocol 46 of 81Layer 7FrameAssembly v3.1.2
llms-full.txt
httpHypertext Transfer Protocol HTTP/1.1

REST Calls, Custom Headers & WAF Test Payloads (client <-> web http)

Default Port / Protocol
TCP 80
Host Endpoint Rule
Dual-Stack IPv4/IPv6
Wireshark Display Filter
http
Standards & Specs
RFC 9110, RFC 9112
Wire Stack:Ethernet II[802.1Q / QinQ / MPLS]IPv4 / IPv6TCP 80HTTP/1.1

What It Does on the Wire

Pair a 3-way tcp handshake with http get or http post and FrameAssembly formats \r\n wire headers, computes exact Content-Length, and advances TCP seq numbers so Suricata and WAFs reassemble every byte.

Hypertext Transfer Protocol (http, RFC 9112) powers web traffic, REST APIs, webhooks, and reverse-proxy health checks over TCP port 80 (or custom ports such as 8080 via dstport). By default, an http packet builds an HTTP/1.1 request (GET / HTTP/1.1); adding status <code_num> (such as status 200 reason "OK") switches the packet to an HTTP response.

FrameAssembly computes Content-Length automatically whenever you include body, supports repeatable custom header pairs, and keeps TCP sequence and acknowledgment numbers synchronized across the entire TCP connection.

Test WAF, Suricata & Snort HTTP Signatures Safely

Build a complete TCP 3-way handshake + HTTP POST with custom uri, useragent, header, and body payloads to verify IDS rules (http.uri, http.user_agent, http.request_body) offline.

Troubleshoot Load Balancer Health Checks & Reverse Proxies

Generate GET /healthz probes with specific hosthdr and X-Forwarded-For headers alongside status 200 or status 503 backend replies.

Sanitize Customer API Captures for Vendor Escalation

Decompile a production .pcap with frameassembly reverse, replace sensitive Authorization cookies or customer JSON fields in .frasm, and recompile a clean .pcap.

Minimal Quickstart (http_quickstart.frasm)

Hit Preview Packets to compile in-browser and eyeball timestamps + wire byte lengths, or ship it straight to the Playground.

http_quickstart.frasm10 lines
Open in Playground
host client { ip 10.10.1.20 }
host web_srv { ip 10.10.1.80 }
compile {
client -> web_srv tcp syn srcport 52100 dstport 80 wait 1ms
client <- web_srv tcp syn ack wait 1ms
client -> web_srv tcp ack wait 1ms
client -> web_srv http get uri "/healthz" hosthdr "api.corp.internal" useragent "kube-probe/1.30" wait 2ms
client <- web_srv http status 200 reason "OK" contenttype "application/json" body "{\"status\":\"healthy\"}"
}

What the Compiler Calculates So You Don't Have To

  • Defaults to TCP destination port 80 with psh ack flags and advances TCP seq by the exact HTTP header + body byte count.
  • Computes and inserts Content-Length: <bytes> automatically whenever body is present, formatting all header lines with standard CRLF terminators.
  • Remembers client/server ports on <- replies so status 200 responses return from port 80 to the client’s source port automatically.
Multi-Frame Lab · Ready to Compile

REST API JSON Webhook POST + WAF 403 Block Scenario

Completes a TCP handshake on port 8080, sends an authenticated JSON POST request with custom HTTP headers, and captures a 403 Forbidden gateway response.

http_api_waf_test.frasm15 lines
Open in Playground
host ext_client { ip 198.51.100.45 }
host waf_proxy { ip 172.16.20.80 }
compile {
// 1. Complete TCP 3-way handshake on port 8080 (so Suricata stream engine tracks state)
ext_client -> waf_proxy tcp syn srcport 54320 dstport 8080 win 65535 mss 1460 wait 1ms
ext_client <- waf_proxy tcp syn ack win 65535 mss 1460 wait 1ms
ext_client -> waf_proxy tcp ack wait 1ms
// 2. HTTP POST with custom headers and JSON body
ext_client -> waf_proxy http post uri "/v1/login" hosthdr "portal.example.com" useragent "Mozilla/5.0" contenttype "application/json" header "X-Request-ID" "req-9041" header "X-Forwarded-For" "203.0.113.9" body "{\"user\":\"admin\"}" wait 3ms
// 3. WAF blocks request with HTTP 403 Forbidden + TCP FIN
ext_client <- waf_proxy http status 403 reason "Forbidden" contenttype "application/json" body "{\"error\":\"blocked_by_policy\"}" wait 1ms
ext_client <- waf_proxy tcp fin ack wait 1ms
ext_client -> waf_proxy tcp ack
}
Terminal Commands (FrameAssembly CLI v3.1.2)
# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show http_api_waf_test.frasm

# 2. Compile .frasm -> classic .pcap (tcpdump/tcpreplay/Suricata) or nanosecond .pcapng
frameassembly http_api_waf_test.frasm http_api_waf_test.pcap
frameassembly http_api_waf_test.frasm http_api_waf_test.pcapng

# 3. Round-trip .pcap <-> .frasm whenever you want to scrub or tweak an existing capture
frameassembly reverse http_api_waf_test.pcap http_api_waf_test_edited.frasm

All http Keywords & Header Options

Every sub-keyword and header option is lowercase [a-z0-9]+ with zero underscores — mix and match them in any order after http:

src_host -> dst_host http [get | post | put | delete | head | options | patch | method "<text>"] [uri "<text>"] [version "<text>"] [hosthdr "<text>"] [useragent "<text>"] [contenttype "<text>"] [status <100..599>] [reason "<text>"] [header "<name>" "<value>" ...] [body "<text>"]
Keyword / OptionAccepted ValueDefaultEffect on Packet
get | post | put | delete | head | options | patch | method "<text>"HTTP request methodgetSets the HTTP request verb at the start of the request line.
uri "<text>" | version "<text>"Request path and HTTP version stringuri "/", version "HTTP/1.1"Sets the request target path and protocol version (GET /path HTTP/1.1).
hosthdr "<text>"Quoted hostname (e.g. "api.internal")Destination IPWrites the Host: HTTP header (named hosthdr so it never conflicts with the top-level host block keyword).
useragent "<text>" | contenttype "<text>"Quoted header valuesOmitted unless setWrites User-Agent: and Content-Type: headers.
header "<name>" "<value>"Repeatable header name + value pairOmittedAppends one or more custom HTTP headers (Authorization, Cookie, X-Forwarded-For, etc.).
status <100..599> [reason "<text>"]HTTP status code + optional reason phraseOmitted (emits request); reason "OK" when status is setSwitches the packet from an HTTP request to an HTTP response (HTTP/1.1 200 OK).
body "<text>"Quoted response or request payloadEmptyAppends the HTTP body after and calculates Content-Length automatically.

Cross-Layer Wrappers Valid with http

802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol

11 options
OptionRange / FormatDefaultEffect on Packet
wait <number><ns|us|ms|s|m>Time gap (ns, us, ms, s, m)10msAdvances the packet timestamp clock after sending this packet and before the next packet (wait 0ns sends back-to-back).
payload "<text>" | hexpayload "<hex>"Quoted text or hex bytes (choose one)OmittedAppends or overrides raw payload bytes ("deadbeef" or "de:ad:be:ef") and updates packet lengths and checksums.
srcmac <mac> | dstmac <mac>Colon, hyphen, or Cisco dot MACHost MAC / RFC multicast MACOverrides the 14-byte Ethernet II source or destination MAC address for this single packet.
vlan <0..4095> [pcp <0..7>] [dei <0|1>]VLAN ID 0..4095, PCP 0..7, DEI 0..1UntaggedWraps the packet in an IEEE 802.1Q VLAN tag (0x8100) with optional 802.1p QoS priority.
qinq <0..4095> [innervlan <0..4095>]Outer S-VLAN 0..4095, Inner C-VLAN 0..4095Untagged (innervlan 1 when qinq is set)Double-tags the packet with outer IEEE 802.1ad S-Tag (0x88a8) plus inner IEEE 802.1Q C-Tag (0x8100).
mpls <0..1048575> [exp|tc <0..7>] [bos <0|1>] [mplsttl <0..255>]Label 0..1048575, exp/tc 0..7, bos 0..1, ttl 0..255Unlabeled (at most 1 mpls tag per packet)Inserts a 32-bit MPLS label header (0x8847) ahead of the Layer 3 header.
ttl <0..255> [dscp <0..63>] [ecn <0..3>]TTL/Hop Limit 0..255, DSCP 0..63, ECN 0..3ttl 64, dscp 0, ecn 0Sets IPv4 TTL or IPv6 Hop Limit plus DiffServ (DSCP) and ECN QoS markings.
ipid <0..65535> [df] [mf] [fragoffset <0..8191>]IPv4 ID, DF/MF flags, fragment offset 0..8191ipid 1, flags 0, fragoffset 0Sets IPv4 Identification, Do-Not-Fragment (df), More-Fragments (mf), and fragment offset (ignored over IPv6).
flowlabel <0..1048575>20-bit IPv6 Flow Label (0..1048575)0Sets the 20-bit IPv6 Flow Label for ECMP routing tests (ignored when running over IPv4 hosts).
srcport <0..65535> | dstport <0..65535>Port number 0..65535srcport 49152 (remembered), TCP 80Overrides source or destination port and remembers the port pair automatically on <- replies.
seq <number> | acknum <number> | win <0..65535> | syn | ack | psh | fin | rstTCP sequence/ack numbers, window size, flags & RFC 7323 optionspsh ack, win 65535, automatic TCP seq/acknumOverrides automatic TCP sequence tracking, flags, or RFC 7323 options (mss, wscale, sackperm, tsval, tsecr).

Gotchas & Quick Fixes

Use hosthdr (Not host) for the HTTP Host Header

Avoid
client -> web_srv http get uri "/" host "api.example.com"
Valid v3.1.2 Syntax
client -> web_srv http get uri "/" hosthdr "api.example.com"

Because host declares network endpoints at the top of a .frasm file, HTTP and SSDP use hosthdr "<text>" to set the Host: header.

Include a 3-Way TCP Handshake Before HTTP for Suricata / Zeek

Valid v3.1.2 Syntax
client -> web_srv tcp syn dstport 80 client <- web_srv tcp syn ack client -> web_srv tcp ack client -> web_srv http get uri "/"

Wireshark decodes standalone http packets immediately, but stateful IDS sensors like Suricata (flow:established,to_server) require the 3-packet TCP handshake first.

Field Guide 03
Poke Stateful Firewalls, Suricata, Zeek & OT Conduits