ygor-sena / 42event-april-fools-2023

On the occasion of the April Fool's Day of 2023, the 42 staff devised a fun challenge for its global student body. The project had to be completed in three days and there were 18 exercises to be done. Each exercise was worth 5 points and the last one 15 points. Project grades spanned from 0 to 100 with cumulative rewards on the intranet.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OS Language Grade Status

πŸ“£ Introduction

βš™οΈ How the event worked

On the occasion of the April Fool's Day of 2023, the 42 staff devised a fun challenge for its global student body. The project had to be completed in three days and there were 18 exercises to be done. Each exercise was worth 5 points and the last one 15 points. Project grades spanned from 0 to 100. If the final grade after evaluation was 50, 75 or 100, the student received cumulative rewards on the intranet.

⚠️ The event true intention

The early demo of ChatGPT on November 30, 2022, took the world by a storm. Catastrophic predictions started to the made. Regarding the software development world, it was said that artificial intelligence (AI) would soon eliminate the need for developers. It remains evident that developers will continue to play crucial roles in the future of software development.

Through a series of exercises, the event gave its opinion about the matter. The exercises made the students explore contemporary problems and API updates beyond ChatGPT's training scope, which ended in September, 2021. Thus, the exercises encouraged the students to try different programming languages. I myself had to write solutions in Shell Script, C, Python, Perl and PHP.

This experience underscored the importance of robust programming skills alongside AI assistance. It emphasized that while AI enhances technical problem-solving capabilities, our human creativity and analytical skills remain indispensable. Last but not least, human jokes are far better than AI generated ones.

πŸš€ About the exercises and their solutions

βœ… Exercise 00

This exercise asked the student to join the official Slack channel of the event.

βœ… Exercise 01

Create a bash script that writes an infinite number of times the word "yes". The use of echo, cat and printf was not allowed.

βœ… Exercise 02

Here, the students had to create a file containing only "42" and its name was _\\!\@#$%\^\&\*\(\)_......txt. There are some possible solutions here: 1) escape the characters or 2) use single and double quotes.

βœ… Exercise 03

In a file named joke.txt, the student had to write its best joke using 256 characters or less.

βœ… Exercise 04

At their own risk, the students had to read a QR Code redirecting to this video: https://www.youtube.com/watch?v=dQw4w9WgXcQ. A file containing the lyrics of "Rick Astley - Never Gonna Give You Up" had to be turned in.

βœ… Exercise 05

This exercise asked the students to write a Perl script that prompts the user for input and checks whether the input is a palindrome.

βœ… Exercise 06

Here, the language requested was PHP. The task was to write a script that challenges the user to a game of rock-paper-scissors against the computer.

βœ… Exercise 07

This exercise introduced me to code golfing, which is a type of recreational computer programming competition in which participants strive to achieve the shortest possible source code that solves a certain problem.

The task was to write a C program with the smallest number of characters possible. The program had to accept two parameters and print them with a \n (newline) character and the end. Thus, it had to return the number of parameters printed. If the number of arguments provided wasn't equal to two, the program should do nothing.

βœ… Exercise 08

The task here was to write a C program that calculates the value of a blackjack hand following some specified constraints.

🟒 Exercise 09

This exercise asked the students to write a C program that accepts strings as argument and prints them in a rectangular frame, one string per line. If no strings are provided (argc is 1), then nothing should be displayed.

βœ… Exercise 10

This is the one I had the most fun doing it! This exercise gave the student a bunch of encrypted messages, totalizing 7 of them. The following encryptions were used:

  • rot42
  • Base64
  • Atbash
  • Javascript Keycode
  • Nato phonetic
  • leet
  • Playfair with the key PLAYFAIR

To find the solution, I used the websites listed in the next section to employ a trial-and-error approach. I also collaborated with my colleagues on Slack to tackle the challenging problems and find the solutions together.

If you want to try it yourself, here are the 7 encrypted messages:

Veh jxyi unuhsysu oek mybb xqlu je mhyju jxu fqiimeht yd q iocrebkc.jnj vybu.
 
Q29uZ3JhdHVsYXRpb25zIG9uIGRlY29kaW5nIHRoaXMgbGluZSwgdGhlIGZpcnN
0IGxldHRlciBpczogaw==

Xlmtizgfozgrlmh lm wvxlwrmt gsrh ormv, gsv gsriw ovggvi rh: s

67 79 78 71 82 65 84 85 76 65 84 73 79 78 83 79 78 68 69 67 79 68 73 78 71 84 72
73 83 76 73 78 69 84 72 69 78 69 88 84 67 72 65 82 65 67 84 69 82 73 83 50

Charlie Oscar November Golf Romeo Alpha Tango Uniform Lima Alpha Tango
India Oscar November Sierra ... Oscar November ... Delta Echo Charlie Oscar
Delta India November Golf ... Tango Hotel India Sierra ... Lima India November
Echo ... Tango Hotel Echo ... November Echo X-Ray Tango ... Lima Echo Tango
Tango Echo Romeo ... India Sierra ... Juliett

C0N6r47U14710N5 0N D3C0D1N6 7H15 11N3 7H3 N3X7 13773r 15 F

RSOEBLNZAYNDQOT QT IKITREUM OEBO YEUM, NKG AYTN PGSZNMB RT: K
βœ… Exercise 11

The task at hand was to write a Python program that incorporated the open source PokeAPI, retrieved information on various PokΓ©mon and displayed them once the user entered the name of a PokΓ©mon.

βœ… Exercise 12

This exercise is about writing a program that uses SMTP to send email with an attachment. The use of Bash wasn't allowed. I solved this challenge in Python and used "smtp.office365.com" as a host.

βœ… Exercise 13

This exercise was about analyzing an executable program. At first, it's a playable game and the task was to retrieve its password. I used strings command to look for printable strings in a file, objdump -s to print the complete content of all sections of the file to look for potential password clues and Ghidra, a software reverse engineering (SRE) suite of tools developed by NSA. This was a fun exercise because I mutually shared a lot information with my colleagues in order to discover the solution.

βœ… Exercise 14

By far the hardest exercise of the list! The task was to write a program that generates the Sastantua's pyramids. The program accepts an integer that determines the size of the pyramid and draw it according the provided size parameter. I solved it in Python.

Here's an example of a Sastantua's pyramid when size argument is 5:

sastantua

βœ… Exercise 15

This exercise introduced me to the fantastic world of stenography! It's like writing in code, except the only people who can decipher it are other stenographers (and maybe Sherlock Holmes), Are you?

Given an image, the student had to find the flag. The whole idea of stenography is that a message is embedded into an image by altering the values of some pixels, which are chosen by an encryption algorithm. The websites used to find the flag are listed in the next section.

βœ… Exercise 16

Using ChatGPT, generate his best joke. The file cannot exceed 512 characters!

Warning

I assure you, it's a terrible joke...

βœ… Exercise 17

This fun exercise introduced me to zero-width character stenography (ZWSP). The idea is to convert a private message into binary data. Then the binary characters space, zero and one are mapped to three different zero-width characters. This will be appended to a public message. The result is that only the public message will be visible.

This exercise asked the students to analyze a tweet print screen image that had a hidden message to be retrieved. Looking closely at the tweet image, it's possible to notice some weird characters formatting. Thus, a series of hexadecimal values were given as a tip to tackle the problem.

To find the hidden message, I had to first convert the given hexadecimal characters to UTF-8 characters. These were the characters used to embed the hidden message. The next step was to write the public tweet message with normal characters and rebuild the weird formatting tweet by looking at the image and attempting insert the special UTF-8 characters on the correct order. To do that, the VSCode editor has an option for rendering whitespaces, which allows users to visually differentiate normal and special characters.

The image below shows the tweet rebuild process using VSCode and https://holloway.nz/steg/ to find a hidden message that made sense:

ex17

πŸ“– References

About

On the occasion of the April Fool's Day of 2023, the 42 staff devised a fun challenge for its global student body. The project had to be completed in three days and there were 18 exercises to be done. Each exercise was worth 5 points and the last one 15 points. Project grades spanned from 0 to 100 with cumulative rewards on the intranet.

License:GNU General Public License v3.0


Languages

Language:Python 47.9%Language:C 36.1%Language:PHP 10.3%Language:Perl 5.5%Language:Shell 0.3%