Web Servers

What is a Web Server?

Workflow

Common HTTP Response Codes

Code Type Description
200 Success OK - Request succeeded
201 Success Created - Requested resources created on server
301 Redirection Moved Permanently
302 Redirection Found (Temporary Redirect)
400 Client Error Bad Request
401 Client Error Unauthorized
403 Client Error Forbidden
404 Client Error Not Found
405 Client Error Method Not Allowed
408 Client Error Request Timeout
500 Server Error Internal Server Error
502 Server Error Bad Gateway
504 Server Error Gateway Timeout

Request Example Using cURL

Get headers only:

[curl -I https://academy.hackthebox.com](<m4cc18@htb[/htb]$ curl -I https://academy.hackthebox.com

HTTP/2 200
date: Tue, 15 Dec 2020 19:54:29 GMT
content-type: text/html; charset=UTF-8
...SNIP...>)

Get full response:

m4cc18@htb[/htb]$ curl https://academy.hackthebox.com

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Cyber Security Training : HTB Academy</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">

User Input

Common Web Servers

Apache (httpd)

NGINX

IIS (Internet Information Services)

Other Web Servers


Exercise

If a web server returns an HTTP code 201, what does it stand for?

flag: Created

An HTTP status code of 201 indicates "Created." This means that the request made by the client was successfully fulfilled and, as a result, one or more new resources were created on the server.

This status code is commonly returned after a POST request, which is typically used to submit data to the server to create a new resource (e.g., creating a new user account, submitting a new blog post). It can also be used with some PUT requests if the PUT operation results in the creation of a new resource at the specified URL.

The response to a 201 Created status code often includes a Location header, which provides the URL of the newly created resource, allowing the client to access it directly. The body of the response may also contain a representation of the newly created resource or a description of it.