Develop the skills needed to build a web server from scratch, starting with a simple program and progressing to handling multiple HTTP GET and POST requests. The server is written in assembly using the GNU Assembler using Intel Syntax.
- Makefile
- server.s GNU Assembler (GAS) version
- server.asm NASM version
The GET request is in the form,
GET /tmp/tmplfy_on1j HTTP/1.1\r\nHost: localhost\r\nUser-Agent: python-requests/2.31.0\r\nAccept-Encoding: gzip, deflate, zstd\r\nAccept: */*\r\nConnection: keep-alive\r\n\r\n
curl http://localhost/etc/issue
Normalized,
GET /tmp/tmplfy_on1j HTTP/1.1
Host: localhost
User-Agent: python-requests/2.31.0
Accept-Encoding: gzip, deflate, zstd
Accept: */*
Connection: keep-alive
The POST request is in the form
POST /tmp/tmp_lujmq8s HTTP/1.1\r\nHost: localhost\r\nUser-Agent: python-requests/2.31.0\r\nAccept-Encoding: gzip, deflate, zstd\r\nAccept: */*\r\nConnection: keep-alive\r\nContent-Length: 106\r\n\r\nluxCpwzQX11ZXl4ASUNdK8gPozVzNKZTnVVdeynQP6YiGHp1IZOIt5PggTzf8VqqDMc3xARQ19L9yCiasFYyQJykvOnczTiqVaMfpz3JHl
curl -d "luxCpwzQX11ZXl4ASUNdK8gPozVzNKZTnVVdeynQP6YiGHp1IZOIt5PggTzf8VqqDMc3xARQ19L9yCiasFYyQJykvOnczTiqVaMfpz3JHl" -X POST http://localhost/tmp/mypost
Normalized,
POST /tmp/tmp_lujmq8s HTTP/1.1
Host: localhost
User-Agent: python-requests/2.31.0
Accept-Encoding: gzip, deflate, zstd
Accept: */*
Connection: keep-alive
Content-Length: 106
luxCpwzQX11ZXl4ASUNdK8gPozVzNKZTnVVdeynQP6YiGHp1IZOIt5PggTzf8VqqDMc3xARQ19L9yCiasFYyQJykvOnczTiqVaMfpz3JHl
- pwn.college Building a Web Server module
- x86 and amd64 instruction reference
- x64 syscalls
- x86 Assembly wikibook