Skip to content

Instantly share code, notes, and snippets.

Chrono rage

Link to the challenge

In this challenge we are given two files,

  • a pcap dump of the traffic between the attacker and the server,
  • the server's implementation

Analysis of the script

Le Calme Avant La Tempest

Lien vers le challenge

Avertissement

Je me doutais que ce challenge pouvait รชtre rรฉsolu avec TempestSDR mais je ne trouvais pas รงa assez intรฉressant d'essayer de comprendre le projet et me suis mis en tรชte de faire cette extraction par moi-mรชme.

Le code que je prรฉsente est probablement pas super optimal, je l'ai รฉcrit pendant le CTF et la seule modification que je me suis permis d'y apporter est de sรฉparer en plusieurs fichiers pour plus de lisibilitรฉ et vous รฉviter la lecture d'un fichier de 1694 lignes.

Canflag

Link to the challenge

We are given a pcap of a CAN bus that does not have too many different packets. When reading the packets we see that some seem to have text in them, in their data field. We also see a few packets that interest us:

  • the one which has 'FCSC' has id 2 and is an extended packet
  • the one which has '{' has id 2 and is not an extended packet

ย Au boolot

Link to the challenge

Understanding the problem

We have an oracle to the output of a logic circuit only composed of XORs. The circuit takes in input a 128 bit value, and returns a 256 bit output value.

We can send upto 130 different input values to the oracle before he asks us to guess the output of another value.

@toby-bro
toby-bro / get_ip_info.sh
Created February 18, 2026 18:30
Pretty print the ip addresses associated with the different interfaces of a linux device
#!/bin/bash
# Print the table header
echo -e 'โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ'
echo -e 'โ”‚ Interface โ”‚ IP Address โ”‚'
echo -e 'โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค'
# Get the list of network interfaces and their IP addresses
ip -brief address | awk '{
printf "โ”‚ %-15s โ”‚ %-18s โ”‚\n", $1, $3
@toby-bro
toby-bro / get_connections.sh
Created February 18, 2026 18:28
Get all the listening ports of a linux device in a nice interface
#!/bin/bash
# Print the table header
echo -e 'โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ'
echo -e 'โ”‚ Process โ”‚ Local Address โ”‚ Foreign Address โ”‚ Prot โ”‚ RcvQ โ”‚ SndQ โ”‚'
echo -e 'โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ค'
# Get the output of ss and process it
sudo ss -lntup | awk '
function truncate(str, max_len) {

This challenge's instructions were fairly straightforward and the principal difficulty I met in its resolution was not botching the implementation of Gold and LFSR... which I did many times. Resigned I went on github cloned a repo: chrinels/sequences that did it flawlessly and now things were going.

Once this was done the script basically just :

  • reads the audio file
  • enumerated the different phases specified in the instructions, and for each of them
    • calculated the correlation between the Gold code step and the audio data
    • determined for each bit if the data were positively correlated then the bit was 1 else 0
    • translated the binary to ASCII
  • enjoyed

File format

Naรฏve bash

To solve this challenge I started with a pure bash approach. The original file is i_0 q_0 i_1 q_1 ... So i start by separating each i_k q_k on a separate line

xxd -c 8 -g 4 -p file-format.iq
@toby-bro
toby-bro / ctftime-top-10.sh
Created August 4, 2025 17:17
Get the CTF's that are counted by ctftime for the team score (the 10 best)
#!/bin/bash
TEAM=00001 #REPLACE WITH THE TEAM NUMBER THAT INTERESTS YOU
table=$(curl -s https://ctftime.org/team/${TEAM} | grep -P '<div class="tab-pane active" id="rating_202\d"' -A 999 | grep -P '<div class="tab-pane" id="rating_202\d"' -B 999 | grep -P '<tr><td class="place_ico"></td><td class="place">\d+</td><td><a href="/event/\d+">[\s\w\d]+</a></td><td>[\d\.]+</td><td>[\d\.]+</td></tr>'); for i in $(echo $table | grep -Po '(?<=<td>)[\d\.]+(?=</td></tr>)' | sort -h | tail -n 10) ; do echo -n "$i -- "; echo $table | grep $i | grep -Po '(?<=<a href="/event/\d{4}">)[\w\s\d]+(?=</a>)' ; done

Un cercle est un carrรฉ

Lien vers le challenge

Ce problรจme a รฉtรฉ de loin celui qui m'a le plus fait m'arracher des cheveux lors de ce FCSC.

Je passerai les dรฉtails mais aprรจs avoir passรฉ plus d'une journรฉe ร  faire des projections de segments sur des plans diagonaux puis sur des arrรชtes pour refaire une sorte de projection cubique ร  la maniรจre d'une projection sphรฉrique du segment $[P, Q]$ et avoir vu que c'รฉtait pas la solution exacte mais une bonne approximation... J'ai enragรฉ et j'ai cherchรฉ sur internet et je suis tombรฉ sur

La mรฉthode de la fourmi paresseuse