forked from ept-team/equinor-ctf-2023
-
Notifications
You must be signed in to change notification settings - Fork 0
/
updateWriteups.py
36 lines (29 loc) · 917 Bytes
/
updateWriteups.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python3
from os import listdir, makedirs, walk
from os.path import isfile, join, exists, basename
text = """
# equinor-ctf-2023
Educational guides, writeups and challenges resources for the 2023 Equinor CTF
## Table of content
- [Misc](#misc)
- [Crypto](#crypto)
- [Web](#web)
- [Forensics](#forensics)
- [Reversing](#reversing)
- [Pwn](#pwn)
- [OnSite](#onsite)
---
## Writeups
"""
for category in listdir("./writeups"):
if category.startswith(".") or isfile(category):
continue
text += f'### {category}\n'
for chall in listdir(f'./writeups/{category}'):
text += (f' - **{chall}**\n')
print(text)
for writeup in next(walk(f'./writeups/{category}/{chall}'))[1]:
url = f'/writeups/{category}/{chall}/{writeup}'.replace(' ', '%20')
text += f"\t - [{writeup}]({url}) \n"
print(text)
open('README.md', 'w').write(text)