Multithreaded webserver in C. Practical exercise 2 in TDT4186.
make./mtwwwdIf you want to specify another folder to serve, you can do so by passing the arguments in the following way:
./mtwwwd myOtherFolder 8001 4 10The other arguments are:
- port
- number of threads
- ring buffer size
In a terminal you can test with ipv4 the following way:
curl --http0.9 "127.0.0.1:8000/index.html"To test with ipv6, you can use the following command:
curl --http0.9 -g -6 "[::1]:8000/index.html"If you run the spammer.py script it will spam the server with default 100 requests.
You can also specify your own amount of requests to spam with:
python3 spammer.py -r number_of_requests -p portYou can run the relative_path_exploit.py and see that it currently does not work, but if you change the:
if ((access(full_path, F_OK) == 0) && good_request(full_path) == 1 && is_regular_file(full_path))to
if (access(full_path, F_OK) == 0)You will see that the server will respond with that file