Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
GovanifY
ctf-re
Commits
dede0409
Verified
Commit
dede0409
authored
May 16, 2021
by
GovanifY
Browse files
readme: preparing for public release
parent
e1bb4c4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
dede0409
CTF
Anti cheat
CTF
Infrastructure
==========
==========
This project is a full blown CTF infrastructure, aiming to integrate with CTFd
as a frontend. It includes:
*
A server side infrastructure built in NixOS
*
A suite of challenges that are unique, tested and whose solution is auto-generated
*
An anti cheat system to prevent flag sharing between teams
# Anti Cheat
This is a deterministic anti-cheat/unique binaries generator specially tailored
This is a deterministic anti-cheat/unique binaries generator specially tailored
to CTFs. It creates a regex per challenge to load into
your flag platform
.
to CTFs. It creates a regex per challenge to load into
CTFd
.
The flag itself is a sha2 of the challenge name plus a secret on top of 4 bytes
The flag itself is a sha2 of the challenge name plus a secret on top of 4 bytes
at a different position for each challenge identifying uniquely the team in a
at a different position for each challenge identifying uniquely the team in a
sneaky fashion.
sneaky fashion.
# Challenge generation
The setup also includes ways to add junk code to binaries and have more
The setup also includes ways to add junk code to binaries and have more
convoluted setup done to them through a python script.
convoluted setup done to them through a python script.
All the flags and binaries are deterministic, so as long as you don't re-roll
All the flags and binaries are deterministic, so as long as you don't re-roll
...
@@ -15,8 +28,10 @@ cannot be found. The whole idea is to have hashes that looks the most alike
...
@@ -15,8 +28,10 @@ cannot be found. The whole idea is to have hashes that looks the most alike
possible while still being fairly certain about the origin of said flag.
possible while still being fairly certain about the origin of said flag.
## Setup:
## Setup:
Put your challengess in the folder called "chals". One folder per challenge, each folder must contain
a setup.py setting up the challenge final folder and removing unecessary files.
Put your challengess in the folder called "chals".
One folder per challenge, each folder must contain a setup.py setting up the challenge
final folder and removing unecessary files.
You will end up with a folder tree such as:
You will end up with a folder tree such as:
```
```
chals_out/
chals_out/
...
@@ -29,12 +44,23 @@ chals_out/
...
@@ -29,12 +44,23 @@ chals_out/
│ ├── access_security
│ ├── access_security
│ └── flag.txt
│ └── flag.txt
```
```
You can thus automate deployment of the binaries onto your VMs however you like.
You can then call the
`gen_chals.py`
script which will take a partial export of
a CTFd database to generate each of your challenge per team. You'll find the
result in the folder
`chals_out`
. You can then use those challenges with the
infrastructure directly, and the regex.txt generated in CTFd to validate the
flags.
You can thus automate deployment of the binaries onto your VMs however you like.
This setup works well with binaries that won't be executed remotely too and whatnot.
This setup works well with binaries that won't be executed remotely too and whatnot.
## RE CTF Edition:
## RE CTF Edition:
challenges list:
This CTF includes the challenges made for the class "Reverse Engineering and
Binary exploitation" I taught for the École Supérieure de Génie Informatique, or
ESGI. The challenges included are:
-
reverse_rop
-
reverse_rop
-
simple_rop
-
simple_rop
-
simple_rop_2
-
simple_rop_2
...
@@ -44,3 +70,12 @@ challenges list:
...
@@ -44,3 +70,12 @@ challenges list:
-
access_security
-
access_security
-
web_server_2
-
web_server_2
-
modern_rop
-
modern_rop
## Credits
This CTF infrastructure was made as a part of a class that I taught,
I being Gauvain Roussel-Tarbouriech, also commonly known as "GovanifY".
I made all the challenges, build system and anti cheat.
Ryan Lahfa made the original infrastructure work in a night(!) along with me,
which I later improved before deploying it. Huge thanks goes to him!
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment