Posted by speedping 3 hours ago
If you think you can do it or that anyone with AI dan be dangerous. Please, right now put everything down.. Go make a h1,bugcrowd acct and start making millions. If its as easy as having access to llms please go get rich. I assure you just having access to tokens doesnt get you very far.
Today we are going to take a look at how to avoid this vuln by not having Nginx and not using HTTP/2 (for most use cases).
We will assume that you are using Nginx for any of the following: Serving files or serving dynamic website content through some integration with a programming language.
We will be using python, but you can use any programming language that has a native integration with sockets through it's C interface (literally every language:
Step 1: import socket # import the socket library from glibc or glibc.
Step 2: socket.socket() # socket.socket()
Step 3: socket.bind((PUBLIC_ADDR,80)) # bind before listening obviously. Use a local address if you are below the IPoverty4 line.
Step 4: conn,addr = socket.accept() # this creates a connection, wrap it in a While True and a try catch for production. Sprinkle in some import threading to support multiple concurrent requests.
Step 4: req = conn.recv(4096) # split on b"\r\n\r\n" to separate headers from body, read HTTP RFCs for the rest. Feel free to reject HTTP/2 requests, they'll probably just resend as HTTP/1.1
Step 5: #Fill in the details, most likely if you are using nginx, you will end up connecting two sockets with pipe, or just storing and forwarding to another tcp endpoint. Again take a look at the HTTP RFCs and the glibc socket and stdio manuals.
Thank you for reading my tutorial, and best of lucks.
Cue xkcd
EDIT: Okay, this comment was snarky and not in good spirit. To be serious, I think we are increasingly seeing that the notion that humans can write non-trivial amounts of C correctly is false. Especially in the face of AI-assisted vulnearbility hunting these programs a crumbling. This is not an indictment of humans, it's a sign that C is not equipped to meet this moment.
https://github.com/nginx/nginx/commit/e27f5fa84fe6e98505e70b...
Given that on modern CPUs, cycles are quite fast, and memory latency is quite high, always-checked integer operations sound like an extremely good idea.
C is like a Winchester Model 1897, not saying that it is a bad gun, it is what we call it the good ol' Trench gun, as it ran over the war tunnels of the Great War, and it still packs a punch today, but it only has a half-cock for some level of safety, and there is no trigger disconnector either, so you can easily slam fire it. So it is way too easy to shoot yourself in the foot.
Nowadays we like going for a AKM/AK74, for something maybe more complicated but far more reliable at the same time. That's why we want Rust.
Edit: All good. They released the new versions within 30 mins.
Given how common it's become to constantly scan popular repos for n-days, I expect someone will have already picked it up and started work on an exploit. The workaround for this (disabling HTTP/2) is also comparatively easy to what we had with PHP2Shell just a few weeks back, so I think it makes sense to release this.
We have people doing this on my side project and then reporting the fixed issues to try and get CVE 'credit'. Tiring.
[1] https://launchpad.net/ubuntu/+source/nginx [2] https://tracker.debian.org/pkg/nginx