|
1 | | -FacePalm |
| 1 | +Facepalm |
2 | 2 | ==================== |
3 | | -A terrible facebook clone that can't seem to get anything quite right - the banner and the logo are just slightly different, buttons shuffle around and it might not even be as secure as one might think. It might even go so far as to mock you - even though it itself has never been mocked (wth is a unit test??) |
4 | 3 |
|
5 | | -# Functionality |
6 | | - |
7 | | -Facepalm is a pretty bad facebook clone, so it has a lot of the same functionality. It allows users to |
8 | | -- post (publically to a global feed or privately just to themselves) texts and/or images |
9 | | -- view the public feed |
10 | | -- login/ logout |
11 | | -- post via a specific address at `/post` |
12 | | -- edit their settings, upload a bio and a profile picture. |
13 | | - |
14 | | -# Usage |
15 | | - |
16 | | -> The Service facepalm itself is served on `port 4269` |
17 | | -> Additional hosting will require some more ports; the range reserved is `4269-4279`. |
18 | | -
|
19 | | -The base structure is as follows: |
20 | | -- `Readme.md` contains the functionalities and a description of the exploits |
21 | | -- `LICENCE` as asked for - MIT License. |
22 | | -- `service/Source` folder contains all the classes, files, databases and everything else that's needed to run the service. Within `/App`, there's all the source code except the main class. `/Run` contains the main class that pulls its functionality from `App` |
23 | | - - `Migrations` is used for anything working with databses |
24 | | - - `Models` contains all the main functionality |
25 | | - - `Tasks` can be used for maintenance, is ot currently used. Was used for a migration cleanup. |
26 | | - - `Utils` can provide some commonly used functionality, but is currently empty. Did contin something before, left it there cause I didn't know if I might need it again. Will delete if it stays empty. |
27 | | - - `configure.swift` sets some of the globally used paths and parameters. |
28 | | - - `Globals.swift` sets up my interface for global logging. |
29 | | - - `routes.swift` is a file from hell. It is way too long, terribly untidy, and provides the functionality for the web interface, with some hard coded html, predefined functionalities and all the routes that can be reached by `localhost:4269` |
30 | | - |
31 | | - |
32 | | -Example service to provide students a project strucutre. n0t3b00k is a simple service that allows users to register, login and save/retrieve notes. |
33 | | - |
34 | | ------------------------------------------------ |
35 | | - |
36 | | -# Usage |
37 | | - |
38 | | -Use this repository as the base structure for your service. Please keep the directory structure and the following required files: |
39 | | - |
40 | | -- `README.md` with a description of your vulnerabilities and exploits. |
41 | | -- `LICENSE` with the MIT |
42 | | -- `.gitignore` files exclude directories or files from being committed. |
43 | | -- `.dockerignore` files exclude directories or files from being tracked by the docker daemon. |
44 | | -- `.env` files used by docker-compose to assign a unique project-name. |
45 | | -- `docker-compose.yml` files to manage your service or checker containers |
46 | | -- `Dockerfile` with commands to build your service |
47 | | - |
48 | | -# Required changes |
49 | 4 |
|
50 | | -- You'll probably want to through all of these files and replace `n0t3b00k` with your service's name accordingly. |
| 5 | +Facepalm is a Facebook clone gone somewhat wrong, made by someone who had never been on facebook in their life. Buttons will move unpredicatably, features contradict expectations, and some features might be entirely new. Behind the questionable hardcoded HTML practices, Facepalm is a quite performant little service that allows its users to post content, share images, browse a public feed, and modify and personalize their profiles. |
51 | 6 |
|
52 | | -- Assign your service a unique port. (See `service/docker-compose.yml`, `service/Dockerfile`, `service/src/n0t3b00k.py` and `checker/checker.py`) |
53 | | - |
54 | | -# Checking your service |
55 | | - |
56 | | -You will have to implement a checker script, which periodically interacts with your service to store and retrieve flags and checks if it still behaves correctly. The game engine will call your checker during a CTF. Use the web interface or `enochecker_cli` to call your different checker methods. |
57 | | - |
58 | | -## Manually |
59 | | -However, you can also perform all game engine call manually in your local development environment. |
60 | | - |
61 | | -- First, start your service with `cd service` and `docker-compose up --build`. |
62 | | -- Next, start your checker with `cd checker` and `docker-compose up --build`. |
63 | | - |
64 | | -### Web interface |
65 | | -The checker launches a web interface on the port configured in its `docker-compose.yml`. |
66 | | - |
67 | | -- Browse to `http://localhost:<checker-port>` to reach the checker interface. |
68 | | - |
69 | | -### enochecker_cli |
70 | | - |
71 | | -Install `enochecker_cli` using `pip install --user enochecker_cli`. Provide the needed checker URL (`http://localhost:8000`), service IP address (i.e. `192.168.2.112`) and the checker methods to call: |
| 7 | +# Functionality |
72 | 8 |
|
73 | | -``` |
74 | | -$> enochecker_cli -A http://localhost:8000/ -a 192.168.2.112 putflag |
75 | | -OK |
76 | | -$> enochecker_cli -A http://localhost:8000/ -a 192.168.2.112 getflag |
77 | | -OK |
78 | | -$> enochecker_cli -A http://localhost:8000/ -a 192.168.2.112 putnoise |
79 | | -OK |
80 | | -$> enochecker_cli -A http://localhost:8000/ -a 192.168.2.112 getnoise |
81 | | -OK |
82 | | -$> enochecker_cli -A http://localhost:8000/ -a 192.168.2.112 -v 2 havoc |
83 | | -OK |
84 | | -``` |
| 9 | +Facepalm imitates social media features and allows users to_ |
85 | 10 |
|
86 | | -## Automatically |
87 | | -You will use CI/CD to continuously check the checker and service. |
| 11 | +- login |
| 12 | +- post text and/or images to a global feed or priavely to your own profile |
| 13 | +- Edit your profile (profile pic and bio) |
| 14 | +- View other users' profiles (using secure uuids) |
| 15 | +- see your post history and change its visibility |
| 16 | +- Search for other users |
| 17 | +- "Facepalm 🌴" posts as often as they like |
88 | 18 |
|
89 | | -- First, install `enochecker_test`. |
90 | | -- Wipe your checker's and service's `./data/` directories as `enochecker_test` requires a clean state. |
91 | | -- Run `enochecker_test`: |
| 19 | +# Project structure |
92 | 20 |
|
93 | 21 | ``` |
94 | | -ENOCHECKER_TEST_CHECKER_ADDRESS='localhost' ENOCHECKER_TEST_CHECKER_PORT='8000' ENOCHECKER_TEST_SERVICE_ADDRESS='192.168.2.112' enochecker_test |
| 22 | +. |
| 23 | +├── data |
| 24 | +│ └── uploads |
| 25 | +├── docker-compose.yml |
| 26 | +├── Dockerfile |
| 27 | +├── Package.swift |
| 28 | +├── Public |
| 29 | +│ └── facepalm_logo.png |
| 30 | +├── README_Before_playing.md < Additional infos for players |
| 31 | +├── Sources |
| 32 | +│ ├── App |
| 33 | +│ │ ├── configure.swift |
| 34 | +│ │ ├── Globals.swift |
| 35 | +│ │ ├── Middleware |
| 36 | +│ │ │ └── NotFoundMiddleware.swift |
| 37 | +│ │ ├── Migrations |
| 38 | +│ │ │ ├── AddCreatedAtToProfile.swift |
| 39 | +│ │ │ ├── AddCreatedAtToUser.swift |
| 40 | +│ │ │ └── AddPostCounterToUser.swift |
| 41 | +│ │ ├── Models |
| 42 | +│ │ │ ├── CreatePost.swift |
| 43 | +│ │ │ ├── CreateProfileFollow.swift |
| 44 | +│ │ │ ├── CreateProfile.swift |
| 45 | +│ │ │ ├── CreateToken.swift |
| 46 | +│ │ │ ├── CreateUser.swift |
| 47 | +│ │ │ ├── IdentifierGenerator.swift |
| 48 | +│ │ │ ├── PostForm.swift |
| 49 | +│ │ │ ├── PostIDGenerator.swift |
| 50 | +│ │ │ ├── Post.swift |
| 51 | +│ │ │ ├── ProfileFollow.swift |
| 52 | +│ │ │ ├── Profile.swift |
| 53 | +│ │ │ ├── Token.swift |
| 54 | +│ │ │ └── User.swift |
| 55 | +│ │ ├── routes.swift |
| 56 | +│ │ └── Utils |
| 57 | +│ │ └── StringAppend.swift |
| 58 | +│ └── Run |
| 59 | +│ └── main.swift |
| 60 | +└── uploads |
95 | 61 | ``` |
96 | 62 |
|
97 | | -# Questions? |
| 63 | +# Usage |
98 | 64 |
|
99 | | -We understand that this can be a bit overwhelming at first, but you'll quickly get used to the workflow. Nonetheless, *please* reach out to us if you're having problems getting started or something is unclear. |
| 65 | +> The Service facepalm itself is served on `port 4269` |
| 66 | +> Additional hosting will require some more ports; the range reserved is `4269-4279`. |
0 commit comments