HTTP Deep Dive
Requests, responses, headers, and curl: speak HTTP fluently.
Every web attack is, in the end, a specially crafted HTTP request. Learn to read and write them by hand.
1
Anatomy of a request
httpPOST /login HTTP/1.1 Host: portal.example.de Cookie: session=7f3a9c Content-Type: application/x-www-form-urlencoded email=a%40example.de&password=hunter2- Method:
GETreads,POSTsends data,HEADis GET without the body,PUT/DELETEchange resources. - Host tells the server which website you want (one server can host many).
- Cookie carries cookies the browser stored for this site.
- The body follows an empty line.
Responses start with a status line such as
HTTP/1.1 301 Moved Permanentlyand aLocationheader for redirects.- Method:
2
curl
curlsends HTTP requests from the terminal:curl https://example.com # GET, print the body curl -i https://example.com # include response headers curl -I https://example.com # HEAD: headers only curl -X POST -d "a=1&b=2" https://... # POST form data curl -H "Cookie: session=abc" https://...# add a header
โ Report a problem with this room
Log in to report a problem.