# Example Architectures

## The Network File System (NFS)

* **Remote access model** (NFS)
  * File stays on server
* **Upload/download model** (FTP)
  * File needs to be downloaded first
* **Remote procedure call (RPC)**
  * A standardized way to let a client on machine $$A$$ make an ordinary call to a procedure that is implemented on another machine $$B$$.

## The Web

* **Simple Web-based systems** (client $$\Leftrightarrow$$ server) 1. The client sends a GET request to the server. 2. The server fetches document from local file. 3. Servers sends the response back to the client.
* **Multi-tiered architectures** (client $$\Leftrightarrow$$ Web server $$\Leftrightarrow$$ CGI process $$\Leftrightarrow$$ database server) 1. The client sends a GET request to the Web server. 2. The Web server starts process to fetch document. 3. The CGI process asks the database server for data needed. 4. The database server gives the CGI process those requested data. 5. The CGI process creates a HTML document and sends it to the Web server. 6. The Web server returns the result back to the client.

## **Note: Common Gateway Interface (CGI)**

CGI defines a standard way by which a Web server can **execute a program taking user data as input**. The service can be found at `/cgi-bin/`. In CTF, CGI is often linked with **Shellshock**. For example, <https://blog.wyatttauber.com/ritsec-fall-2018-ctf-week-6-45d414035c76>.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ret2basic.gitbook.io/ctfnote/computer-science/distributed-systems/architecture/example-architectures.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
