Last active
January 2, 2025 14:21
-
-
Save JosephLerouxBook/02c091597bebae30be61ef8676267e9d to your computer and use it in GitHub Desktop.
[Hackropole] Aaarg : résolution - Reverse Engineering
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Aaarg - Reverse Engineering | |
Tout d'abord en analysant le fichier aaarg avec un éditeur de texte on remarque l'utilisation de bibliothèques C++. | |
De ce fait on comprend que ce fichier contient du code compilé. | |
N'ayant pas de connaissances dans ce domaine, on se dirige alors vers des décompilateurs existants tels que BinaryNinja, Angr, ou encore Hex-Rays | |
Ce dernier nous donne un code dans lequel il sera plutôt simple de remarquer une anomalie en plein milieu. | |
```C | |
char byte_402010[278] = | |
{ | |
'F', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'C', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'S', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'C', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'{', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'f', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'9', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'a', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'3', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'8', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'a', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'd', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'a', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'c', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'e', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'9', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'd', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'd', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'a', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'3', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'a', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'9', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'a', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'e', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'5', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'3', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'e', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'7', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'a', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'e', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'c', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'1', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'8', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'0', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'c', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'5', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'a', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'7', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'3', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'd', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'b', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'b', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'7', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'c', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'3', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'6', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'4', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'f', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'e', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'1', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'3', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'7', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'f', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'c', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'6', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'7', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'2', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'1', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'd', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'7', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'9', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'9', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'7', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'c', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'5', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'4', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'e', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'8', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'd', | |
'\xE2', | |
'\x80', | |
'\x8D', | |
'}', | |
'\0' | |
}; // weak | |
``` | |
On reconnaît alors assez rapidement la clé "FCSC" au début. | |
Ensuite, on récupère la clé qui est séparée par un enchaînement de caractères spéciaux : | |
```C | |
'\xE2', | |
'\x80', | |
'\x8D', | |
``` | |
*Je n'ai personnellement pas réalisé de programme pour faire le tri des caractères spéciaux, il aurait été judicieux de le faire, surtout si nous sommes amenés à réaliser une tâche similaire à l'avenir.* | |
Une fois le tri effectué, nous pouvons récupérer le Flag : | |
FCSC{f9a38adace9dda3a9ae53e7aec180c5a73dbb7c364fe137fc6721d7997c54e8d} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment