Skip to content

Commit fbaa617

Browse files
committed
Add template for pascalctf 2026 and fix warnings
1 parent fb530a9 commit fbaa617

9 files changed

Lines changed: 301 additions & 13 deletions

File tree

content/en/ctf/pascalCTF2025.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ TocOpen: false
1111
draft: false
1212
hidemeta: false
1313
comments: false
14-
description: "Some writeups of the pascalCTF Beginner ctf 2025 edition."
14+
description: "Some writeups of the PascalCTF Beginner CTF 2025 edition."
1515
canonicalURL: "https://pascalctf.github.io/en/ctf/"
1616
disableHLJS: false
1717
disableShare: false
@@ -26,7 +26,7 @@ UseHugoToc: true
2626
cover:
2727
image: "https://opengraph.githubassets.com/eccdc445364e4f9dcbece7bb7f178f0756be13a48717c78ec94bf78c35861b9a/PascalCTF/PascalCTF.github.io" # image path/url
2828
alt: "Pascal CTF Beginner 2025" # alt text
29-
caption: "Some writeups of the pascalCTF Beginner ctf 2025 edition." # display caption under cover
29+
caption: "Some writeups of the PascalCTF Beginner CTF 2025 edition." # display caption under cover
3030
relative: false # when using page bundles set this to true
3131
hidden: true # only hide on current single page
3232
editPost:

content/it/ctf/ctfatac2025_quals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "CTF@AC 2025 Qualifiche"
2+
title: "Qualifiche CTF@AC 2025"
33
date: 2025-09-16T00:00:00+00:00
44
# weight: 1
55
# aliases: ["/first"]

content/it/ctf/pascalCTF2025.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ TocOpen: false
1111
draft: false
1212
hidemeta: false
1313
comments: false
14-
description: "Alcune writeups della pascalCTF Beginner ctf 2025."
14+
description: "Alcune writeup della PascalCTF Beginner CTF 2025."
1515
canonicalURL: "https://pascalctf.github.io/it/ctf/"
1616
disableHLJS: false
1717
disableShare: false
@@ -26,7 +26,7 @@ UseHugoToc: true
2626
cover:
2727
image: "https://opengraph.githubassets.com/eccdc445364e4f9dcbece7bb7f178f0756be13a48717c78ec94bf78c35861b9a/PascalCTF/PascalCTF.github.io" # image path/url
2828
alt: "Pascal CTF Beginner 2025" # alt text
29-
caption: "Alcune writeups della pascalCTF Beginner ctf 2025." # display caption under cover
29+
caption: "Alcune writeup della PascalCTF Beginner CTF 2025." # display caption under cover
3030
relative: false # when using page bundles set this to true
3131
hidden: true # only hide on current single page
3232
editPost:
@@ -417,4 +417,9 @@ for packet in capture:
417417
418418
flag = bytes.fromhex(flag).decode('utf-8') # convert hex to ascii
419419
print(re.findall(regex, flag)[0]) # print the flag
420-
```
420+
```
421+
422+
## Ringraziamenti
423+
Essendo questa la prima edizione della PascalCTF, vorremmo ringraziare tutti coloro che hanno partecipato, sia come concorrenti che come organizzatori, per aver reso possibile questo evento.
424+
425+
Un ringraziamento speciale va a tutti gli [**sponsor**](/it/sponsors#2025) per aver reso possibile questo evento.

content/it/ctf/pascalCTF2026.md

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
---
2+
title: "Pascal CTF 2026"
3+
date: 2026-01-31T00:00:00+00:00
4+
# weight: 1
5+
# aliases: ["/first"]
6+
tags: ["pascalCTF", "ctf", "binary", "crypto", "web", "ai", "pascalCTF2026"]
7+
author: "Paolo"
8+
# author: ["Me", "You"] # multiple authors
9+
showToc: true
10+
TocOpen: false
11+
draft: false
12+
hidemeta: false
13+
comments: false
14+
description: "Alcune writeup della PascalCTF CTF 2026."
15+
canonicalURL: "https://pascalctf.github.io/it/ctf/"
16+
disableHLJS: false
17+
disableShare: false
18+
hideSummary: false
19+
searchHidden: true
20+
ShowReadingTime: true
21+
ShowBreadCrumbs: true
22+
ShowPostNavLinks: true
23+
ShowWordCount: true
24+
ShowRssButtonInSectionTermList: true
25+
UseHugoToc: true
26+
cover:
27+
image: "https://opengraph.githubassets.com/eccdc445364e4f9dcbece7bb7f178f0756be13a48717c78ec94bf78c35861b9a/PascalCTF/PascalCTF.github.io" # image path/url
28+
alt: "Pascal CTF 2026" # alt text
29+
caption: "Alcune writeup della PascalCTF CTF 2026." # display caption under cover
30+
relative: false # when using page bundles set this to true
31+
hidden: true # only hide on current single page
32+
editPost:
33+
URL: "https://github.com/PascalCTF/PascalCTF.github.io/blob/main/content/it"
34+
Text: "Suggerisci Modifiche" # edit text
35+
appendFilePath: true # to append file path to Edit link
36+
---
37+
38+
# Pascal CTF 2026
39+
![pascalCTF logo](/images/pascalCTF.png)
40+
41+
La PascalCTF 2026 è stata una competizione di Capture The Flag (CTF) organizzata dal nostro team [Paolo](https://pascalctf.github.io/). La competizione si è svolta dal `31 gennaio 2026` al `1 febbraio 2026` e ha visto la partecipazione di numerosi team provenienti da tutto il mondo.
42+
43+
Buona parte delle challenge è stata creata per l'edizione **Beginner** tenutasi nello stesso mese presso l'[ITT Pascal](https://www.ispascalcomandini.it/pagine/pascal-ctf). Le challenge erano suddivise in diverse categorie, tra cui *Web Security*, *Cryptography*, *Binary Exploitation*, *Reverse Engineering*, *Miscellaneous* e *Intelligenza Artificiale*. Ogni categoria presentava sfide di difficoltà variabile, adatte sia a principianti che a esperti.
44+
45+
![pascalCTF 2026](/images/pascalctf2026.jpeg)
46+
47+
Ci teniamo inoltre a ringraziare tutti i **partecipanti** per il loro entusiasmo e la loro dedizione, nonché i nostri [**sponsors**](/it/sponsors#2026) per il loro supporto.
48+
49+
## Web 🌐
50+
51+
### JSHit
52+
* Autore: `Alan Davide Bovo`[`@AlBovo`](https://github.com/AlBovo)
53+
54+
Come si può intuire dal nome, questa challenge era basata su un semplice script JSFuck il quale poteva essere "deoffuscato" mediante un semplice `toString()`:
55+
56+
```javascript
57+
let f = [][(![]+[])[+!+[]]+(!![]+[]) ... ];
58+
console.log(f.toString())
59+
```
60+
61+
Una volta deoffuscato, lo script risultava essere il seguente:
62+
63+
```javascript
64+
() => {
65+
const pageElement = document.getElementById('page');
66+
const flag = document.cookie.split('; ').find(row => row.startsWith('flag='));
67+
const pageContent = `<div class="container"><h1 class="mt-5">Welcome to JSHit</h1><p class="lead">${flag && flag.split('=')[1] === 'pascalCTF{1_h4t3_j4v4scr1pt_s0o0o0o0_much}' ? 'You got the flag gg' : 'You got no flag yet lol'}</p></div>`;
68+
pageElement.innerHTML = pageContent;
69+
console.log("where's the page gone?");
70+
document.getElementById('code').remove();
71+
}
72+
```
73+
74+
Ciò nonostante il metodo più veloce per risolvere una challenge del genere era semplicemente utilizzare un qualsiasi LLM disponibile (ad esempio ChatGPT) e chiedergli di deoffuscare il codice, ottenendo così la flag in pochi secondi.
75+
76+
### ZazaStore
77+
* Autore: `Enea Maroncelli`[`@ZazaMan`](https://github.com/Eneamaroncelli27)
78+
* Autore: `Alan Davide Bovo`[`@AlBovo`](https://github.com/AlBovo)
79+
80+
TODO
81+
82+
```javascript
83+
const content = {
84+
"RealZa": process.env.FLAG,
85+
"FakeZa": "pascalCTF{this_is_a_fake_flag_like_the_fake_za}",
86+
"ElectricZa": "<img src='images/ElectricZa.jpeg' alt='Electric Za'>",
87+
"CartoonZa": "<img src='images/CartoonZa.png' alt='Cartoon Za'>"
88+
};
89+
const prices = { "FakeZa": 1, "ElectricZa": 65, "CartoonZa": 35, "RealZa": 1000 };
90+
```
91+
92+
93+
94+
```javascript
95+
app.post('/add-cart', (req, res) => {
96+
const product = req.body;
97+
if (!req.session.cart) {
98+
req.session.cart = {};
99+
}
100+
const cart = req.session.cart;
101+
if ("product" in product) {
102+
const prod = product.product;
103+
const quantity = product.quantity || 1;
104+
if (quantity < 1) {
105+
return res.json({ success: false });
106+
}
107+
if (prod in cart) {
108+
cart[prod] += quantity;
109+
} else {
110+
cart[prod] = quantity;
111+
}
112+
req.session.cart = cart;
113+
return res.json({ success: true });
114+
}
115+
res.json({ success: false });
116+
});
117+
```
118+
119+
120+
121+
```javascript
122+
app.post('/checkout', (req, res) => {
123+
if (!req.session.inventory) {
124+
req.session.inventory = {};
125+
}
126+
if (!req.session.cart) {
127+
req.session.cart = {};
128+
}
129+
const inventory = req.session.inventory;
130+
const cart = req.session.cart;
131+
132+
let total = 0;
133+
for (const product in cart) {
134+
total += prices[product] * cart[product];
135+
}
136+
137+
if (total > req.session.balance) {
138+
res.json({ "success": true, "balance": "Insufficient Balance" });
139+
} else {
140+
req.session.balance -= total;
141+
for (const property in cart) {
142+
if (inventory.hasOwnProperty(property)) {
143+
inventory[property] += cart[property];
144+
}
145+
else {
146+
inventory[property] = cart[property];
147+
}
148+
}
149+
req.session.cart = {};
150+
req.session.inventory = inventory;
151+
res.json({ "success": true });
152+
}
153+
});
154+
```
155+
156+
## Cryptography 🔒
157+
158+
### XorD
159+
* Autore: `Filippo Boschi`[`@pllossi`](https://github.com/pllossi)
160+
161+
La challenge forniva un semplice script Python che implementava una cifratura XOR mediante un One-Time Pad (OTP) inizializzato con un seed fisso:
162+
163+
```python
164+
import os
165+
import random
166+
167+
def xor(a, b):
168+
return bytes([a ^ b])
169+
170+
flag = os.getenv('FLAG', 'pascalCTF{REDACTED}')
171+
encrypted_flag = b''
172+
173+
random.seed(1337)
174+
for i in range(len(flag)):
175+
random_key = random.randint(0, 255)
176+
encrypted_flag += xor(ord(flag[i]), random_key)
177+
178+
with open('output.txt', 'w') as f:
179+
f.write(encrypted_flag.hex())
180+
```
181+
182+
Il file `output.txt` conteneva la flag cifrata in formato esadecimale. L'obiettivo era recuperarla partendo da questo file.
183+
184+
La vulnerabilità risiedeva nell'uso di un seed fisso (`1337`). Poiché la sequenza del generatore pseudo-casuale di Python è deterministica, era possibile rigenerare esattamente la stessa sequenza di chiavi utilizzate per la cifratura. Ricostruendo questa sequenza e applicando l'operazione XOR inversa ai byte cifrati, era possibile recuperare il testo in chiaro della flag.
185+
186+
### Ice Cramer
187+
* Autore: `Alan Davide Bovo`[`@AlBovo`](https://github.com/AlBovo)
188+
189+
Questa challenge come si può intuire dal nome si basava interamente sulla risoluzione di un normalissimo sistema di equazioni lineari le cui incognite altro non erano che i singoli byte della flag. Il sistema veniva generato in maniera casuale, ma con la garanzia che avesse una soluzione unica, e veniva fornito al giocatore sotto forma di stringa:
190+
191+
```python
192+
def generate_system(values):
193+
for _ in values:
194+
eq = []
195+
sol = 0
196+
for i in range(len(values)):
197+
k = randint(-100, 100)
198+
eq.append(f"{k}*x_{i}")
199+
sol += k * values[i]
200+
201+
streq = " + ".join(eq) + " = " + str(sol)
202+
print(streq)
203+
```
204+
205+
Per risolvere il sistema, era sufficiente utilizzare un qualsiasi software di algebra computazionale (ad esempio Wolfram Alpha) o scrivere una semplice solve mediante l'utilizzo di librerie come [`z3`](https://ericpony.github.io/z3py-tutorial/guide-examples.htm).
206+
207+
### Linux Penguin
208+
* Autore: `Alan Davide Bovo`[`@AlBovo`](https://github.com/AlBovo)
209+
210+
TODO
211+
212+
### Curve Ball
213+
* Autore: `Alan Davide Bovo`[`@AlBovo`](https://github.com/AlBovo)
214+
215+
TODO
216+
217+
### wordy
218+
* Autore: `Alessandro Bombarda`[`@ale18V`](https://github.com/ale18V)
219+
220+
TODO
221+
222+
## Binary Exploitation 💻
223+
224+
## Reverse Engineering ⚙️
225+
226+
## Miscellaneous 🧭
227+
228+
## Intelligenza Artificiale 🤖
229+
230+
### Tea Guardian
231+
TODO
232+
233+
### Selfish AI
234+
TODO
235+
236+
### 🤓 AI
237+
TODO
238+
239+
### My ai lover
240+
TODO
241+
242+
### Geoguesser Revenge
243+
TODO
244+
245+
## Conclusioni
246+
Nonostante le diverse problematiche incontrate durante l'organizzazione e lo svolgimento della competizione, siamo estremamente soddisfatti del risultato finale e della partecipazione che abbiamo ricevuto. Vorremmo però anche scusarci con tutti i partecipanti per eventuali disagi o problemi tecnici che si sono verificati durante la competizione, e assicurarvi che faremo del nostro meglio per evitare che si ripetano in futuro.
247+
248+
Ci teniamo inoltre a riflettere sull'utilizzo degli **LLM** e dell'**AI** in generale all'interno delle competizioni CTF. Se da un lato queste tecnologie possono essere strumenti estremamente potenti per risolvere le challenge, dall'altro rischiano di rendere alcune sfide troppo *semplici* o addirittura *banali*. Per questo motivo, stiamo valutando l'idea di introdurre delle **limitazioni** all'utilizzo di questi strumenti nelle future edizioni della PascalCTF, al fine di mantenere un certo livello di difficoltà e di stimolare la creatività e l'ingegno dei partecipanti.
249+
250+
Il nostro scopo rimarrà infatti, oggi come in futuro, quello di offrire una competizione *divertente*, *educativa* e *stimolante* per tutti i partecipanti, indipendentemente dal loro livello di esperienza o dalle tecnologie che decidono di utilizzare.
251+
252+
Speriamo che questa competizione abbia offerto un'opportunità di apprendimento e divertimento a tutti i partecipanti, e non vediamo l'ora di organizzare la prossima edizione della PascalCTF 🔜

data/sponsors.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
years:
2-
- year: 2025
2+
- year: 2026
33
items:
44
- name: Maggioli
55
url: https://maggioli.it
@@ -25,7 +25,7 @@ years:
2525
links:
2626
site: https://flashstart.com
2727
linkedin: https://linkedin.com/company/flashstart
28-
- year: 2024
28+
- year: 2025
2929
items:
3030
- name: Cyberloop
3131
url: https://cyberloop.it

hugo.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ staticDir:
2525

2626
languages:
2727
en:
28-
languageName: ":uk: En"
28+
label: ":uk: En"
2929
weight: 1
3030
contentDir: content/en
3131

3232
it:
33-
languageName: ":it: It"
33+
label: ":it: It"
3434
weight: 2
3535
title: Paolo
3636
contentDir: content/it

layouts/shortcodes/sponsors.html

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/}}
55

66
{{ $lang := .Page.Lang }}
7-
{{ $data := index site.Data "sponsors" }}
7+
{{ $data := index hugo.Data "sponsors" }}
88
{{ if not $data }}
99
<p>No sponsors data found for language {{ $lang }}.</p>
1010
{{ else }}
@@ -26,9 +26,9 @@
2626
{{ $isLatest := eq (int $year.year) $maxYear }}
2727

2828
{{ if $isLatest }}
29-
<h2 class="sponsor-year-heading">{{ $year.year }}</h2>
29+
<h2 id="{{ $year.year }}" class="sponsor-year-heading">{{ $year.year }}</h2>
3030
{{ else }}
31-
<details class="sponsor-year">
31+
<details id="{{ $year.year }}" class="sponsor-year" data-sponsor-year="{{ $year.year }}">
3232
<summary class="sponsor-year-summary">
3333
<span class="sponsor-year-title">{{ $yearLabel }} {{ $year.year }}</span>
3434
</summary>
@@ -90,4 +90,35 @@ <h2 class="sponsor-year-heading">{{ $year.year }}</h2>
9090
</details>
9191
{{ end }}
9292
{{ end }}
93+
94+
<script>
95+
(function () {
96+
function openSponsorYearFromHash() {
97+
var hash = window.location.hash;
98+
if (!hash || hash.length < 2) return;
99+
100+
var year = decodeURIComponent(hash.slice(1)).trim();
101+
if (!/^\d{4}$/.test(year)) return;
102+
103+
var el = document.getElementById(year);
104+
if (!el) return;
105+
106+
if (el.tagName && el.tagName.toLowerCase() === 'details') {
107+
if (!el.open) el.open = true;
108+
}
109+
110+
// Re-align after opening (and also for latest-year headings).
111+
if (typeof el.scrollIntoView === 'function') {
112+
el.scrollIntoView({ block: 'start' });
113+
}
114+
}
115+
116+
if (document.readyState === 'loading') {
117+
document.addEventListener('DOMContentLoaded', openSponsorYearFromHash);
118+
} else {
119+
openSponsorYearFromHash();
120+
}
121+
window.addEventListener('hashchange', openSponsorYearFromHash);
122+
})();
123+
</script>
93124
{{ end }}

static/images/pascalCTF.png

-79.5 KB
Loading

static/images/pascalctf2026.jpeg

79.7 KB
Loading

0 commit comments

Comments
 (0)